:root {
  --ink: #182435;
  --muted: #5a687a;
  --line: #d9e0ea;
  --panel: #ffffff;
  --bg: #f5f7fa;
  --nav: #16324f;
  --nav-2: #204b73;
  --blue: #246b9f;
  --green: #197a57;
  --amber: #a66200;
  --red: #b42318;
  --teal: #0f766e;
  --focus: #f7c948;
  --shadow: 0 8px 22px rgba(30, 47, 71, 0.09);
  color-scheme: light;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body,
.app {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  letter-spacing: 0;
}

html.dialog-scroll-locked,
body.dialog-scroll-locked {
  overflow: hidden;
  overscroll-behavior: none;
}

dialog[open] {
  overscroll-behavior: contain;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(22, 50, 79, 0.96), rgba(15, 118, 110, 0.88)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='420' height='260' viewBox='0 0 420 260'%3E%3Cg fill='none' stroke='%23fff' stroke-opacity='.16' stroke-width='2'%3E%3Cpath d='M20 58h380M20 124h380M20 190h380M78 20v220M164 20v220M250 20v220M336 20v220'/%3E%3C/g%3E%3C/svg%3E");
}

.login-panel {
  width: min(430px, 100%);
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 24px;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.login-brand {
  align-items: center;
  display: grid;
  gap: 12px;
  justify-items: center;
  margin-bottom: 20px;
  text-align: center;
}

.login-logo {
  height: auto;
  width: min(210px, 78vw);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  color: #fff;
  background: var(--nav);
  font-weight: 800;
}

.brand-title {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.2;
}

.brand-subtitle {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.93rem;
}

.field {
  display: grid;
  gap: 6px;
}

.field label,
.fieldset-label {
  color: #35455b;
  font-size: 0.86rem;
  font-weight: 700;
}

.field-help {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.inline-context {
  align-items: center;
  background: #fbfcfe;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  min-height: 44px;
  padding: 10px 12px;
}

.inline-context.active {
  background: #f6fbff;
  border-color: #b9d9fb;
  color: var(--ink);
}

.inline-context span {
  color: var(--muted);
  display: block;
  font-size: 0.84rem;
  margin-top: 3px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  min-height: 42px;
  padding: 9px 10px;
}

.field textarea {
  min-height: 84px;
  resize: vertical;
}

.custom-location-input {
  margin-top: 2px;
}

.custom-number-input {
  margin-top: 2px;
}

.custom-suite-input {
  margin-top: 2px;
}

input[type="file"][data-file-dropzone] {
  border-style: dashed;
  background: #fbfcfe;
}

.field.file-drop-active input[type="file"][data-file-dropzone] {
  background: #edf7ff;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(36, 107, 159, 0.14);
}

.field.file-drop-active label::after {
  color: var(--blue);
  content: " · drop file here";
  font-weight: 800;
}

.location-option-divider {
  color: #8b98a8;
}

.inline-entry-row td {
  background: #f6fbff;
  border-top: 1px solid #b9d9fb;
}

.inline-entry-form {
  padding: 12px;
}

.inline-entry-heading {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.inline-entry-heading span {
  color: var(--muted);
  font-size: 0.88rem;
}

.workorder-dialog {
  width: min(720px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(24, 36, 53, 0.28);
  max-height: min(88vh, 920px);
  overflow: auto;
  overscroll-behavior: contain;
  padding: 18px;
  -webkit-overflow-scrolling: touch;
}

.workorder-dialog::backdrop {
  background: rgba(24, 36, 53, 0.38);
}

.workorder-detail-dialog {
  background: #f6fbff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 28px 86px rgba(24, 36, 53, 0.32);
  max-height: min(88vh, 920px);
  overflow: hidden;
  overscroll-behavior: contain;
  padding: 0;
  width: min(1120px, calc(100vw - 36px));
}

.workorder-detail-dialog::backdrop {
  background: rgba(24, 36, 53, 0.42);
}

/* Work Orders top filter bar — clickable stat buttons that open category pop-outs. */
.wo-filter-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 10px;
}

.wo-filter-btn {
  display: grid;
  gap: 2px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 10px 12px;
  cursor: pointer;
  transition: border-color 0.12s, box-shadow 0.12s, background 0.12s;
}

.wo-filter-btn:hover {
  border-color: var(--blue);
  background: #fff;
}

.wo-filter-btn.active {
  border-color: var(--blue);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(36, 107, 159, 0.14);
}

.wo-filter-count {
  font-size: 1.3rem;
  font-weight: 850;
  line-height: 1;
  color: var(--ink);
}

.wo-filter-label {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--ink);
}

.wo-filter-sub {
  font-size: 0.74rem;
  color: var(--muted);
}

.wo-list-dialog {
  width: min(1040px, calc(100vw - 36px));
  max-height: min(88vh, 920px);
  overflow: hidden;
}

/* Only the OPEN dialog is a flex column — a closed <dialog> must stay
   display:none, otherwise the empty dialog renders as a stray white box. */
.wo-list-dialog[open] {
  display: flex;
  flex-direction: column;
}

.wo-list-search-field {
  margin: 10px 0;
}

.wo-list-search {
  width: 100%;
}

.wo-list-dialog-body {
  overflow: auto;
  min-height: 0;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.wo-search-section {
  display: grid;
  gap: 12px;
}

.wo-search-input-field {
  margin: 0;
}

.wo-search-mode-hint {
  background: #f8fbff;
  border: 1px solid #e1e9f2;
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.84rem;
  padding: 8px 10px;
}

.wo-search-input-field input {
  width: 100%;
}

.wo-search-empty,
.wo-search-summary {
  color: var(--muted);
  font-size: 0.86rem;
}

.wo-search-results {
  display: grid;
  gap: 8px;
}

.wo-search-result {
  align-items: center;
  background: #fbfcfe;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 10px 12px;
}

.wo-search-result-main {
  min-width: 0;
}

.wo-search-result-title {
  align-items: baseline;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.wo-search-result-title strong {
  color: var(--ink);
  font-size: 0.95rem;
}

.wo-search-result-side {
  align-items: flex-end;
  display: grid;
  gap: 6px;
  justify-items: end;
}

.wo-search-result-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

@media (max-width: 760px) {
  .wo-filter-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .wo-search-result {
    grid-template-columns: 1fr;
  }

  .wo-search-result-side {
    align-items: stretch;
    justify-items: stretch;
  }

  .wo-search-result-pills {
    justify-content: flex-start;
  }
}

.wo-detail-dialog-header {
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 16px 18px;
}

.wo-detail-dialog-header h2,
.wo-detail-dialog-header p {
  margin: 0;
}

.wo-detail-dialog-header h2 {
  font-size: 1.25rem;
  line-height: 1.2;
}

.wo-detail-dialog-header p:last-child {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 4px;
}

.wo-detail-dialog-header .eyebrow {
  color: var(--blue);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0;
  margin-bottom: 4px;
  text-transform: uppercase;
}

.wo-detail-dialog-body {
  max-height: calc(min(88vh, 920px) - 86px);
  overflow: auto;
  overscroll-behavior: contain;
  padding: 16px 18px 18px;
  -webkit-overflow-scrolling: touch;
}

.work-order-requests .table-wrap {
  margin-top: 8px;
}

.wo-request-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
  gap: 16px;
  align-items: start;
}

.wo-request-form {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 14px;
}

.wo-request-history {
  margin-top: 12px;
}

.wo-request-history summary {
  color: var(--ink);
  cursor: pointer;
  font-weight: 850;
  margin-bottom: 10px;
}

.wo-duplicate-warning {
  background: #fff7e6;
  border: 1px solid #f2c36b;
  border-radius: 8px;
  color: #5f4200;
  display: grid;
  gap: 4px;
  margin-top: 8px;
  padding: 8px 10px;
}

.wo-duplicate-warning strong {
  color: #6f4a00;
  font-size: 0.86rem;
}

.wo-duplicate-warning span,
.wo-duplicate-warning li {
  font-size: 0.78rem;
  line-height: 1.35;
}

.wo-duplicate-warning ul {
  display: grid;
  gap: 4px;
  list-style: none;
  margin: 2px 0 0;
  padding: 0;
}

.wo-duplicate-warning li {
  align-items: baseline;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.dialog-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.dialog-header .section-title,
.dialog-header .section-subtitle {
  margin: 0;
}

.dialog-close {
  flex: 0 0 auto;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(36, 107, 159, 0.14);
  outline: 0;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 14px;
}

.span-2 {
  grid-column: span 2;
}

.span-3 {
  grid-column: span 3;
}

.span-4 {
  grid-column: span 4;
}

.span-5 {
  grid-column: span 5;
}

.span-6 {
  grid-column: span 6;
}

.span-8 {
  grid-column: span 8;
}

.span-9 {
  grid-column: span 9;
}

.span-12 {
  grid-column: span 12;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.btn {
  min-height: 40px;
  border-radius: 6px;
  padding: 9px 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #e9eef5;
  color: var(--ink);
  font-weight: 750;
  white-space: nowrap;
}

.btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.btn.primary {
  background: var(--blue);
  color: #fff;
}

.btn.success {
  background: var(--green);
  color: #fff;
}

.btn.warning {
  background: #fff2d8;
  color: #754300;
}

.btn.danger {
  background: #ffe7e4;
  color: var(--red);
}

.btn.ghost {
  background: transparent;
  border: 1px solid var(--line);
}

.btn.ghost.danger {
  border-color: #f1b3ac;
  color: var(--red);
}

.btn.ghost.active {
  background: #e6f1fb;
  border-color: #9ec7ed;
  color: var(--blue);
}

.btn.compact {
  min-height: 34px;
  padding: 7px 10px;
}

a.btn {
  text-decoration: none;
}

.quick-open-row {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.quick-open-links {
  flex-wrap: wrap;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 244px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: var(--nav);
  color: #fff;
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

.sidebar .brand-row {
  margin: 0;
}

.sidebar-logo {
  background: #fff;
  border-radius: 8px;
  flex: 0 0 auto;
  height: 42px;
  object-fit: contain;
  padding: 4px;
  width: 48px;
}

.sidebar .brand-mark {
  background: #f7c948;
  color: #16324f;
}

.sidebar .brand-subtitle {
  color: rgba(255, 255, 255, 0.68);
}

.nav-list {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.nav-button {
  width: 100%;
  min-height: 42px;
  border-radius: 6px;
  padding: 9px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255, 255, 255, 0.84);
  background: transparent;
  text-align: left;
  font-weight: 720;
}

.nav-button svg {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-button.active,
.nav-button:hover {
  background: rgba(255, 255, 255, 0.13);
  color: #fff;
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 8px;
}

.role-pill,
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: fit-content;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1;
}

.app-version {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.45);
}

.content {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  min-height: 70px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 13px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar > div:first-child {
  min-width: 0;
}

.topbar h1 {
  margin: 0;
  font-size: 1.45rem;
  line-height: 1.2;
}

.topbar-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.role-pill {
  color: #fff;
  background: var(--teal);
}

.role-pill.manager {
  background: var(--blue);
}

.role-pill.accounting {
  background: var(--amber);
}

.role-pill.admin {
  background: #734da3;
}

.role-pill.ar {
  background: var(--green);
}

.notification-menu {
  position: relative;
}

.notification-trigger {
  position: relative;
}

.notification-count {
  align-items: center;
  background: var(--red);
  border-radius: 999px;
  color: #fff;
  display: inline-flex;
  font-size: 0.72rem;
  font-weight: 900;
  justify-content: center;
  min-width: 20px;
  padding: 2px 6px;
}

.notification-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 48px rgba(19, 42, 68, 0.16);
  color: var(--ink);
  max-height: min(70vh, 520px);
  overflow: auto;
  overscroll-behavior: contain;
  padding: 10px;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: min(380px, calc(100vw - 32px));
  z-index: 20;
  -webkit-overflow-scrolling: touch;
}

.notification-panel-header {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  padding: 4px 4px 10px;
}

.notification-panel-actions {
  display: flex;
  gap: 12px;
}

.notification-list {
  display: grid;
  gap: 8px;
}

.notification-item {
  align-items: start;
  background: #f8fbff;
  border: 1px solid #e1e9f2;
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 10px;
}

.notification-item.unread {
  background: #eef7ff;
  border-color: #b8d8f3;
}

.notification-item strong,
.notification-item p,
.notification-item span {
  display: block;
}

.notification-item p {
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.35;
  margin: 4px 0;
}

.notification-item span {
  color: var(--muted);
  font-size: 0.78rem;
}

.compact-empty {
  padding: 12px;
}

.view {
  padding: 22px 24px 32px;
  display: grid;
  gap: 18px;
}

.section {
  display: grid;
  gap: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  box-shadow: 0 1px 2px rgba(30, 47, 71, 0.04);
}

.home-view {
  gap: 22px;
}

.home-band {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(30, 47, 71, 0.04);
  display: flex;
  gap: 18px;
  justify-content: space-between;
  overflow: hidden;
  padding: 20px 22px;
}

.home-band-copy {
  min-width: 0;
}

.home-kicker {
  color: var(--amber);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.home-band h2 {
  font-size: clamp(1.45rem, 2vw, 2.05rem);
  line-height: 1.15;
  margin: 5px 0;
}

.home-band p {
  color: var(--muted);
  margin: 0;
}

.home-band-mark {
  flex: 0 0 auto;
  height: 94px;
  object-fit: contain;
  width: 112px;
}

.home-module-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.module-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(30, 47, 71, 0.04);
  display: grid;
  gap: 14px;
  min-height: 260px;
  padding: 16px;
}

.module-card-main {
  align-items: flex-start;
  display: grid;
  gap: 11px;
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.module-icon {
  align-items: center;
  background: #eef5f8;
  border: 1px solid #d7e6ee;
  border-radius: 8px;
  color: var(--nav);
  display: inline-flex;
  height: 40px;
  justify-content: center;
  width: 40px;
}

.module-icon svg {
  fill: none;
  height: 21px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  width: 21px;
}

.module-label {
  color: var(--muted);
  display: block;
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
}

.module-card h3 {
  font-size: 1.1rem;
  line-height: 1.18;
  margin: 2px 0 0;
}

.module-status {
  border: 1px solid #dce5ee;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1;
  padding: 5px 7px;
  white-space: nowrap;
}

.module-status.active {
  background: #edf8f3;
  border-color: #c5e6d7;
  color: var(--green);
}

.module-status.disabled {
  background: #fff7e8;
  border-color: #edd0a0;
  color: var(--amber);
}

.module-metric {
  display: grid;
  gap: 4px;
}

.module-metric strong {
  font-size: 1.8rem;
  line-height: 1;
}

.module-metric span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.module-card p {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.38;
  margin: 0;
}

.module-actions {
  align-items: end;
  align-self: end;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.atlasreports-view {
  gap: 0;
  padding: 0;
}

.atlasreports-toolbar {
  align-items: center;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 14px 20px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 18px 24px;
}

.atlasreports-title-block {
  align-items: center;
  display: flex;
  gap: 14px;
  min-width: 0;
}

.atlasreports-mark {
  flex: 0 0 auto;
  height: 50px;
  object-fit: contain;
  width: 58px;
}

.atlasreports-title-block h2 {
  font-size: 1.35rem;
  line-height: 1.15;
  margin: 3px 0;
}

.atlasreports-title-block p {
  color: var(--muted);
  margin: 0;
}

.atlasreports-actions {
  align-items: center;
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.atlasreports-actions .btn {
  white-space: nowrap;
}

.atlasreports-frame-shell {
  background: #fff;
  min-height: calc(100dvh - 150px);
  overflow: hidden;
}

.atlasreports-frame {
  background: #fff;
  border: 0;
  display: block;
  height: calc(100dvh - 150px);
  min-height: 720px;
  width: 100%;
}

.howto-hero {
  align-items: center;
  background: #f6fbff;
  border-color: #b9d9fb;
  display: flex;
  justify-content: space-between;
}

.howto-step-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.howto-step-card {
  align-items: flex-start;
  background: #fbfcfe;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  grid-template-columns: auto minmax(0, 1fr);
  padding: 13px;
}

.howto-step-number {
  align-items: center;
  background: var(--blue);
  border-radius: 8px;
  color: #fff;
  display: inline-flex;
  font-weight: 900;
  height: 34px;
  justify-content: center;
  width: 34px;
}

.howto-step-number svg {
  fill: none;
  height: 18px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  width: 18px;
}

.howto-step-meta {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.howto-step-card h3 {
  font-size: 1rem;
  line-height: 1.25;
  margin: 3px 0 6px;
}

.howto-list {
  color: var(--muted);
  display: grid;
  font-size: 0.88rem;
  gap: 6px;
  line-height: 1.38;
  margin: 0;
  padding-left: 18px;
}

.howto-step-card p {
  color: var(--muted);
  font-size: 0.88rem;
  margin: 0 0 10px;
}

.howto-step-actions {
  margin-top: 12px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
}

.section-title {
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.25;
}

.section-subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.kpi {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 13px;
}

.kpi-label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.kpi-value {
  margin-top: 7px;
  font-size: 1.55rem;
  line-height: 1;
  font-weight: 850;
}

.kpi-note {
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.82rem;
}

/* Compact KPI row — tighter cards so four fit comfortably on one line. */
.kpi-grid.compact {
  gap: 10px;
}

.kpi-grid.compact .kpi {
  padding: 10px 11px;
}

.kpi-grid.compact .kpi-value {
  margin-top: 4px;
  font-size: 1.3rem;
}

.kpi-grid.compact .kpi-note {
  margin-top: 4px;
  font-size: 0.78rem;
}

.entry-week-strip {
  padding: 11px 12px;
}

.entry-week-strip-grid {
  align-items: end;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(260px, 0.9fr) minmax(420px, 1.4fr);
}

.entry-week-controls {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(130px, 1fr));
}

.entry-week-strip .field label {
  font-size: 0.76rem;
}

.entry-week-strip .field input,
.entry-week-strip .field select {
  min-height: 36px;
  padding: 7px 9px;
}

.entry-mini-kpis {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(4, minmax(82px, 1fr));
}

.mini-kpi {
  background: #fbfcfe;
  border: 1px solid var(--line);
  border-radius: 7px;
  min-height: 54px;
  padding: 8px 9px;
}

.mini-kpi span {
  color: var(--muted);
  display: block;
  font-size: 0.68rem;
  font-weight: 850;
  line-height: 1.1;
  text-transform: uppercase;
}

.mini-kpi strong {
  display: block;
  font-size: 1.04rem;
  line-height: 1.1;
  margin-top: 6px;
}

.pm-confirmation,
.action-confirmation {
  border: 1px solid #b9d9fb;
  border-left: 4px solid var(--blue);
  border-radius: 8px;
  background: #f6fbff;
  padding: 14px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
}

.pm-confirmation h3,
.action-confirmation h3 {
  margin: 8px 0 4px;
  font-size: 1rem;
  line-height: 1.25;
}

.pm-confirmation p,
.action-confirmation p {
  margin: 0;
  color: var(--muted);
}

.pm-confirmation .confirmation-note {
  margin-top: 8px;
  color: var(--ink);
}

.week-review-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.checklist-summary {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 12px 13px;
}

.checklist-summary strong {
  display: block;
  line-height: 1.25;
}

.checklist-summary p {
  color: var(--muted);
  font-size: 0.88rem;
  margin: 4px 0 0;
}

.checklist-summary.block {
  background: #fff6f6;
  border-color: #e4a8a8;
  border-left: 4px solid #c94040;
}

.checklist-summary.warning {
  background: #fffaf0;
  border-color: #f0c36d;
  border-left: 4px solid var(--amber);
}

.checklist-summary.ok {
  background: #f5fbf8;
  border-color: #b8dfcc;
  border-left: 4px solid var(--green);
}

.timesheet-certification-form {
  margin-top: 12px;
}

.certification-card {
  background: #fbfcfe;
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  padding: 13px;
}

.certification-check {
  align-items: flex-start;
  color: var(--ink);
  display: flex;
  font-size: 0.92rem;
  font-weight: 700;
  gap: 10px;
  line-height: 1.35;
}

.certification-check input {
  flex: 0 0 auto;
  margin-top: 3px;
}

.certification-signature-row {
  align-items: end;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(220px, 1fr) auto;
}

.review-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 13px;
}

.review-panel-label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.review-panel-value {
  margin-top: 7px;
  font-size: 1.35rem;
  line-height: 1;
  font-weight: 850;
}

.review-panel p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.review-checklist {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.review-check {
  min-height: 74px;
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: 8px;
  background: #fbfcfe;
  padding: 12px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.review-check-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  margin-top: 5px;
  background: var(--muted);
  flex: 0 0 auto;
}

.review-check-label {
  color: var(--muted);
  display: block;
  font-size: 0.7rem;
  font-weight: 900;
  margin-bottom: 3px;
  text-transform: uppercase;
}

.review-check strong {
  display: block;
  line-height: 1.25;
}

.review-check p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.review-check.ok {
  border-color: #b8dfcc;
  background: #f5fbf8;
}

.review-check.ok .review-check-dot {
  background: var(--green);
}

.review-check.warning {
  border-color: #f0c36d;
  background: #fffaf0;
}

.review-check.warning .review-check-dot {
  background: var(--amber);
}

.review-check.block {
  border-color: #e4a8a8;
  background: #fff6f6;
}

.review-check.block .review-check-label {
  color: #9f2424;
}

.review-check.warning .review-check-label {
  color: #7a4500;
}

.review-check.block .review-check-dot {
  background: #c94040;
}

.review-check.neutral .review-check-dot {
  background: var(--blue);
}

.pm-review-checklist {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 14px;
  display: grid;
  gap: 12px;
}

.week-timeline {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 14px;
}

.timeline-heading {
  align-items: center;
  background: transparent;
  border: 0;
  color: inherit;
  cursor: pointer;
  display: flex;
  font: inherit;
  gap: 10px;
  margin: 0;
  padding: 4px 0;
  text-align: left;
  width: 100%;
}

.week-timeline.is-expanded .timeline-heading {
  margin-bottom: 12px;
}

.timeline-heading:hover .timeline-chevron,
.timeline-heading:focus-visible .timeline-chevron {
  color: var(--ink);
}

.timeline-heading:focus-visible {
  outline: 2px solid #b9d9fb;
  outline-offset: 2px;
  border-radius: 4px;
}

.timeline-chevron {
  color: var(--muted);
  display: inline-block;
  font-size: 0.85rem;
  width: 12px;
  flex-shrink: 0;
}

.timeline-summary {
  margin-left: auto;
}

.timeline-new-dot {
  background: #d44b1c;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
  height: 8px;
  width: 8px;
}

.timeline-list {
  display: grid;
  gap: 0;
  list-style: none;
  margin: 0;
  padding: 0;
}

.timeline-item {
  display: grid;
  gap: 10px;
  grid-template-columns: 18px minmax(0, 1fr);
  min-height: 58px;
  padding-bottom: 12px;
  position: relative;
}

.timeline-item::before {
  background: #c7d1de;
  bottom: 0;
  content: "";
  left: 8px;
  position: absolute;
  top: 18px;
  width: 2px;
}

.timeline-item:last-child {
  min-height: 0;
  padding-bottom: 0;
}

.timeline-item:last-child::before {
  display: none;
}

.timeline-marker {
  background: #fff;
  border: 2px solid #9aa8b9;
  border-radius: 999px;
  height: 18px;
  position: relative;
  width: 18px;
  z-index: 1;
}

.timeline-item.submitted .timeline-marker,
.timeline-item.resubmitted .timeline-marker {
  border-color: var(--blue);
}

.timeline-item.returned .timeline-marker {
  border-color: var(--amber);
}

.timeline-item.approved .timeline-marker {
  border-color: var(--green);
}

.timeline-item.reopened .timeline-marker {
  border-color: var(--amber);
}

.timeline-item.locked .timeline-marker {
  border-color: var(--ink);
}

.timeline-item.active .timeline-marker {
  background: var(--blue);
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(36, 107, 159, 0.14);
}

.timeline-item.approved.active .timeline-marker {
  background: var(--green);
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(25, 122, 87, 0.14);
}

.timeline-item.returned.active .timeline-marker {
  background: var(--amber);
  border-color: var(--amber);
  box-shadow: 0 0 0 4px rgba(166, 98, 0, 0.14);
}

.timeline-item.reopened.active .timeline-marker {
  background: var(--amber);
  border-color: var(--amber);
  box-shadow: 0 0 0 4px rgba(166, 98, 0, 0.14);
}

.timeline-item.locked.active .timeline-marker {
  background: var(--ink);
  border-color: var(--ink);
}

.timeline-meta {
  color: var(--muted);
  display: block;
  font-size: 0.76rem;
  font-weight: 750;
  margin-bottom: 2px;
}

.timeline-item strong {
  display: block;
  line-height: 1.25;
}

.timeline-item p {
  color: var(--muted);
  font-size: 0.86rem;
  margin: 4px 0 0;
}

.subsection-title {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.25;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  background: #fff;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 9px 10px;
  text-align: left;
  vertical-align: top;
  font-size: 0.9rem;
}

th {
  position: sticky;
  top: 0;
  background: #eef3f8;
  color: #2f4157;
  z-index: 1;
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

tr:last-child td {
  border-bottom: 0;
}

tr.has-row-issues td {
  background: #fffafa;
}

tr.has-row-warnings td {
  background: #fffdf7;
}

td .mini {
  color: var(--muted);
  font-size: 0.78rem;
}

.issue-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-width: 130px;
}

.issue-badge {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #eef3f8;
  color: #2f4157;
  display: inline-flex;
  font-size: 0.72rem;
  font-weight: 850;
  line-height: 1;
  padding: 5px 7px;
  white-space: nowrap;
}

button.issue-badge {
  cursor: pointer;
  font-family: inherit;
}

button.issue-badge:hover {
  box-shadow: 0 0 0 3px rgba(36, 107, 159, 0.12);
}

.issue-badge.block {
  background: #fff0f0;
  border-color: #e4a8a8;
  color: #9f2424;
}

.issue-badge.warning {
  background: #fff7e6;
  border-color: #ffd793;
  color: #7a4500;
}

.cell-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.entry-row-actions {
  flex-wrap: nowrap;
  margin-top: 4px;
}

.compact-field {
  display: grid;
  gap: 4px;
  min-width: 150px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.compact-field select {
  min-height: 34px;
  border: 1px solid #cbd6e2;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  padding: 6px 8px;
}

.compact-field input {
  min-height: 34px;
  border: 1px solid #cbd6e2;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  padding: 6px 8px;
}

.compact-number {
  width: 76px;
  min-height: 34px;
  border: 1px solid #cbd6e2;
  border-radius: 6px;
  padding: 6px 8px;
}

.manager-timesheet-table {
  min-width: 760px;
}

.manager-timesheet-table td,
.manager-timesheet-table th {
  text-align: center;
}

.manager-timesheet-table tbody td:first-child,
.manager-timesheet-table tbody td:nth-child(2),
.manager-timesheet-table thead th:first-child,
.manager-timesheet-table thead th:nth-child(2) {
  text-align: left;
}

.manager-timesheet-table tfoot td {
  text-align: center;
}

.manager-timesheet-table tfoot td:first-child {
  text-align: left;
}

.selected-row {
  background: #f4f8fb;
}

.warning-panel {
  border-color: #f0c36d;
  background: #fffaf0;
}

.static-heading {
  cursor: default;
}

.subsection-block {
  border-top: 1px solid var(--line);
  margin-top: 18px;
  padding-top: 18px;
}

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 6px;
  display: inline-grid;
  place-items: center;
  background: #edf2f7;
  color: #2f4157;
}

.icon-btn svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.status-pill {
  border: 1px solid var(--line);
  background: #eef3f8;
  color: #2f4157;
}

.status-pill.pending {
  background: #fff7e6;
  border-color: #ffd793;
  color: #7a4500;
}

.status-pill.approved,
.status-pill.completed {
  background: #e6f6ef;
  border-color: #a8dfc8;
  color: #0f6043;
}

.status-pill.expense {
  background: #e9f3ff;
  border-color: #b9d9fb;
  color: #174f7a;
}

.status-pill.billback {
  background: #f0eafe;
  border-color: #d3c1ff;
  color: #57358f;
}

.status-pill.locked {
  background: #edf1f6;
  border-color: #c7d0db;
  color: #425466;
}

.exception-strip {
  border-color: #f2d48a;
  background: #fffdf7;
}

.exception-strip .kpi {
  background: #fffaf0;
}

.exception-kpi {
  width: 100%;
  text-align: left;
}

.exception-kpi:hover {
  border-color: #e0b85e;
  box-shadow: 0 0 0 3px rgba(247, 201, 72, 0.18);
}

.exception-kpi.active {
  border-color: #d4971b;
  background: #fff3d4;
  box-shadow: 0 0 0 3px rgba(247, 201, 72, 0.2);
}

.filters {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.split-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr);
  gap: 18px;
  align-items: start;
}

.split-layout > *,
.wo-request-grid > * {
  min-width: 0;
}

.empty {
  border: 1px dashed #c6d0dc;
  border-radius: 8px;
  padding: 22px;
  color: var(--muted);
  background: #fbfcfe;
  text-align: center;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 10;
  max-width: min(360px, calc(100vw - 36px));
  border-radius: 8px;
  background: #16324f;
  color: #fff;
  box-shadow: var(--shadow);
  padding: 13px 14px;
  font-weight: 700;
}

.inline-select,
.inline-input {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 8px;
  background: #fff;
  max-width: 100%;
}

.notes {
  display: grid;
  gap: 9px;
}

.note {
  border-left: 3px solid var(--blue);
  background: #f8fbff;
  padding: 9px 10px;
}

.note-meta {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.settings-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.settings-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfe;
  display: grid;
  gap: 8px;
}

.maintainx-view .section {
  display: grid;
  gap: 14px;
}

.maintainx-assistant-panel {
  background: #f7fafc;
  border: 1px solid #cfe0f4;
  border-radius: 8px;
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
  padding: 12px;
}

.maintainx-assistant-next {
  background: #fffaf0;
  border: 2px solid #e8c56f;
  border-radius: 8px;
  display: grid;
  gap: 8px;
  padding: 14px;
}

.maintainx-assistant-next strong {
  color: var(--ink);
  font-size: 1.08rem;
}

.maintainx-assistant-next p,
.maintainx-control-card p {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
  line-height: 1.35;
  margin: 0;
}

.maintainx-next-action {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.maintainx-next-action .btn {
  min-height: 40px;
}

.maintainx-assistant-label {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

.maintainx-assistant-steps {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.maintainx-control-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.9fr) minmax(240px, 0.85fr);
}

.maintainx-control-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  padding: 12px;
}

.maintainx-control-card > div:first-child {
  display: grid;
  gap: 4px;
}

.maintainx-control-card strong {
  color: var(--ink);
  font-size: 0.95rem;
}

.maintainx-bridge-lower {
  align-items: start;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.maintainx-bridge-controls {
  align-items: end;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  margin: 0;
}

.maintainx-bridge-controls.lookup {
  grid-template-columns: minmax(0, 1fr) max-content;
}

.maintainx-bridge-controls .field {
  margin: 0;
}

.maintainx-status-groups {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 12px 0;
}

.maintainx-status-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  cursor: pointer;
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 12px;
  text-align: left;
}

.maintainx-status-card:hover {
  border-color: #9ebbd6;
  box-shadow: 0 8px 18px rgba(22, 50, 79, 0.08);
}

.maintainx-status-card.active {
  background: #f8fbff;
  border-color: var(--blue);
}

.maintainx-status-card.recommended {
  border-color: #b8dec4;
}

.maintainx-status-card strong {
  color: var(--ink);
  font-size: 0.94rem;
}

.maintainx-status-card span,
.maintainx-status-card small {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 750;
  line-height: 1.3;
}

.maintainx-monday-strip {
  align-items: center;
  background: #f8fbff;
  border: 1px solid #cfe0f4;
  border-radius: 8px;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) auto;
  margin-top: 12px;
  padding: 12px;
}

.maintainx-monday-strip > div:first-child {
  display: grid;
  gap: 3px;
}

.maintainx-monday-strip strong {
  color: var(--ink);
  font-size: 0.98rem;
}

.maintainx-monday-strip p {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
  margin: 0;
}

.maintainx-monday-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.maintainx-status-step {
  color: var(--blue) !important;
  font-size: 0.7rem !important;
  font-weight: 900 !important;
  text-transform: uppercase;
}

.maintainx-map-details {
  margin-top: 8px;
}

.maintainx-map-details summary {
  color: var(--blue);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 800;
}

.maintainx-map-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 8px;
}

.maintainx-map-grid div {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
}

.maintainx-map-grid span {
  color: var(--muted);
  display: block;
  font-size: 0.68rem;
  font-weight: 850;
  text-transform: uppercase;
}

.maintainx-map-grid strong {
  color: var(--ink);
  display: block;
  font-size: 0.82rem;
  margin-top: 3px;
}

.maintainx-map-review {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.maintainx-map-review span {
  background: #fff7e6;
  border: 1px solid #e8c56f;
  border-radius: 999px;
  color: #785100;
  font-size: 0.74rem;
  font-weight: 800;
  padding: 3px 8px;
}

.maintainx-map-review.ok span {
  background: #edf8f1;
  border-color: #b8dec4;
  color: #236338;
}

.maintainx-mapping-reason {
  align-items: center;
  background: #f3f7fb;
  border: 1px solid #d8e5f2;
  border-radius: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 10px;
}

.maintainx-mapping-reason span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.maintainx-mapping-reason strong {
  color: var(--ink);
  font-size: 0.8rem;
}

.maintainx-mapping-reason-line {
  color: #36536e;
  font-weight: 850;
}

.maintainx-review-queue {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.maintainx-review-strip {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.maintainx-preflight-bar {
  align-items: center;
  background: #f8fbff;
  border: 1px solid #cfe0f4;
  border-radius: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  padding: 10px 12px;
}

.maintainx-batch-strip {
  align-items: center;
  background: #fbfcfe;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(220px, 0.75fr) minmax(0, 1.25fr);
  padding: 10px 12px;
}

.maintainx-batch-strip > div:first-child {
  display: grid;
  gap: 3px;
}

.maintainx-batch-strip strong {
  color: var(--ink);
  font-size: 0.86rem;
}

.maintainx-batch-strip span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 750;
}

.maintainx-workflow-panel {
  background: #f8fbff;
  border: 1px solid #cfe0f4;
  border-radius: 8px;
  display: grid;
  gap: 10px;
  padding: 12px;
}

.maintainx-workflow-heading {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.maintainx-workflow-heading > div {
  display: grid;
  gap: 2px;
}

.maintainx-workflow-heading strong {
  color: var(--ink);
  font-size: 0.95rem;
}

.maintainx-workflow-heading > span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.maintainx-workflow-steps {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.maintainx-workflow-step {
  align-items: flex-start;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  grid-template-columns: 22px minmax(0, 1fr);
  min-width: 0;
  padding: 9px;
}

.maintainx-workflow-step.done {
  background: #f4fbf6;
  border-color: #b8dec4;
}

.maintainx-workflow-step.active {
  background: #fffaf0;
  border-color: #e8c56f;
}

.maintainx-workflow-step.warning {
  background: #fff6f3;
  border-color: #efb5a6;
}

.maintainx-workflow-step-number {
  align-items: center;
  background: var(--ink);
  border-radius: 999px;
  color: #fff;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 0.72rem;
  font-weight: 900;
  height: 22px;
  justify-content: center;
  width: 22px;
}

.maintainx-workflow-step.done .maintainx-workflow-step-number {
  background: #236338;
}

.maintainx-workflow-step.active .maintainx-workflow-step-number {
  background: #9a6a00;
}

.maintainx-workflow-step.warning .maintainx-workflow-step-number {
  background: #a3472c;
}

.maintainx-workflow-step-body {
  display: grid;
  gap: 4px;
  min-width: 0;
  width: 100%;
}

.maintainx-workflow-step-body strong {
  color: var(--ink);
  font-size: 0.8rem;
  line-height: 1.2;
}

.maintainx-workflow-step-body span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 750;
  line-height: 1.3;
}

.maintainx-workflow-actions {
  display: grid;
  gap: 6px;
  grid-template-columns: 1fr;
  min-width: 0;
  width: 100%;
}

.maintainx-workflow-actions .btn {
  justify-content: center;
  min-width: 0;
  white-space: normal;
  width: 100%;
}

.maintainx-batch-result {
  align-items: center;
  background: #f4fbf6;
  border: 1px solid #b8dec4;
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 12px;
}

.maintainx-batch-result.warning {
  background: #fffaf0;
  border-color: #e8c56f;
}

.maintainx-batch-result.scan {
  background: #f2f8fb;
  border-color: #b8d5e6;
}

.maintainx-batch-review {
  background: #f8fbff;
  border: 1px solid #b8d5e6;
  border-radius: 8px;
  display: grid;
  gap: 12px;
  padding: 12px;
}

.maintainx-batch-review h3 {
  color: var(--ink);
  font-size: 1rem;
  margin: 2px 0 0;
}

.maintainx-batch-review-table th,
.maintainx-batch-review-table td {
  vertical-align: top;
}

.maintainx-batch-skipped {
  background: #fff;
  border: 1px solid #d8e5f2;
  border-radius: 8px;
  padding: 10px;
}

.maintainx-batch-skipped summary {
  color: #36536e;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 850;
}

.maintainx-batch-result > div:first-child {
  display: grid;
  gap: 3px;
}

.maintainx-batch-result strong {
  color: var(--ink);
  font-size: 0.92rem;
}

.maintainx-batch-result span,
.maintainx-batch-result small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.35;
}

.maintainx-batch-result-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.maintainx-exception-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.maintainx-exception-chips span {
  background: #fff7e6;
  border: 1px solid #e8c56f;
  border-radius: 999px;
  color: #785100;
  font-size: 0.74rem;
  font-weight: 800;
  padding: 4px 8px;
}

.maintainx-exception-chips strong {
  color: inherit;
  font-size: inherit;
}

.maintainx-preflight-bar span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.maintainx-review-kpi {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 10px;
}

.maintainx-review-kpi span,
.maintainx-review-kpi small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.maintainx-review-kpi span {
  text-transform: uppercase;
}

.maintainx-review-kpi strong {
  color: var(--ink);
  font-size: 1.18rem;
}

.maintainx-review-table th,
.maintainx-review-table td {
  vertical-align: top;
}

.maintainx-review-table-details {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.maintainx-review-table-details > summary {
  align-items: center;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  list-style: none;
  padding: 12px;
}

.maintainx-review-table-details > summary::-webkit-details-marker {
  display: none;
}

.maintainx-review-table-details > summary span {
  font-size: 0.9rem;
  font-weight: 900;
}

.maintainx-review-table-details > summary small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
  text-align: right;
}

.maintainx-review-table tr.needs-review td {
  background: #fffaf0;
}

.maintainx-row-check {
  align-items: center;
  display: inline-flex;
  font-size: 0.74rem;
  font-weight: 800;
  gap: 6px;
  white-space: nowrap;
}

.maintainx-row-check input {
  margin: 0;
}

.maintainx-exception-report {
  background: #fff;
  border: 1px solid #d8e5f2;
  border-radius: 8px;
  padding: 10px 12px;
}

.maintainx-exception-report summary {
  color: var(--blue);
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 850;
}

.maintainx-exception-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 10px;
}

.maintainx-exception-grid section {
  background: #f8fbff;
  border: 1px solid #dbe8f4;
  border-radius: 8px;
  display: grid;
  gap: 7px;
  padding: 10px;
}

.maintainx-exception-grid h4 {
  align-items: center;
  color: var(--ink);
  display: flex;
  font-size: 0.84rem;
  gap: 6px;
  justify-content: space-between;
  margin: 0;
}

.maintainx-exception-grid h4 span {
  background: #fff7e6;
  border: 1px solid #e8c56f;
  border-radius: 999px;
  color: #785100;
  font-size: 0.72rem;
  padding: 2px 7px;
}

.maintainx-exception-grid article {
  border-top: 1px solid #e3edf7;
  display: grid;
  gap: 2px;
  padding-top: 7px;
}

.maintainx-exception-grid article strong,
.maintainx-exception-grid article span {
  font-size: 0.78rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.maintainx-exception-grid article span {
  color: var(--muted);
}

.maintainx-review-actions {
  align-items: flex-start;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.maintainx-detail-panel {
  background: #f8fbff;
  border: 1px solid #cfe0f4;
  border-radius: 8px;
  display: grid;
  gap: 12px;
  margin-top: 14px;
  padding: 14px;
}

.maintainx-detail-panel h3 {
  font-size: 1rem;
  margin: 0;
}

.maintainx-detail-description {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font-size: 0.9rem;
  line-height: 1.45;
  padding: 10px;
}

.maintainx-detail-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.maintainx-detail-grid div,
.maintainx-raw-preview div {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-width: 0;
  padding: 8px;
}

.maintainx-detail-grid span,
.maintainx-raw-preview dt {
  color: var(--muted);
  display: block;
  font-size: 0.68rem;
  font-weight: 850;
  text-transform: uppercase;
}

.maintainx-detail-grid strong,
.maintainx-raw-preview dd {
  color: var(--ink);
  display: block;
  font-size: 0.82rem;
  margin: 3px 0 0;
  overflow-wrap: anywhere;
}

.maintainx-detail-counts,
.maintainx-key-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.maintainx-detail-counts span,
.maintainx-key-list span {
  background: #fff;
  border: 1px solid #cfe0f4;
  border-radius: 999px;
  color: #24425f;
  font-size: 0.74rem;
  font-weight: 800;
  padding: 4px 8px;
}

.maintainx-raw-details summary {
  color: var(--blue);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 850;
}

.maintainx-raw-preview {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 10px 0 0;
}

.maintainx-record-preview {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.maintainx-record-preview section {
  background: #f8fbff;
  border: 1px solid #dbe8f4;
  border-radius: 8px;
  display: grid;
  gap: 8px;
  padding: 10px;
}

.maintainx-record-preview h4 {
  color: var(--ink);
  font-size: 0.82rem;
  margin: 0;
}

.maintainx-record-preview article {
  border-top: 1px solid #e3edf7;
  display: grid;
  gap: 3px;
  padding-top: 8px;
}

.maintainx-record-preview strong,
.maintainx-record-preview span,
.maintainx-record-preview p {
  font-size: 0.8rem;
  line-height: 1.35;
  margin: 0;
  overflow-wrap: anywhere;
}

.maintainx-record-preview span,
.maintainx-record-preview p {
  color: var(--muted);
}

.maintainx-cleanup-panel {
  background: #fff;
  border: 1px solid #d8e5f2;
  border-radius: 8px;
  margin: 12px 0;
  padding: 12px;
}

.maintainx-cleanup-panel[open] {
  display: grid;
  gap: 12px;
}

.maintainx-cleanup-panel > summary {
  align-items: center;
  cursor: pointer;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  list-style: none;
}

.maintainx-cleanup-panel > summary::-webkit-details-marker {
  display: none;
}

.maintainx-cleanup-panel > summary > div {
  display: grid;
  gap: 3px;
}

.maintainx-cleanup-panel > summary strong {
  color: var(--ink);
  font-size: 0.96rem;
}

.maintainx-cleanup-panel > summary small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.maintainx-cleanup-panel h3 {
  font-size: 1rem;
  margin: 0;
}

.maintainx-download-result {
  background: #f4fbf6;
  border: 1px solid #b8dec4;
  border-radius: 8px;
  display: grid;
  gap: 10px;
  padding: 10px;
}

.maintainx-download-result.warning {
  background: #fffaf0;
  border-color: #e8c56f;
}

.maintainx-download-result > div:first-child {
  display: grid;
  gap: 3px;
}

.maintainx-download-result strong {
  color: var(--ink);
  font-size: 0.9rem;
}

.maintainx-download-result span,
.maintainx-download-error {
  color: #785100;
  font-weight: 800;
}

.maintainx-download-errors {
  display: grid;
  gap: 6px;
}

.maintainx-download-errors article {
  background: #fff;
  border: 1px solid #ead38f;
  border-radius: 8px;
  display: grid;
  gap: 3px;
  padding: 8px;
}

.maintainx-progress-panel,
.maintainx-session-panel {
  background: #fff;
  border: 1px solid #d8e5f2;
  border-radius: 8px;
  display: grid;
  gap: 12px;
  margin: 12px 0;
  padding: 12px;
}

.maintainx-progress-panel h3,
.maintainx-session-panel h3 {
  font-size: 1rem;
  margin: 0;
}

.maintainx-progress-context {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.maintainx-progress-context span {
  background: #f8fbff;
  border: 1px solid #cfe0f4;
  border-radius: 999px;
  color: #24425f;
  font-size: 0.76rem;
  font-weight: 850;
  padding: 4px 8px;
}

.maintainx-progress-table th,
.maintainx-progress-table td {
  text-align: right;
}

.maintainx-progress-table th:first-child,
.maintainx-progress-table td:first-child {
  text-align: left;
}

.maintainx-session-table th,
.maintainx-session-table td {
  vertical-align: top;
}

.mini-kpi-row {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(4, minmax(90px, 1fr));
}

@media (max-width: 900px) {
  .mini-kpi-row,
  .maintainx-record-preview {
    grid-template-columns: 1fr;
  }
}

.maintainx-mapping-card {
  background: #fff;
  border: 1px solid #bcd4ee;
  border-radius: 8px;
  display: grid;
  gap: 12px;
  padding: 12px;
}

.maintainx-mapping-card h4 {
  font-size: 0.98rem;
  margin: 0;
}

.maintainx-source-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.maintainx-source-strip span {
  background: #f3f7fb;
  border: 1px solid #d8e5f2;
  border-radius: 999px;
  color: #36536e;
  font-size: 0.74rem;
  font-weight: 750;
  padding: 4px 8px;
}

.maintainx-source-strip strong {
  color: var(--ink);
}

.maintainx-import-notice {
  align-items: center;
  background: #edf8f1;
  border: 1px solid #b8dec4;
  border-radius: 8px;
  color: #236338;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: space-between;
  padding: 10px;
}

.maintainx-mapping-form {
  gap: 10px;
}

.maintainx-mapping-form textarea {
  min-height: 88px;
  resize: vertical;
}

.subtle {
  color: var(--muted);
  font-size: 0.86rem;
}

/* PM building-assignment checkbox grid (admin Settings). */
.pm-prop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 6px 12px;
  margin: 4px 0 10px;
}

.pm-prop-check {
  align-items: center;
  cursor: pointer;
  display: flex;
  font-size: 0.86rem;
  gap: 6px;
}

.pm-prop-check input {
  cursor: pointer;
  margin: 0;
}

/* "Buildings in this week" strip on the PM Approval panel. */
.review-buildings {
  margin: 6px 0 12px;
}

.review-buildings-label {
  color: var(--muted);
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.building-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.building-chip {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.8rem;
  padding: 3px 10px;
}

.building-chip.is-other-pm {
  background: #fff3d8;
  border-color: #e6c879;
  color: #7a5200;
  font-weight: 700;
}

.hide {
  display: none !important;
}

.span-all {
  grid-column: 1 / -1;
}

@media (max-width: 1200px) {
  .workorder-table-wrap {
    display: none;
  }

  .entry-table-wrap {
    display: none;
  }

  .wo-card-list {
    display: grid;
    gap: 12px;
  }

  .entry-card-list {
    display: grid;
    gap: 12px;
  }

  .workorder-detail-dialog {
    height: calc(100dvh - 24px);
    max-height: calc(100dvh - 24px);
    width: calc(100vw - 24px);
  }

  .wo-detail-dialog-header {
    position: sticky;
    top: 0;
    z-index: 3;
  }

  .wo-detail-dialog-body {
    max-height: calc(100dvh - 112px);
  }

  .btn,
  .inline-select,
  .inline-input,
  .field input,
  .field select,
  .field textarea {
    min-height: 44px;
  }

  .icon-btn {
    min-height: 44px;
    min-width: 44px;
  }
}

@media (max-width: 1050px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    max-width: 100vw;
    overflow: hidden;
  }

  .nav-list {
    display: flex;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .nav-button {
    flex: 0 0 auto;
    width: auto;
  }

  .sidebar-footer {
    display: none;
  }

  .maintainx-workflow-steps {
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  }

  .wo-meta-grid,
  .howto-step-grid,
  .home-module-grid,
  .filters,
  .kpi-grid,
  .entry-week-strip-grid,
  .week-review-layout,
  .review-checklist,
  .settings-list {
    grid-template-columns: 1fr 1fr;
  }

  .split-layout,
  .wo-request-grid,
  .entry-week-strip-grid {
    grid-template-columns: 1fr;
  }

  #entry-form .span-3,
  .inline-entry-form .span-2 {
    grid-column: span 6;
  }

  .inline-entry-form .span-6 {
    grid-column: span 12;
  }

  .atlasreports-toolbar {
    align-items: flex-start;
    grid-template-columns: 1fr;
  }

  .atlasreports-actions {
    justify-content: flex-start;
    width: 100%;
  }

  .maintainx-assistant-panel,
  .maintainx-control-grid,
  .maintainx-bridge-lower {
    grid-template-columns: 1fr;
  }

  .maintainx-assistant-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .topbar,
  .view,
  .sidebar {
    padding-left: 14px;
    padding-right: 14px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-meta {
    justify-content: flex-start;
    width: 100%;
  }

  .topbar-meta .view-as-select {
    flex: 1 1 210px;
    min-width: 0;
  }

  .home-band {
    align-items: flex-start;
  }

  .atlasreports-toolbar {
    align-items: flex-start;
    flex-direction: column;
    padding-left: 14px;
    padding-right: 14px;
  }

  .atlasreports-actions {
    justify-content: flex-start;
    width: 100%;
  }

  .maintainx-assistant-steps,
  .maintainx-bridge-controls,
  .maintainx-bridge-controls.lookup {
    grid-template-columns: 1fr;
  }

  .atlasreports-frame {
    height: calc(100dvh - 220px);
    min-height: 620px;
  }

  .home-band-mark {
    height: 76px;
    width: 88px;
  }

  .form-grid,
  .howto-step-grid,
  .home-module-grid,
  .filters,
  .kpi-grid,
  .entry-week-controls,
  .entry-mini-kpis,
  .week-review-layout,
  .review-checklist,
  .certification-signature-row,
  .split-layout,
  .wo-request-grid,
  .wo-meta-grid,
  .settings-list {
    grid-template-columns: 1fr;
  }

  .maintainx-bridge-controls {
    grid-template-columns: 1fr;
  }

  .maintainx-status-groups {
    grid-template-columns: 1fr;
  }

  .maintainx-workflow-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .maintainx-workflow-steps {
    grid-template-columns: 1fr;
  }

  .maintainx-batch-strip {
    grid-template-columns: 1fr;
  }

  .maintainx-batch-result {
    grid-template-columns: 1fr;
  }

  .maintainx-batch-result-actions {
    justify-content: flex-start;
  }

  .maintainx-exception-chips {
    justify-content: flex-start;
  }

  .maintainx-review-strip,
  .maintainx-exception-grid {
    grid-template-columns: 1fr;
  }

  .maintainx-detail-grid,
  .maintainx-map-grid,
  .maintainx-raw-preview {
    grid-template-columns: 1fr;
  }

  .span-2,
  .span-3,
  .span-4,
  .span-5,
  .span-6,
  .span-8,
  .span-9,
  .span-12 {
    grid-column: span 1;
  }

  .workorder-detail-dialog {
    max-height: calc(100vh - 24px);
    width: calc(100vw - 20px);
  }

  .wo-detail-dialog-header {
    flex-direction: column;
    gap: 10px;
  }

  .wo-detail-dialog-body {
    max-height: calc(100vh - 132px);
  }

  .form-section-title {
    align-items: stretch;
    flex-direction: column;
  }

  .wo-card-main {
    align-items: stretch;
    flex-direction: column;
  }

  .wo-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .wo-card-actions .btn {
    flex: 1 1 150px;
  }

  .engineer-wo-summary-main {
    grid-template-columns: 1fr;
  }

  .engineer-wo-actions .btn {
    flex-basis: 100%;
  }

  .wo-attachment-grid {
    grid-template-columns: 1fr;
  }

  .wo-attachment-card {
    grid-template-columns: 76px minmax(0, 1fr);
  }

  .engineer-field-actions .section-header {
    align-items: stretch;
    flex-direction: column;
  }

  .engineer-field-actions .button-row,
  .engineer-field-actions .btn {
    width: 100%;
  }

  .wo-request-card .wo-card-grid {
    grid-template-columns: 1fr;
  }

  .entry-mini-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .section {
    padding: 14px;
  }

  .pm-confirmation,
  .action-confirmation {
    align-items: stretch;
    flex-direction: column;
  }

  .timeline-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .inline-context {
    align-items: stretch;
    flex-direction: column;
  }

  .wo-detail-header {
    align-items: stretch;
    flex-direction: column;
  }

  table {
    min-width: 1080px;
  }
}

.link-button {
  appearance: none;
  background: none;
  border: 0;
  color: #1f6feb;
  cursor: pointer;
  font: inherit;
  padding: 0;
  text-decoration: underline;
}

.link-button:hover,
.link-button:focus-visible {
  color: #0a4ec0;
  outline: none;
}

.wo-activity {
  color: #2f4157;
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  margin-top: 4px;
}

.wo-opening-note {
  color: var(--ink);
  display: block;
  font-size: 0.86rem;
  line-height: 1.35;
  margin-top: 8px;
  max-width: 72ch;
}

.wo-opening-note strong {
  font-weight: 850;
}

.wo-detail-row > td {
  background: #f6fbff;
  padding: 14px;
}

.wo-card-list {
  display: none;
}

.wo-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  padding: 14px;
}

.wo-card-main {
  align-items: start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.wo-card-number {
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.wo-card h3 {
  font-size: 1.05rem;
  line-height: 1.25;
  margin: 3px 0;
}

.wo-card p {
  color: var(--muted);
  margin: 0;
}

.wo-card-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.wo-card-grid > div {
  background: #f8fbff;
  border: 1px solid #e1e9f2;
  border-radius: 8px;
  display: grid;
  gap: 3px;
  padding: 10px;
}

.wo-card-grid span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.wo-card-grid strong {
  color: var(--ink);
  font-size: 1rem;
}

.wo-card-grid small {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.25;
}

.wo-card-note {
  background: #f8fbff;
  border-left: 3px solid var(--blue);
  color: #2f4157;
  display: grid;
  font-size: 0.92rem;
  gap: 4px;
  line-height: 1.35;
  padding: 10px 11px;
}

.wo-card-note span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.wo-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.ready-close-section {
  border-color: #f0d28a;
}

.ready-close-list {
  display: grid;
  gap: 12px;
}

.ready-close-card {
  background: #fff;
  border: 1px solid #e8d39a;
  border-radius: 8px;
  display: grid;
  gap: 12px;
  padding: 14px;
}

.ready-close-main {
  align-items: start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.ready-close-main h3 {
  font-size: 1.08rem;
  margin: 3px 0;
}

.ready-close-main p {
  color: var(--muted);
  margin: 0;
}

.ready-close-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.ready-close-grid > div {
  background: #fffaf0;
  border: 1px solid #efd9a7;
  border-radius: 8px;
  display: grid;
  gap: 3px;
  padding: 10px;
}

.ready-close-grid span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.ready-close-grid strong {
  color: var(--ink);
  font-size: 0.98rem;
}

.ready-close-grid small {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.25;
}

.ready-close-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.ready-close-return-form {
  background: #f8fbff;
  border: 1px solid #e1e9f2;
  border-radius: 8px;
  display: grid;
  gap: 8px;
  padding: 10px;
}

.ready-close-return-form label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.ready-close-return-form .button-row {
  align-items: stretch;
}

.ready-close-return-form textarea {
  flex: 1 1 360px;
  min-height: 72px;
}

.engineer-field-actions .section-header {
  align-items: center;
}

.engineer-field-actions .button-row {
  justify-content: flex-end;
}

.wo-request-card-list {
  display: grid;
  gap: 12px;
}

.wo-request-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  padding: 14px;
}

.wo-request-card .wo-card-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.wo-request-description {
  color: var(--muted);
  line-height: 1.35;
  margin: 0;
}

.field-workorder-dialog {
  width: min(760px, calc(100vw - 32px));
}

.entry-card-list {
  display: none;
}

.entry-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  padding: 14px;
}

.entry-card.has-row-issues {
  background: #fffafa;
  border-color: #e4a8a8;
}

.entry-card.has-row-warnings {
  background: #fffdf7;
  border-color: #ffd793;
}

.entry-card-main {
  align-items: start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.entry-card-date {
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.entry-card h3 {
  font-size: 1.05rem;
  line-height: 1.25;
  margin: 3px 0;
}

.entry-card p {
  color: var(--muted);
  margin: 0;
}

.entry-card-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.entry-card-grid > div {
  background: #f8fbff;
  border: 1px solid #e1e9f2;
  border-radius: 8px;
  display: grid;
  gap: 3px;
  padding: 10px;
}

.entry-card-grid span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.entry-card-grid strong {
  color: var(--ink);
  font-size: 1rem;
}

.entry-card-grid small {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.25;
}

.entry-card-footer {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
}

.entry-card-issues {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.entry-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.inline-entry-card {
  background: #f6fbff;
  border: 1px solid #b9d9fb;
  border-radius: 8px;
  padding: 12px;
}

@media (max-width: 1200px) {
  .wo-card-list {
    display: grid;
    gap: 12px;
  }

  .entry-card-list {
    display: grid;
    gap: 12px;
  }
}

@media (max-width: 720px) {
  .wo-card-main {
    align-items: stretch;
    flex-direction: column;
  }

  .wo-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .wo-card-actions .btn {
    flex: 1 1 150px;
  }

  .entry-card-main {
    align-items: stretch;
    flex-direction: column;
  }

  .entry-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .entry-card-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .entry-card-actions .btn {
    flex: 1 1 150px;
  }
}

.wo-detail {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.engineer-wo-update-panel,
.engineer-wo-summary,
.engineer-linked-time {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  padding: 12px;
}

.engineer-wo-update-panel {
  border-color: #b9d9fb;
  box-shadow: 0 1px 0 rgba(36, 107, 159, 0.06);
}

.engineer-wo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.engineer-wo-actions .btn {
  flex: 1 1 170px;
}

.engineer-wo-summary-main {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.engineer-wo-summary-main > div {
  background: #f8fbff;
  border: 1px solid #e1e9f2;
  border-radius: 8px;
  display: grid;
  gap: 4px;
  padding: 10px;
}

.engineer-wo-summary-main small {
  color: var(--muted);
  line-height: 1.25;
}

.engineer-linked-time-cards {
  display: grid;
  gap: 12px;
}

.wo-detail-header {
  align-items: start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.wo-detail-header .section-title,
.wo-detail-header .section-subtitle {
  margin: 0;
}

.wo-detail-tiles {
  margin: 0;
}

.wo-meta-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.wo-meta-grid > div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.wo-source-panel,
.wo-detail-form,
.wo-update-form,
.wo-attachments-panel,
.wo-activity-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.wo-billback-panel {
  background: #f6fbff;
  border: 1px solid #b9d9fb;
  border-radius: 8px;
  padding: 12px;
}

.wo-billback-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 420px);
  margin-bottom: 8px;
}

.dialog-header-actions {
  align-items: center;
  display: flex;
  gap: 8px;
}

.billback-report-view h4.mini-label {
  margin: 16px 0 6px;
}

.billback-report-view h4.mini-label:first-child {
  margin-top: 0;
}

.billback-report-receipts {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.billback-report-receipt-card {
  max-width: 240px;
}

.billback-report-receipt-desc {
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.billback-report-receipt {
  border: 1px solid var(--line);
  border-radius: 6px;
  display: block;
  max-height: 240px;
  max-width: 240px;
}

.billback-missing-banner {
  background: #fdf3d6;
  border: 1px solid var(--focus);
  border-radius: 8px;
  color: #6b4e00;
  font-weight: 600;
  margin-bottom: 14px;
  padding: 10px 12px;
}

.billback-missing-badge {
  align-items: center;
  background: #fdf3d6;
  border: 1px solid var(--focus);
  border-radius: 999px;
  color: #6b4e00;
  display: inline-flex;
  font-size: 0.72rem;
  font-weight: 700;
  margin-top: 4px;
  padding: 2px 8px;
}

.wo-billback-panel h5.mini-label {
  margin: 4px 0;
}

.wo-cost-line-add,
.wo-cost-line-actions {
  align-items: end;
  display: flex;
}

.wo-cost-line-actions .button-row {
  align-items: stretch;
}

.billback-receipt-cell {
  align-items: center;
  display: flex;
  gap: 8px;
}

.receipt-thumb-button {
  background: transparent;
  border: 0;
  border-radius: 4px;
  display: inline-flex;
  padding: 0;
}

.receipt-thumb-button:focus-visible {
  outline: 3px solid rgba(247, 201, 72, 0.7);
  outline-offset: 2px;
}

.billback-receipt-thumb {
  border: 1px solid var(--line);
  border-radius: 4px;
  height: 40px;
  object-fit: cover;
  width: 40px;
}

@media (max-width: 900px) {
  .wo-billback-grid {
    grid-template-columns: 1fr;
  }
}

.wo-source-panel p {
  line-height: 1.4;
  margin: 0;
}

.wo-source-import {
  border-top: 1px solid var(--line);
  margin-top: 10px;
  padding-top: 10px;
}

.form-section-title {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 2px;
}

.form-section-title h4 {
  font-size: 0.95rem;
  margin: 0;
}

.wo-detail-form textarea {
  min-height: 92px;
}

.engineer-wo-update-panel {
  gap: 10px;
}

/* The engineer panel header already says "Update this work order", so the
   inner "Status / note" sub-header is redundant. */
.field-first-update .form-section-title {
  display: none;
}

.wo-source-meta {
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 0.82rem;
  gap: 8px;
  margin-top: 8px;
}

.wo-source-meta span {
  background: #eef3f8;
  border-radius: 6px;
  padding: 4px 7px;
}

.wo-attachment-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.wo-attachment-card {
  align-items: stretch;
  background: #f8fbff;
  border: 1px solid #e1e9f2;
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-template-columns: 92px minmax(0, 1fr);
  padding: 10px;
}

.wo-attachment-thumb {
  align-items: center;
  background: #e8f2fb;
  border: 1px dashed #a9cae9;
  border-radius: 6px;
  color: var(--blue);
  display: flex;
  font-size: 0.75rem;
  font-weight: 900;
  justify-content: center;
  min-height: 76px;
  overflow: hidden;
  text-transform: uppercase;
}

.wo-attachment-thumb-img {
  display: block;
  height: 100%;
  min-height: 76px;
  object-fit: cover;
  width: 100%;
}

.wo-attachment-body {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.wo-attachment-heading {
  align-items: start;
  display: flex;
  gap: 8px;
  justify-content: space-between;
  min-width: 0;
}

.wo-attachment-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 2px;
}

.wo-attachment-view {
  justify-self: start;
}

.wo-attachment-body strong {
  overflow-wrap: anywhere;
}

.wo-attachment-body span,
.wo-attachment-body p {
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.35;
  margin: 0;
}

.wo-attachment-body .wo-attachment-meta {
  color: #285f8f;
  font-weight: 800;
}

.wo-attachment-status {
  border-radius: 999px;
  flex: 0 0 auto;
  font-size: 0.68rem;
  font-weight: 900;
  line-height: 1;
  padding: 5px 7px;
  text-transform: uppercase;
}

.wo-attachment-status.ready {
  background: #e6f6ec;
  color: #1d6233;
}

.wo-attachment-status.local {
  background: #eef3f8;
  color: #52606d;
}

.wo-attachment-status.warning,
.wo-attachment-status.pending {
  background: #fff3d8;
  color: #7a5200;
}

.wo-attachment-status.imported {
  background: #ececff;
  color: #444085;
}

/* Thumbnail confirmation shown after a photo/receipt is chosen, before upload. */
.file-preview {
  align-items: center;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  display: flex;
  gap: 10px;
  margin-top: 8px;
  padding: 8px 10px;
}

.file-preview[hidden] {
  display: none;
}

.file-preview-thumb {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  flex: 0 0 auto;
  height: 64px;
  object-fit: cover;
  width: 64px;
}

.file-preview-icon {
  align-items: center;
  color: var(--muted);
  display: inline-flex;
  flex: 0 0 auto;
  height: 40px;
  justify-content: center;
  width: 40px;
}

.file-preview-icon svg {
  height: 28px;
  width: 28px;
}

.file-preview-meta {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.3;
  word-break: break-word;
}

.wo-attachment-form {
  border-top: 1px solid var(--line);
  margin-top: 2px;
  padding-top: 12px;
}

.attachment-prep-status {
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.85rem;
  min-height: 0;
  padding: 0;
}

.attachment-prep-status:not(:empty) {
  background: #f6f8fb;
  border: 1px solid var(--line);
  padding: 8px 10px;
}

.attachment-prep-status.is-pending {
  background: #fff7e8;
  border-color: #f3cf93;
  color: #755000;
}

.attachment-prep-status.is-ready {
  background: #eefaf1;
  border-color: #b8dfbf;
  color: #256536;
}

.attachment-prep-status.is-warning {
  background: #fff2f0;
  border-color: #f0b7ae;
  color: #8a2f23;
}

/* Compact, equal-height Status + note fields for the "Update this work order"
   box so it reads as a quick update, not a giant form.  An explicit equal height
   (overriding the textarea's default 2-row height and the base 84px min-height)
   makes the Status box and Progress note box exactly the same size; the note
   field stays drag-resizable for when more room is needed. */
.wo-update-form select,
.wo-update-form textarea {
  min-height: 36px;
  height: 36px;
  padding: 6px 10px;
}

.wo-activity-panel .subsection-title {
  margin-bottom: 10px;
}

.wo-activity-list {
  display: grid;
  gap: 10px;
}

.wo-activity-item {
  display: grid;
  gap: 9px;
  grid-template-columns: 10px minmax(0, 1fr);
}

.wo-activity-dot {
  background: var(--blue);
  border-radius: 999px;
  height: 8px;
  margin-top: 7px;
  width: 8px;
}

.wo-activity-item strong {
  display: block;
  font-size: 0.9rem;
}

.wo-activity-item span {
  color: var(--muted);
  display: block;
  font-size: 0.78rem;
  margin-top: 2px;
}

.wo-activity-item p {
  color: #2f4157;
  line-height: 1.35;
  margin: 4px 0 0;
}

.mini-label {
  color: var(--muted);
  display: block;
  font-size: 0.72rem;
  font-weight: 850;
  margin-bottom: 4px;
  text-transform: uppercase;
}

.wo-detail .table-wrap table {
  min-width: 0;
}

.view-as-select {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-size: 0.84rem;
  min-height: 32px;
  padding: 4px 8px;
}

.view-as-select:focus-visible {
  outline: 2px solid #b9d9fb;
  outline-offset: 1px;
}

.preview-select-wrap {
  align-items: center;
  color: var(--muted);
  display: inline-flex;
  font-size: 0.72rem;
  font-weight: 850;
  gap: 6px;
  text-transform: uppercase;
}

.preview-select {
  min-width: 138px;
}

.reports-placeholder {
  background: #f6fbff;
  border: 1px solid #b9d9fb;
  border-radius: 8px;
  color: var(--ink);
  padding: 18px 20px;
}

.reports-placeholder ul {
  margin: 8px 0 12px 20px;
}

.reports-placeholder code {
  background: #eef3f8;
  border-radius: 4px;
  font-size: 0.85em;
  padding: 1px 4px;
}

/* Weekly accountant report tables size to content rather than the wide
   billing min-width. */
.report-table,
.report-engineer-table,
.report-nwh-table {
  min-width: 0;
}

.report-engineer-table {
  max-width: 420px;
}

.report-nwh-table td,
.report-nwh-table th {
  white-space: nowrap;
}

.report-total-row td {
  background: #eef3f8;
  border-top: 2px solid var(--line);
  font-weight: 800;
}

.report-expand-col {
  width: 28px;
  text-align: center;
  color: var(--muted);
}

.report-property-row {
  cursor: pointer;
}

.report-property-row:hover td {
  background: #f6fbff;
}

.report-property-row.is-expanded td {
  background: #f6fbff;
}

.report-detail-row > td {
  background: #fbfcfe;
  padding: 0 12px 14px;
}

.report-detail {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 6px;
}

.report-detail-head {
  align-items: baseline;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: space-between;
}

.report-detail-table,
.report-invoice-table {
  min-width: 0;
}

.report-supporting {
  margin-top: 4px;
}

.report-supporting > summary {
  color: #1f6feb;
  cursor: pointer;
  font-size: 0.86rem;
  padding: 6px 0;
}

.report-supporting > summary:hover {
  color: #0a4ec0;
}

.report-note {
  margin-top: 12px;
}

.report-note code {
  background: #eef3f8;
  border-radius: 4px;
  font-size: 0.85em;
  padding: 1px 4px;
}

.input-with-clear {
  position: relative;
}

.input-with-clear input {
  padding-right: 32px;
}

/* Hide the clear button when the input is empty (placeholder is showing).
   This works reactively as the user types or picks a value — no JS or
   re-render required. */
.input-with-clear input:placeholder-shown + .input-clear-btn {
  display: none;
}

.input-clear-btn {
  align-items: center;
  background: transparent;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  font-size: 1.25rem;
  height: 26px;
  justify-content: center;
  line-height: 1;
  padding: 0;
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
}

.input-clear-btn:hover,
.input-clear-btn:focus-visible {
  background: #eef3f8;
  border-radius: 4px;
  color: var(--ink);
  outline: none;
}

.app-shell.preview-tablet {
  --preview-width: 834px;
  margin: 0 auto;
  width: min(100%, var(--preview-width));
  box-shadow: 0 18px 70px rgba(24, 36, 53, 0.18);
}

.app-shell.preview-ipad-landscape {
  --preview-width: 1194px;
}

.app-shell.preview-tablet .workorder-table-wrap,
.app-shell.preview-tablet .entry-table-wrap {
  display: none;
}

.app-shell.preview-tablet .wo-card-list,
.app-shell.preview-tablet .entry-card-list {
  display: grid;
  gap: 12px;
}

.app-shell.preview-tablet .workorder-detail-dialog {
  height: calc(100dvh - 24px);
  max-height: calc(100dvh - 24px);
  width: min(var(--preview-width), calc(100vw - 24px));
}

.app-shell.preview-tablet .field-workorder-dialog {
  max-height: calc(100dvh - 24px);
  width: min(var(--preview-width), calc(100vw - 24px));
}

.app-shell.preview-tablet .wo-detail-dialog-header {
  position: sticky;
  top: 0;
  z-index: 3;
}

.app-shell.preview-tablet .wo-detail-dialog-body {
  max-height: calc(100dvh - 112px);
}

.app-shell.preview-tablet .btn,
.app-shell.preview-tablet .inline-select,
.app-shell.preview-tablet .inline-input,
.app-shell.preview-tablet .field input,
.app-shell.preview-tablet .field select,
.app-shell.preview-tablet .field textarea {
  min-height: 44px;
}

.app-shell.preview-tablet .icon-btn {
  min-height: 44px;
  min-width: 44px;
}

.app-shell.preview-ipad-portrait {
  grid-template-columns: 1fr;
}

.app-shell.preview-ipad-portrait .sidebar {
  position: static;
  height: auto;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.app-shell.preview-ipad-portrait .nav-list {
  display: flex;
  overflow-x: auto;
  padding-bottom: 4px;
}

.app-shell.preview-ipad-portrait .nav-button {
  flex: 0 0 auto;
  width: auto;
}

.app-shell.preview-ipad-portrait .sidebar-footer {
  display: none;
}

.app-shell.preview-ipad-portrait .wo-meta-grid,
.app-shell.preview-ipad-portrait .howto-step-grid,
.app-shell.preview-ipad-portrait .home-module-grid,
.app-shell.preview-ipad-portrait .filters,
.app-shell.preview-ipad-portrait .kpi-grid,
.app-shell.preview-ipad-portrait .entry-week-strip-grid,
.app-shell.preview-ipad-portrait .week-review-layout,
.app-shell.preview-ipad-portrait .review-checklist,
.app-shell.preview-ipad-portrait .settings-list {
  grid-template-columns: 1fr 1fr;
}

.app-shell.preview-ipad-portrait .split-layout,
.app-shell.preview-ipad-portrait .wo-request-grid,
.app-shell.preview-ipad-portrait .entry-week-strip-grid {
  grid-template-columns: 1fr;
}

.app-shell.preview-ipad-portrait #entry-form .span-3,
.app-shell.preview-ipad-portrait .inline-entry-form .span-2 {
  grid-column: span 6;
}

.app-shell.preview-ipad-portrait .inline-entry-form .span-6 {
  grid-column: span 12;
}

/* Brief highlight when the PM clicks "Focus" to jump to a week's approval panel. */
@keyframes flash-focus {
  0% {
    box-shadow: 0 0 0 0 rgba(36, 107, 159, 0);
  }
  20% {
    box-shadow: 0 0 0 4px rgba(36, 107, 159, 0.35);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(36, 107, 159, 0);
  }
}

.flash-focus {
  animation: flash-focus 1.2s ease-out;
}

@media (prefers-reduced-motion: reduce) {
  .flash-focus {
    animation: none;
  }
}

/* PTO workflow preview (non-functional explainer of the request → PM → admin
   → auto-schedule flow). */
.pto-flow {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.pto-flow-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 10px 12px;
}

.pto-flow-num {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.pto-flow-item strong {
  display: block;
}

.pto-flow-item p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.3;
}

.pto-request-form-preview {
  margin-top: 12px;
}

.pto-request-form {
  margin-top: 12px;
}

.pto-request-list {
  display: grid;
  gap: 12px;
}

.pto-request-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 13px;
  display: grid;
  gap: 10px;
}

.pto-request-main {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.pto-request-title {
  font-weight: 850;
  color: var(--ink);
}

.pto-request-card p,
.pto-request-card span {
  color: var(--muted);
  font-size: 0.86rem;
  margin: 2px 0 0;
}

.pto-request-note {
  color: var(--ink);
}

.readonly-field {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8fbff;
  padding: 10px 11px;
  font-weight: 800;
}

@media (max-width: 860px) {
  .pto-flow {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pto-request-main {
    display: grid;
  }
}

/* Read-only work-order preview pop-out shown from the entry form. */
.wo-preview-dialog {
  max-height: min(85vh, 760px);
  overflow: hidden;
}

/* Only the OPEN dialog is a flex column — a closed <dialog> must stay
   display:none, or the empty dialog renders as a stray box. */
.wo-preview-dialog[open] {
  display: flex;
  flex-direction: column;
}

.wo-preview-body {
  overflow: auto;
  min-height: 0;
  display: grid;
  gap: 14px;
  margin: 6px 0 12px;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.wo-preview-attachments {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

/* Accountant billing-readiness panel on the Reports screen. */
.readiness-panel.not-ready {
  background: #fffaf0;
  border-color: #f0c36d;
}

.readiness-panel.ready {
  background: #f5fbf8;
  border-color: #b8dfcc;
}

.readiness-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.readiness-head p {
  margin: 3px 0 0;
}

.readiness-rows {
  margin-top: 10px;
  display: grid;
  gap: 6px;
}

.readiness-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.readiness-row > span {
  color: var(--muted);
  font-weight: 700;
}

.readiness-row.block {
  border-color: #e4a8a8;
}

.readiness-row.block > span {
  color: var(--red);
}

.readiness-row.warn {
  border-color: #f0c36d;
}

.readiness-row.ok {
  border-color: #b8dfcc;
}
