/* Helios-inspired Material surfaces, typography and interaction states. */
:root {
  color-scheme: light;
  --ink: #252841; --muted: #697087; --primary: #5552d6; --primary-dark: #413caf;
  --teal: var(--primary); --mint: #eeedff; --paper: #f5f6fb; --line: #e5e7f0;
  --white: #fff; --amber: #ffcf70; --shadow: 0 4px 20px #25284108;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 14px/1.6 "Segoe UI", Arial, sans-serif; }
a { color: var(--primary); text-underline-offset: 4px; }
button, input, select, textarea { font: inherit; }
body .ui-widget, body .ui-button { font-family: "Segoe UI", Arial, sans-serif; }
a, button { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #8179ef; outline-offset: 4px; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 256px; z-index: 30; background: #252544; color: #fff; padding: 26px 16px 20px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #5b5878 transparent; }
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; font-size: 25px; font-weight: 750; letter-spacing: -.8px; }
.sidebar .brand { padding: 0 14px; }
.brand-icon { color: var(--amber); font-size: 35px; line-height: 1; }
.workspace-label { margin: 30px 16px 12px; color: #b2b0cf; font-size: 10px; font-weight: 600; letter-spacing: 1.8px; }
.sidebar nav { display: grid; gap: 3px; }
.sidebar nav a { display: flex; align-items: center; gap: 13px; min-height: 43px; padding: 10px 14px; border-radius: 8px; color: #d0cee4; text-decoration: none; font-size: 12px; font-weight: 500; transition: background .15s, color .15s; }
.sidebar nav a .pi { width: 20px; font-size: 17px; flex-shrink: 0; }
.sidebar nav a:hover { background: #ffffff0c; color: white; }
.sidebar nav a.active { background: #6860da; color: white; box-shadow: 0 4px 10px #13132a30; }
.sidebar-foot { border-top: 1px solid #ffffff16; margin: 26px 14px 0; padding-top: 18px; color: #d7d5e8; font-size: 11px; }
.sidebar-foot span { color: #aaa7c6; font-size: 10px; }
.workspace-shell { margin-left: 256px; }
.topbar { min-height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 15px 36px; border-bottom: 1px solid var(--line); background: white; }
.tenant-name { font-weight: 600; font-size: 13px; }
.account-actions { display: flex; align-items: center; gap: 20px; }
.role-name { color: var(--muted); font-size: 10px; letter-spacing: .7px; max-width: 260px; }
.topbar .ui-messages { display: none; }
.menu-toggle { display: none; border: 0; border-radius: 8px; width: 44px; height: 44px; background: var(--mint); color: var(--primary); cursor: pointer; }
.nav-backdrop { display: none; }
main { max-width: 1530px; margin: auto; padding: 32px 36px; }
main.registration-wide { width: 100%; max-width: none; min-width: 0; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.eyebrow { color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: 1.8px; }
h1 { font-size: 29px; line-height: 1.25; letter-spacing: -.9px; font-weight: 650; margin: 9px 0 10px; }
h2 { font-size: 18px; font-weight: 650; letter-spacing: -.3px; margin: 0 0 14px; }
h3 { font-size: 16px; }
p { color: var(--muted); margin: 0 0 20px; }
.page-heading p { margin: 0; }
.secure-badge { display: flex; gap: 8px; align-items: center; white-space: nowrap; color: #397460; background: #eaf5ef; padding: 7px 12px; border-radius: 24px; font-size: 11px; font-weight: 600; }
.welcome-card { position: relative; display: flex; align-items: center; justify-content: space-between; overflow: hidden; border-radius: 16px; background: linear-gradient(115deg, #4c47b8, #6960db); padding: 32px 38px; color: white; margin-bottom: 30px; box-shadow: 0 8px 24px #5049bd20; }
.hero-kicker { font-size: 10px; letter-spacing: 2px; font-weight: 700; color: #e1dcff; }
.welcome-card h2 { font-size: 34px; line-height: 1.18; margin: 14px 0; letter-spacing: -.9px; }
.welcome-card p { color: #e2dfff; max-width: 420px; font-size: 13px; }
.hero-actions { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.hero-button { background: var(--amber); color: #3f3353; padding: 11px 16px; border-radius: 7px; text-decoration: none; font-weight: 650; font-size: 12px; box-shadow: 0 3px 8px #26205125; }
.hero-button:hover { background: #ffdb94; }
.hero-button .pi { margin-right: 7px; }
.hero-text-link { color: white; font-size: 12px; font-weight: 600; text-decoration: none; }
.hero-text-link .pi { margin-left: 10px; font-size: 11px; }
.vision-orbit { width: 216px; height: 216px; flex: 0 0 auto; margin: 0 32px; border: 1px solid #ffffff30; border-radius: 50%; display: grid; place-items: center; position: relative; }
.vision-orbit::before { content: ""; position: absolute; inset: 24px; border: 1px solid #ffffff30; border-radius: 50%; }
.vision-eye { width: 118px; height: 118px; display: grid; place-items: center; border-radius: 32px; background: #ffffff15; box-shadow: 0 15px 40px #29237c30; transform: rotate(-10deg); }
.vision-eye .pi { font-size: 64px; color: #fff0cc; transform: rotate(10deg); }
.orbit-dot { position: absolute; width: 18px; height: 18px; background: var(--amber); border-radius: 50%; right: 12px; top: 32px; box-shadow: 0 0 0 7px #ffcf7020; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 14px; }
.section-heading h2 { margin: 0; }
.section-heading > span { color: var(--muted); font-size: 11px; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin-bottom: 28px; }
.metric { background: white; border: 1px solid var(--line); border-radius: 12px; padding: 22px; box-shadow: var(--shadow); min-width: 0; }
.metric-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.metric-top span { color: var(--muted); font-size: 12px; font-weight: 600; }
.metric-top .pi { padding: 10px; border-radius: 10px; background: var(--mint); color: var(--primary); }
.metric:nth-child(2n) .metric-top .pi { color: #a4711b; background: #fff4db; }
.metric strong { display: block; font-size: 35px; font-weight: 650; letter-spacing: -1px; margin: 8px 0 0; }
.metric small { color: var(--muted); font-size: 10px; }
.two-column { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.panel { background: white; padding: 26px; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 24px; box-shadow: var(--shadow); min-width: 0; }
.card-icon { display: inline-grid; place-items: center; width: 43px; height: 43px; background: var(--mint); color: var(--primary); border-radius: 12px; margin-bottom: 18px; font-size: 20px; }
.card-icon.amber { background: #fff3d8; color: #a4711b; }
.workflow-steps { list-style: none; padding: 0; margin: 24px 0; }
.workflow-steps li { display: flex; align-items: center; gap: 14px; margin: 0 0 19px; }
.workflow-steps li > span { background: #f2f1fc; color: var(--primary); width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; font-size: 11px; font-weight: 700; flex-shrink: 0; }
.workflow-steps strong, .assurance-item strong { font-size: 12px; font-weight: 650; }
.workflow-steps small { display: block; color: var(--muted); font-size: 11px; }
.assurance-item { display: flex; gap: 12px; margin-bottom: 16px; }
.assurance-item > .pi { color: #529780; padding-top: 5px; }
.assurance-item p { font-size: 12px; margin: 3px 0 0; }
.action-link { font-size: 12px; font-weight: 650; text-decoration: none; display: inline-block; padding: 6px 0; }
.action-link:hover { text-decoration: underline; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; align-items: start; }
.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.field label { font-size: 12px; font-weight: 600; color: #50556d; }
.wide, .form-grid > .ui-datatable, .form-grid > p, .form-grid > .ui-messages { grid-column: 1 / -1; }
body .ui-inputfield, select { width: 100%; min-height: 44px; border: 1px solid #cbd0df; border-radius: 6px; background: #fff; padding: 11px 12px; color: var(--ink); font: inherit; box-shadow: none; transition: border-color .15s, box-shadow .15s; }
body .ui-inputfield:hover, select:hover { border-color: #989ab3; }
body .ui-inputfield.ui-state-focus, body .ui-inputfield:focus, select:focus { border-color: var(--primary); outline: 0; box-shadow: 0 0 0 2px #5552d630; }
body .ui-inputfield.ui-state-error { border-color: #c64357; background: #fff9fa; }
body .ui-button { width: fit-content; min-height: 42px; border: 1px solid var(--primary); border-radius: 6px; background: var(--primary); color: white; font-size: 12px; font-weight: 650; padding: 3px 9px; box-shadow: 0 3px 7px #5552d628; transition: background .15s, box-shadow .15s; }
body .ui-button:hover { background: var(--primary-dark); border-color: var(--primary-dark); box-shadow: 0 4px 10px #5552d63a; }
body .ui-button.ui-state-focus { outline: 3px solid #b6b0f3; outline-offset: 3px; }
body .ui-button.ui-state-disabled { opacity: .55; box-shadow: none; }
body .ui-button.sign-out { border-color: var(--line); color: #57596f; background: white; box-shadow: none; white-space: nowrap; }
body .ui-button.sign-out:hover { background: var(--mint); color: var(--primary); }
body .ui-datatable { font-size: 12px; width: 100%; overflow-x: auto; }
body .ui-datatable thead th { background: #f7f7fc; color: #666a83; border: 0; border-bottom: 1px solid var(--line); font-size: 11px; font-weight: 650; padding: 14px; text-align: left; }
body .ui-datatable tbody td { border: 0; border-bottom: 1px solid #eef0f6; padding: 16px 14px; overflow-wrap: anywhere; }
body .ui-datatable tbody tr { background: white; color: var(--ink); }
body .ui-datatable tbody tr:hover { background: #fafaff; }
body .ui-datatable tbody tr.ui-state-highlight { background: var(--mint); color: var(--primary-dark); }
body .ui-paginator { background: white; border: 0; padding-top: 18px; font-size: 12px; }
body .ui-paginator .ui-paginator-page.ui-state-active { background: var(--primary); color: white; border-radius: 6px; }
body .ui-datatable .ui-column-filter { font-size: 11px; padding: 6px; min-height: 32px; min-width: 55px; }
body .ui-chkbox .ui-chkbox-box { border-color: #a1a4ba; border-radius: 4px; }
body .ui-chkbox .ui-chkbox-box.ui-state-active { background: var(--primary); border-color: var(--primary); }
body .ui-selectbooleancheckbox { display: flex; align-items: center; }
body .ui-messages { font-size: 13px; }
.ui-button + .ui-button { margin-left: 6px; }
.measurement-row { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 20px; border-top: 1px solid var(--line); padding: 22px 0; }
.measurement-row small { display: block; color: var(--muted); }
.result-card { border: 1px solid #d3d0f5; background: #f5f4ff; padding: 22px; border-radius: 10px; }
.result-card > span { font-size: 10px; letter-spacing: 1px; text-transform: uppercase; }
.result-card h2 { margin-top: 7px; }
input[type=file] { max-width: 100%; padding: 13px; border: 1px dashed #b7b3dd; border-radius: 6px; background: #fbfaff; }
footer { padding: 0 36px 25px; color: var(--muted); font-size: 10px; }
.skip { position: fixed; top: -100px; }
.skip:focus { top: 8px; left: 16px; z-index: 100; background: white; padding: 12px; border-radius: 6px; }
.public-header { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 24px 6vw; border-bottom: 1px solid var(--line); background: white; }
.public-header > a:last-child { font-size: 12px; font-weight: 600; }
.public-content { max-width: 1120px; padding: 64px 30px; }
.public-content > h1 { font-size: 49px; max-width: 730px; margin-bottom: 24px; }
.lead { font-size: 19px; max-width: 750px; margin-bottom: 40px; }
.public-page .brand { color: var(--primary); }
.public-page .panel { padding: 30px; }
.login-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 0; max-width: 1100px; padding: 0; margin: 48px auto; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: white; box-shadow: 0 16px 60px #30305a0b; }
.login-story { background: linear-gradient(145deg, #383375, #6860cf); padding: 44px; color: white; display: flex; flex-direction: column; }
.login-story h1 { font-size: 41px; line-height: 1.15; margin: 26px 0 20px; }
.login-story p { color: #dedbf5; max-width: 300px; font-size: 14px; }
.login-art { display: grid; place-items: center; height: 180px; margin: 12px auto 30px; width: 180px; border: 1px solid #ffffff24; border-radius: 50%; box-shadow: 0 0 0 24px #ffffff04, 0 0 0 48px #ffffff03; }
.login-art span { font-size: 112px; color: var(--amber); line-height: 1; }
.login-story-foot { margin-top: auto; color: #e6e1ff; font-size: 12px; }
.login-story-foot small { color: #c4bfe8; font-size: 10px; }
.login-form-wrap { padding: 62px 44px; align-self: center; }
.login-form-wrap h1 { font-size: 32px; margin-top: 12px; }
.login-form-wrap .panel { border: 0; box-shadow: none; padding: 12px 0 0; margin-bottom: 18px; }
.login-form-wrap > a { font-size: 12px; }
.public-page #login .form-grid { grid-template-columns: 1fr; }
.login-page #login .ui-button { width: 100%; min-height: 46px; margin-top: 5px; }
.login-register { margin: 28px 0 0; padding-top: 22px; border-top: 1px solid var(--line); font-size: 12px; }
@media (max-width: 1150px) {
  .role-name { display: none; }
  main { padding: 28px; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .vision-orbit { width: 160px; height: 160px; margin: 0 0 0 20px; }
  .welcome-card { padding: 28px; }
  .login-layout { margin: 32px; }
}
@media (max-width: 900px) {
  .two-column { grid-template-columns: 1fr; gap: 0; }
  .vision-orbit { display: none; }
  .login-story, .login-form-wrap { padding: 32px; }
}
@media (max-width: 760px) {
  .sidebar { width: 270px; transform: translateX(-100%); transition: transform .2s ease; }
  .navigation-open .sidebar { transform: translateX(0); }
  .navigation-open { overflow: hidden; }
  .nav-backdrop:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 25; border: 0; background: #15132b80; }
  .menu-toggle { display: grid; place-items: center; flex-shrink: 0; }
  .workspace-shell { margin-left: 0; }
  .topbar { padding: 12px 16px; gap: 12px; min-height: 70px; }
  .tenant-name { margin-right: auto; font-size: 11px; }
  body .ui-button.sign-out { font-size: 11px; }
  main { padding: 24px 16px; }
  .page-heading { align-items: flex-start; }
  .secure-badge { display: none; }
  h1 { font-size: 25px; }
  .welcome-card { padding: 26px; }
  .welcome-card h2 { font-size: 31px; }
  .metric-grid { gap: 12px; }
  .metric { padding: 16px; }
  .metric-top { align-items: flex-start; }
  .metric-top .pi { padding: 7px; font-size: 12px; }
  .metric strong { font-size: 29px; }
  .panel { padding: 20px; }
  .form-grid { grid-template-columns: 1fr; }
  .measurement-row { grid-template-columns: 1fr 1fr; }
  .measurement-row > div:first-child { grid-column: 1 / -1; }
  .public-content > h1 { font-size: 35px; }
  .public-header { padding: 18px 20px; }
  .public-content { padding: 32px 18px; }
  .login-layout { grid-template-columns: 1fr; margin: 24px 16px; padding: 0; }
  .login-story { padding: 28px; }
  .login-story h1 { font-size: 31px; margin: 16px 0 10px; }
  .login-story p { max-width: none; margin: 0; font-size: 12px; }
  .login-art, .login-story-foot { display: none; }
  .login-form-wrap { padding: 32px 26px; }
  footer { padding: 0 16px 24px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; } }
@media print {
  .sidebar, .topbar, footer, .ui-button, .nav-backdrop, .hero-actions { display: none !important; }
  .workspace-shell { margin: 0; }
  body { background: white; }
  .panel { border: 1px solid #ddd; box-shadow: none; }
  main { padding: 0; }
  .public-header { border: 0; }
}

/* Table-first maintenance and modal workflows. */
.crud-toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 20px; }
.crud-toolbar > .ui-messages:empty { display: none; }
.table-caption { font-size: 11px; color: var(--muted); font-weight: 500; }
body .ui-datatable .ui-datatable-header { background: #fafaff; border: 0; border-bottom: 1px solid var(--line); text-align: left; padding: 12px 14px; }
body .ui-datatable .row-actions { width: 240px; min-width: 160px; }
body .row-actions .ui-button { margin: 3px; min-height: 34px; font-size: 11px; }
body .row-actions .ui-button-text { white-space: nowrap; }
body .ui-dialog.crud-dialog { border-radius: 14px; border: 1px solid var(--line); box-shadow: 0 24px 80px #17152d40; max-width: calc(100vw - 32px); }
body .crud-dialog .ui-dialog-titlebar { background: white; color: var(--ink); border-bottom: 1px solid var(--line); padding: 20px 24px; }
body .crud-dialog .ui-dialog-title { font-weight: 650; font-size: 19px; }
body .crud-dialog .ui-dialog-content { background: white; color: var(--ink); padding: 24px; max-height: calc(100dvh - 150px); overflow: auto; }
body .crud-dialog .ui-dialog-titlebar-close { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; }
body .crud-dialog .ui-dialog-titlebar-close:hover { background: var(--mint); }
body .ui-widget-overlay { background: #1b183c; opacity: .45; }
.dialog-actions { display: flex; gap: 10px; flex-wrap: wrap; padding-top: 22px; margin-top: 20px; border-top: 1px solid var(--line); }
.crud-dialog form > .ui-button { margin-top: 20px; }
body .ui-button.ui-button-outlined { color: var(--primary); background: white; box-shadow: none; border-color: #c8c4ec; }
body .ui-button.danger-button { background: #b53a50; border-color: #b53a50; color: white; }
body .ui-button.danger-button.ui-button-outlined { background: white; color: #a72d44; border-color: #dfb1bc; }
.record-details { margin: 0; display: grid; gap: 0; }
.record-details > div { display: grid; grid-template-columns: minmax(130px, 1fr) 2fr; gap: 20px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.record-details dt { font-size: 12px; color: var(--muted); font-weight: 600; }
.record-details dd { margin: 0; font-size: 13px; overflow-wrap: anywhere; white-space: pre-wrap; }
.confirmation-copy { padding: 16px; border-radius: 8px; background: #fff2f3; color: #853549; }
body .ui-inputfield[readonly] { background: #f5f6fa; color: var(--muted); }
@media (max-width: 760px) {
  body .crud-dialog .ui-dialog-content { padding: 18px; }
  body .crud-dialog .ui-dialog-titlebar { padding: 16px 18px; }
  .record-details > div { grid-template-columns: 1fr; gap: 4px; }
  body .ui-datatable-reflow .row-actions { display: block; width: 100%; }
  body .ui-dialog.crud-dialog { max-width: calc(100vw - 20px); }
}
