/*
 * Operational stability layer — 3.1.10
 * Keeps the proven operational interface while completing styles for the
 * current application markup. This file intentionally does not import the
 * guided UI stack.
 */

body.ow-operational-interface {
  --ow-operational-font: "Segoe UI Variable Text", "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --ow-stable-ink: #102b49;
  --ow-stable-muted: #66788f;
  --ow-stable-border: #d7e2ef;
  --ow-stable-soft: #f5f8fc;
  --ow-stable-blue: #1768c5;
  font-family: var(--ow-operational-font);
  font-size: 14px;
  line-height: 1.45;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body.ow-operational-interface :is(button, input, select, textarea) {
  font-family: inherit;
}

body.ow-operational-interface :is(h1, h2, h3, h4, h5, h6, strong, b) {
  font-weight: 700;
}

body.ow-operational-interface :is(button, label, summary, th, .ow-eyebrow) {
  font-weight: 600;
}

body.ow-operational-interface :is(p, small, td, input, select, textarea) {
  line-height: 1.45;
}

body.ow-operational-interface :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), select, textarea) {
  max-width: 100%;
  border-color: #ccd9e8;
  border-radius: 11px;
  background: #fff;
  color: var(--ow-stable-ink);
  transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}

body.ow-operational-interface :is(button, a, summary) {
  transition: color .16s ease, background-color .16s ease, border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

body.ow-operational-interface :is(button, input, select, textarea):disabled {
  cursor: not-allowed;
  opacity: .58;
}

body.ow-operational-interface .ow-operational-focus-toggle {
  min-width: 42px;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 11px;
  border: 1px solid #d4dfed;
  border-radius: 13px;
  background: #fff;
  color: #174f86;
  box-shadow: 0 7px 20px rgba(7, 23, 47, .06);
  cursor: pointer;
}

body.ow-operational-interface .ow-operational-focus-toggle[aria-pressed="true"] {
  border-color: #8bb6e7;
  background: #eaf3ff;
  color: #0b5ab6;
  box-shadow: 0 0 0 3px rgba(31, 111, 235, .12);
}

body.ow-operational-interface .ow-operational-nav-tooltip {
  position: fixed;
  z-index: 11000;
  max-width: 220px;
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 9px;
  background: #102b49;
  color: #fff;
  box-shadow: 0 10px 28px rgba(3, 20, 39, .24);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.3;
  pointer-events: none;
}

body.ow-operational-interface .ow-operational-nav-tooltip[hidden] {
  display: none;
}

/* Dashboard markup used by all role variants. */
body.ow-operational-interface .ow-dashboard-metric {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  align-items: center;
  gap: 12px;
}

body.ow-operational-interface .ow-dashboard-metric-copy {
  min-width: 0;
  display: grid;
  gap: 5px;
}

body.ow-operational-interface .ow-dashboard-metric-copy > span {
  color: #536a84;
  font-size: 11px;
  font-weight: 600;
}

body.ow-operational-interface .ow-dashboard-metric-copy > strong {
  color: #0b213d;
  font-size: clamp(24px, 2vw, 31px);
  line-height: 1.05;
  letter-spacing: -.035em;
  overflow-wrap: anywhere;
}

body.ow-operational-interface .ow-dashboard-metric-copy > small {
  color: #718198;
  font-size: 11px;
}

body.ow-operational-interface .ow-dashboard-metric-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: #fff0d8;
  color: #ba6e00;
}

body.ow-operational-interface .ow-dashboard-metric-icon svg,
body.ow-operational-interface .ow-dashboard-metric-icon .ow-ui-icon {
  width: 22px !important;
  height: 22px !important;
  max-width: 22px;
  max-height: 22px;
  fill: none;
  stroke: currentColor;
}

body.ow-operational-interface .ow-dashboard-metric:is(.is-sales, .is-positive) .ow-dashboard-metric-icon {
  background: #e6f7ee;
  color: #087b4c;
}

body.ow-operational-interface .ow-dashboard-metric.is-operations .ow-dashboard-metric-icon {
  background: #e9f2ff;
  color: #0d62c8;
}

body.ow-operational-interface .ow-dashboard-metric.is-critical .ow-dashboard-metric-icon {
  background: #ffe8eb;
  color: #c42f40;
}

body.ow-operational-interface .ow-dashboard-metric.is-people .ow-dashboard-metric-icon {
  background: #f0eaff;
  color: #7043c5;
}

body.ow-operational-interface .ow-dashboard-metrics--admin {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

body.ow-operational-interface .ow-dashboard-admin-grid {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

body.ow-operational-interface .ow-dashboard-admin-grid > .ow-dashboard-panel {
  grid-column: auto;
}

body.ow-operational-interface .ow-dashboard-admin-panel {
  min-width: 0;
  min-height: 230px;
  padding: 17px;
}

body.ow-operational-interface .ow-dashboard-admin-panel > .ow-card-head {
  margin-bottom: 11px;
  padding-bottom: 11px;
  border-bottom: 1px solid #e5ecf4;
}

body.ow-operational-interface .ow-dashboard-admin-rows {
  overflow: hidden;
  border: 1px solid #e1e8f0;
  border-radius: 13px;
}

body.ow-operational-interface .ow-dashboard-admin-row {
  width: 100%;
  min-height: 46px;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 0;
  border-bottom: 1px solid #e7edf3;
  border-radius: 0;
  background: #fff;
  color: #19334f;
  text-align: left;
  cursor: pointer;
}

body.ow-operational-interface .ow-dashboard-admin-row:last-child {
  border-bottom: 0;
}

body.ow-operational-interface .ow-dashboard-admin-row-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #edf4ff;
  color: #0b63d5;
  font-size: 11px;
}

body.ow-operational-interface .ow-dashboard-admin-row-icon:is(.is-warning, .is-high) {
  background: #fff1d7;
  color: #a86400;
}

body.ow-operational-interface .ow-dashboard-admin-row-icon:is(.is-danger, .is-critical) {
  background: #ffe8ea;
  color: #ba2a3b;
}

body.ow-operational-interface .ow-dashboard-admin-row-icon:is(.is-green, .is-positive) {
  background: #e5f7ee;
  color: #08784b;
}

body.ow-operational-interface .ow-dashboard-admin-row-icon.is-violet {
  background: #f0eaff;
  color: #7043c5;
}

body.ow-operational-interface .ow-dashboard-admin-row-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

body.ow-operational-interface .ow-dashboard-admin-row-copy :is(strong, small) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.ow-operational-interface .ow-dashboard-admin-row-copy strong {
  font-size: 12px;
}

body.ow-operational-interface .ow-dashboard-admin-row-copy small {
  color: #73859a;
  font-size: 10px;
}

body.ow-operational-interface .ow-dashboard-admin-row > b {
  min-width: 23px;
  height: 22px;
  display: grid;
  place-items: center;
  padding: 0 7px;
  border-radius: 999px;
  background: #ffebed;
  color: #bd2d3c;
  font-size: 10px;
}

body.ow-operational-interface .ow-dashboard-activity-row {
  min-height: 48px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 7px 2px;
  border-bottom: 1px solid #e9eef4;
}

body.ow-operational-interface .ow-dashboard-activity-row:last-child {
  border-bottom: 0;
}

body.ow-operational-interface .ow-dashboard-avatar {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #e9f2fb;
  color: #174f85;
  font-size: 10px;
}

body.ow-operational-interface .ow-dashboard-activity-row > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

body.ow-operational-interface .ow-dashboard-activity-row small {
  overflow: hidden;
  color: #73859a;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.ow-operational-interface .ow-dashboard-global-note {
  min-height: 64px;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid #cfe0f4;
  border-radius: 14px;
  background: #f4f8fd;
}

body.ow-operational-interface .ow-dashboard-global-note > span {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #0a63d7;
  color: #fff;
}

/* Coordinator command centre: compact scan-first hierarchy with two useful columns. */
body.ow-operational-interface .ow-coordinator-dashboard {
  min-width: 0;
  display: grid;
  gap: 14px;
}

body.ow-operational-interface .ow-coordinator-dashboard > *,
body.ow-operational-interface .ow-coordinator-main-grid > *,
body.ow-operational-interface .ow-coordinator-secondary-grid > *,
body.ow-operational-interface .ow-coordinator-health-grid > * {
  min-width: 0;
}

body.ow-operational-interface .ow-department-kpis {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

body.ow-operational-interface .ow-department-kpis > article {
  min-width: 0;
  min-height: 92px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "label value"
    "note note";
  align-items: start;
  gap: 7px 10px;
  padding: 13px 14px;
  border: 1px solid #d9e4f1;
  border-radius: 15px;
  background: linear-gradient(145deg, #fff, #f7faff);
  box-shadow: 0 7px 20px rgba(16, 43, 73, .04);
}

body.ow-operational-interface .ow-department-kpis > article > span {
  grid-area: label;
  align-self: center;
  color: #536a84;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .045em;
  text-transform: uppercase;
}

body.ow-operational-interface .ow-department-kpis > article > strong {
  grid-area: value;
  color: #0d2a49;
  font-size: 24px;
  line-height: 1;
  letter-spacing: -.035em;
}

body.ow-operational-interface .ow-department-kpis > article > small {
  grid-area: note;
  color: #718298;
  font-size: 10px;
  line-height: 1.35;
}

body.ow-operational-interface .ow-department-kpis > article[data-tone="danger"] {
  border-color: #f0c7cb;
  background: linear-gradient(145deg, #fff, #fff5f6);
}

body.ow-operational-interface .ow-department-kpis > article[data-tone="danger"] > strong {
  color: #bd2d3c;
}

body.ow-operational-interface .ow-coordinator-main-grid,
body.ow-operational-interface .ow-coordinator-secondary-grid {
  min-width: 0;
  display: grid;
  align-items: start;
  gap: 14px;
}

body.ow-operational-interface .ow-coordinator-main-grid {
  grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr);
}

body.ow-operational-interface .ow-coordinator-secondary-grid {
  grid-template-columns: minmax(0, 1.55fr) minmax(310px, .85fr);
}

body.ow-operational-interface .ow-coordinator-main-grid > .ow-card,
body.ow-operational-interface .ow-coordinator-secondary-grid > .ow-card,
body.ow-operational-interface .ow-coordinator-health-grid > .ow-card {
  margin: 0;
}

body.ow-operational-interface .ow-coordinator-dashboard .ow-card-head {
  min-width: 0;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 0;
  padding-bottom: 12px;
  border-bottom: 1px solid #e4ebf3;
}

body.ow-operational-interface .ow-coordinator-dashboard .ow-card-head > div {
  min-width: 0;
}

body.ow-operational-interface .ow-coordinator-dashboard .ow-card-head :is(h3, p) {
  overflow-wrap: anywhere;
}

body.ow-operational-interface .ow-coordinator-priority-card,
body.ow-operational-interface .ow-coordinator-ai-compact,
body.ow-operational-interface .ow-coordinator-secondary-grid > .ow-card {
  padding: 16px;
}

body.ow-operational-interface .ow-coordinator-priority-list,
body.ow-operational-interface .ow-operational-ticket-list,
body.ow-operational-interface .ow-operational-alert-list {
  min-width: 0;
  display: grid;
  max-height: none !important;
  overflow: visible !important;
}

body.ow-operational-interface .ow-coordinator-priority-list {
  margin: 0 -16px -16px;
}

body.ow-operational-interface .ow-coordinator-priority-list > [data-focus-record] {
  min-width: 0;
}

body.ow-operational-interface .ow-coordinator-priority-list .ow-operational-ticket-row,
body.ow-operational-interface .ow-coordinator-list-card .ow-operational-ticket-row {
  min-width: 0;
  grid-template-columns: minmax(240px, 1fr) minmax(300px, auto);
  gap: 14px;
  padding: 13px 15px;
}

body.ow-operational-interface .ow-coordinator-priority-list .ow-operational-ticket-row:hover,
body.ow-operational-interface .ow-coordinator-list-card .ow-operational-ticket-row:hover {
  transform: none;
}

body.ow-operational-interface .ow-operational-ticket-main > :is(b, small),
body.ow-operational-interface .ow-operational-health-row :is(strong, small) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.ow-operational-interface .ow-operational-ticket-meta {
  min-width: 0;
  max-width: 100%;
  justify-content: flex-end;
  gap: 7px;
}

body.ow-operational-interface .ow-operational-ticket-meta > small {
  min-width: 100px;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.ow-operational-interface .ow-coordinator-ai-compact {
  display: grid;
  align-content: start;
  gap: 13px;
  border-color: #c8dced;
  background: linear-gradient(180deg, #fff, #f5fbfa);
}

body.ow-operational-interface .ow-coordinator-ai-compact__summary {
  margin: 0;
  color: #35516d;
  line-height: 1.55;
}

body.ow-operational-interface .ow-coordinator-ai-compact__items {
  display: grid;
  gap: 7px;
}

body.ow-operational-interface .ow-coordinator-ai-priority {
  width: 100%;
  min-width: 0;
  display: grid;
  gap: 3px;
  padding: 10px 11px;
  border: 1px solid #d6e4ef;
  border-radius: 11px;
  background: #fff;
  color: #173452;
  text-align: left;
  cursor: pointer;
}

body.ow-operational-interface .ow-coordinator-ai-priority :is(strong, small) {
  min-width: 0;
  overflow-wrap: anywhere;
}

body.ow-operational-interface .ow-coordinator-ai-priority small {
  color: #6a7d92;
  font-weight: 500;
}

body.ow-operational-interface .ow-coordinator-ai-compact > .ow-actions,
body.ow-operational-interface .ow-operational-alert-row > .ow-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 7px;
  flex-wrap: wrap;
}

body.ow-operational-interface .ow-coordinator-secondary-grid > .ow-card > .ow-operational-alert-list {
  margin: 12px -16px -16px;
}

body.ow-operational-interface .ow-operational-alert-row {
  min-width: 0;
  grid-template-columns: minmax(260px, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 13px 15px;
}

body.ow-operational-interface .ow-operational-alert-row > div:first-child,
body.ow-operational-interface .ow-operational-alert-row > .ow-actions {
  min-width: 0;
}

body.ow-operational-interface .ow-operational-alert-row :is(p, small) {
  overflow-wrap: anywhere;
}

body.ow-operational-interface .ow-operational-alert-row .ow-compact-action {
  min-height: 34px;
  padding: 7px 10px;
  white-space: nowrap;
}

body.ow-operational-interface .ow-coordinator-health-grid {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

body.ow-operational-interface .ow-coordinator-health-grid > .ow-card {
  padding: 14px !important;
  overflow: hidden;
}

body.ow-operational-interface .ow-coordinator-health-grid .ow-card-head {
  padding: 0 0 11px;
}

body.ow-operational-interface .ow-operational-health-row {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin-top: 7px;
  padding: 10px 11px;
}

body.ow-operational-interface .ow-operational-health-row > span:first-child {
  min-width: 0;
}

body.ow-operational-interface .ow-operational-health-row .ow-operational-object-health {
  justify-self: end;
  white-space: nowrap;
}

body.ow-operational-interface .ow-coordinator-list-card {
  min-width: 0;
  overflow: hidden;
}

body.ow-operational-interface .ow-coordinator-list-head {
  min-width: 0;
  flex-wrap: wrap;
  gap: 10px;
  padding: 13px 15px;
}

body.ow-operational-interface .ow-coordinator-tabs {
  min-width: 0;
}

body.ow-operational-interface .ow-coordinator-tabs button {
  min-height: 36px;
  padding: 7px 11px;
}

body.ow-operational-interface .ow-coordinator-ai-details {
  min-width: 0;
  padding: 13px 15px;
  border: 1px solid #d8e4f1;
  border-radius: 14px;
  background: #fff;
}

body.ow-operational-interface .ow-coordinator-ai-details > summary {
  color: #28547e;
  cursor: pointer;
}

/* Same-origin user avatar with an initials fallback that never shows a broken image. */
body.ow-operational-interface .ow-user-avatar-image-wrap {
  position: relative;
  isolation: isolate;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid #cbd9e9;
  border-radius: 50%;
  background: linear-gradient(145deg, #eaf3ff, #dcecff);
  color: #165b9e;
}

body.ow-operational-interface .ow-user-avatar-fallback {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .02em;
}

body.ow-operational-interface .ow-user-avatar-image {
  position: relative;
  z-index: 1;
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  display: block;
  border-radius: inherit;
  object-fit: cover;
}

body.ow-operational-interface .ow-user-avatar-image[hidden],
body.ow-operational-interface .ow-user-avatar-image-wrap.is-fallback .ow-user-avatar-image {
  display: none !important;
}

/* Profile: keep uploaded avatars inside a stable editor frame. */
body.ow-operational-interface .ow-profile-account-layout {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  align-items: start;
  gap: 22px;
}

body.ow-operational-interface .ow-profile-avatar-editor {
  min-width: 0;
  display: grid;
  justify-items: center;
  gap: 10px;
  text-align: center;
}

body.ow-operational-interface .ow-profile-avatar-preview {
  width: 112px;
  height: 112px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 4px solid #fff;
  border-radius: 50%;
  background: #eaf3ff;
  color: #1768c5;
  box-shadow: 0 0 0 1px #cddcec, 0 10px 26px rgba(7, 27, 53, .1);
  font-size: 28px;
}

body.ow-operational-interface .ow-profile-avatar-preview img {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  object-fit: cover;
}

body.ow-operational-interface .ow-profile-avatar-editor small {
  max-width: 170px;
  color: var(--ow-stable-muted);
}

/* Mail list has two real columns: folders and a full-width Gmail-like record list. */
body.ow-operational-interface .ow-mail-loading-shell {
  display: grid;
  gap: 12px;
  min-height: 520px;
  padding: 14px;
  border: 1px solid #d8e3ef;
  border-radius: 18px;
  background: #fff;
}

body.ow-operational-interface .ow-mail-loading-shell > header,
body.ow-operational-interface .ow-mail-loading-shell > div,
body.ow-operational-interface .ow-mail-loading-shell aside,
body.ow-operational-interface .ow-mail-loading-shell main {
  min-width: 0;
  display: grid;
  gap: 10px;
}

body.ow-operational-interface .ow-mail-loading-shell > header {
  grid-template-columns: minmax(160px, 280px) 140px;
  justify-content: space-between;
}

body.ow-operational-interface .ow-mail-loading-shell > div {
  grid-template-columns: 176px minmax(0, 1fr);
}

body.ow-operational-interface .ow-mail-loading-shell :is(span, b) {
  display: block;
  min-height: 38px;
  border-radius: 10px;
  background: linear-gradient(90deg, #edf2f7 20%, #f8fafc 38%, #edf2f7 56%);
  background-size: 230% 100%;
  animation: ow-mail-skeleton 1.35s ease-in-out infinite;
}

body.ow-operational-interface .ow-mail-loading-shell main b {
  min-height: 48px;
}

body.ow-operational-interface .ow-mail-loading-shell main span {
  min-height: 56px;
  border-radius: 5px;
}

@keyframes ow-mail-skeleton {
  to { background-position-x: -130%; }
}

body.ow-operational-interface .ow-mail-layout.ow-mail-layout-list,
body.ow-operational-interface .ow-mail-list--records {
  min-width: 0;
}

@media (min-width: 53.81rem) {
  body.ow-operational-interface .ow-mail-layout.ow-mail-layout-list {
    grid-template-columns: 176px minmax(0, 1fr);
  }
}

body.ow-operational-interface .ow-mail-list-scroll {
  min-width: 0;
  overflow-x: hidden;
  background: #fff;
}

body.ow-operational-interface .ow-mail-record {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  grid-template-areas:
    "state sender time"
    "state content content"
    "state meta meta";
  align-items: start;
  gap: 4px 9px;
  padding: 11px 12px;
  border: 0;
  border-bottom: 1px solid #e3eaf2;
  border-radius: 0;
  background: #fff;
  color: var(--ow-stable-ink);
  text-align: left;
  box-shadow: none;
  cursor: pointer;
}

body.ow-operational-interface .ow-mail-record__state {
  grid-area: state;
  min-height: 24px;
  display: grid;
  place-items: center;
}

body.ow-operational-interface .ow-mail-record__state b {
  min-width: 21px;
  height: 21px;
  display: grid;
  place-items: center;
  padding: 0 4px;
  border-radius: 999px;
  background: #1768c5;
  color: #fff;
  font-size: 10px;
}

body.ow-operational-interface .ow-mail-record__state i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #b9c6d6;
}

body.ow-operational-interface .ow-mail-record__sender {
  grid-area: sender;
}

body.ow-operational-interface .ow-mail-record__content {
  grid-area: content;
}

body.ow-operational-interface .ow-mail-record__meta {
  grid-area: meta;
}

body.ow-operational-interface .ow-mail-record :is(.ow-mail-record__sender, .ow-mail-record__content, .ow-mail-record__meta) {
  min-width: 0;
  display: grid;
  gap: 2px;
}

body.ow-operational-interface .ow-mail-record :is(strong, small, em) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.ow-operational-interface .ow-mail-record__sender strong,
body.ow-operational-interface .ow-mail-record__content strong {
  color: #173452;
  font-size: 12px;
}

body.ow-operational-interface .ow-mail-record__sender small,
body.ow-operational-interface .ow-mail-record__content small,
body.ow-operational-interface .ow-mail-record__meta small,
body.ow-operational-interface .ow-mail-record__meta em {
  color: #72839a;
  font-size: 10px;
  font-style: normal;
}

body.ow-operational-interface .ow-mail-record__content > span {
  min-width: 0;
  display: flex;
  gap: 6px;
}

body.ow-operational-interface .ow-mail-record__content > span strong {
  flex: 1 1 auto;
}

body.ow-operational-interface .ow-mail-record__content > span em {
  flex: 0 1 auto;
  color: #75869a;
  font-size: 10px;
  font-style: normal;
}

body.ow-operational-interface .ow-mail-record time {
  grid-area: time;
  justify-self: end;
  color: #76879b;
  font-size: 10px;
  white-space: nowrap;
}

body.ow-operational-interface .ow-mail-record.is-active {
  background: #eaf3ff;
  box-shadow: inset 3px 0 0 #1768c5;
}

body.ow-operational-interface .ow-mail-record.is-unread {
  background: #f4f8ff;
}

body.ow-operational-interface .ow-mail-record.is-unread :is(.ow-mail-record__sender strong, .ow-mail-record__content strong, time) {
  color: #0b2c52;
  font-weight: 700;
}

@media (min-width: 68.01rem) {
  body.ow-operational-interface .ow-mail-record {
    min-height: 58px;
    grid-template-columns: 24px minmax(150px, 20%) minmax(240px, 1fr) minmax(135px, 17%) minmax(64px, auto);
    grid-template-areas: "state sender content meta time";
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
  }

  body.ow-operational-interface .ow-mail-record :is(.ow-mail-record__sender, .ow-mail-record__meta) {
    align-content: center;
  }

  body.ow-operational-interface .ow-mail-record__content {
    display: flex;
    align-items: center;
    gap: 7px;
  }

  body.ow-operational-interface .ow-mail-record__content > span {
    flex: 0 1 auto;
    max-width: 52%;
  }

  body.ow-operational-interface .ow-mail-record__content > span em {
    display: none;
  }

  body.ow-operational-interface .ow-mail-record__content > small {
    flex: 1 1 12rem;
  }

  body.ow-operational-interface .ow-mail-record__content > small::before {
    content: "— ";
    color: #a0adbc;
  }
}

/* Finance dashboard and purchase invoice table. */
body.ow-operational-interface .ow-finance-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
}

body.ow-operational-interface .ow-finance-metric {
  min-width: 0;
  display: grid;
  gap: 5px;
  padding: 16px;
  border: 1px solid #d9e4f1;
  border-radius: 17px;
  background: linear-gradient(180deg, #fff, #f8fbff);
}

body.ow-operational-interface .ow-finance-metric span {
  color: #65768d;
  font-size: 12px;
}

body.ow-operational-interface .ow-finance-metric strong {
  color: #0b213d;
  font-size: clamp(20px, 2vw, 25px);
  line-height: 1.15;
  overflow-wrap: anywhere;
}

body.ow-operational-interface .ow-finance-metric small {
  color: #7c8da2;
  font-size: 11px;
}

body.ow-operational-interface .ow-purchase-invoice-grid .ow-grid-table {
  min-width: 1160px;
}

body.ow-operational-interface .ow-purchase-invoice-grid .ow-grid-table :is(th, td) {
  overflow-wrap: normal;
  word-break: normal;
}

body.ow-operational-interface .ow-purchase-invoice-grid .ow-grid-table :is(th, td):nth-child(1) {
  min-width: 150px;
}

body.ow-operational-interface .ow-purchase-invoice-grid .ow-grid-table :is(th, td):nth-child(2) {
  min-width: 190px;
}

body.ow-operational-interface .ow-purchase-invoice-grid .ow-grid-table :is(th, td):nth-child(n+3) {
  white-space: nowrap;
}

/* One table contract for operational and sales tasks. */
body.ow-operational-interface .ow-task-grid {
  min-width: 0;
}

body.ow-operational-interface .ow-task-grid .ow-grid-table {
  min-width: 1120px;
}

body.ow-operational-interface .ow-task-grid--operations .ow-grid-table {
  min-width: 1320px;
}

body.ow-operational-interface .ow-task-grid .ow-grid-table :is(th, td) {
  overflow-wrap: normal;
  word-break: normal;
}

body.ow-operational-interface .ow-task-grid .ow-grid-row {
  transition: background-color .15s ease, box-shadow .15s ease;
}

body.ow-operational-interface .ow-task-grid .ow-grid-row.is-overdue {
  background: #fff8f8;
  box-shadow: inset 3px 0 0 #d64545;
}

body.ow-operational-interface .ow-task-grid .ow-grid-row.is-done {
  background: #f6faf8;
  color: #6e7e75;
}

body.ow-operational-interface .ow-task-grid .ow-grid-row.is-done .ow-task-grid__main .ow-grid-cell-content > :is(strong, .ow-link-button) {
  text-decoration: line-through;
  text-decoration-color: #a8b6ae;
}

body.ow-operational-interface .ow-grid-cell-content {
  min-width: 0;
}

body.ow-operational-interface td.ow-task-grid__main .ow-grid-cell-content > :is(.ow-link-button, strong, small),
body.ow-operational-interface td.ow-task-grid__due .ow-grid-cell-content > :is(strong, span),
body.ow-operational-interface td.ow-task-grid__reason .ow-grid-cell-content > :is(small, span) {
  display: block;
}

body.ow-operational-interface td.ow-task-grid__main .ow-grid-cell-content > strong {
  margin-top: 4px;
  color: #234260;
}

body.ow-operational-interface .ow-task-grid__note {
  max-width: 42ch;
  margin-top: 4px;
  overflow: hidden;
  color: #73849a;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.ow-operational-interface .ow-task-grid__due .ow-grid-cell-content > span {
  margin-top: 3px;
  color: #718198;
  font-size: 11px;
}

body.ow-operational-interface .ow-task-grid__state .ow-badge {
  display: inline-flex;
  margin: 0;
  white-space: nowrap;
}

body.ow-operational-interface .ow-task-grid__state .ow-grid-cell-content {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

body.ow-operational-interface .ow-task-grid__reason details {
  font-size: 12px;
}

body.ow-operational-interface .ow-task-grid__reason summary {
  color: #155fac;
  cursor: pointer;
}

body.ow-operational-interface .ow-task-grid__reason details p {
  margin: 7px 0 0;
  color: #5f7289;
}

body.ow-operational-interface .ow-task-grid__actions {
  width: 64px;
  text-align: center;
}

body.ow-operational-interface .ow-sales-task-panel {
  min-width: 0;
}

body.ow-operational-interface .ow-sales-task-panel > .ow-section-heading {
  margin-bottom: 14px;
}

body.ow-operational-interface .ow-grid-toolbar-actions {
  min-width: 0;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

body.ow-operational-interface .ow-grid-filters-panel:not(.is-open) {
  display: none;
}

body.ow-operational-interface .ow-c-action-menu {
  position: relative;
  display: inline-grid;
  place-items: center;
}

body.ow-operational-interface .ow-c-action-menu__toggle {
  min-width: 38px;
  min-height: 38px;
  display: inline-grid;
  place-items: center;
  padding: 0 8px;
  border: 1px solid #cbd9e9;
  border-radius: 11px;
  background: #fff;
  color: #1d568f;
  letter-spacing: .08em;
  cursor: pointer;
}

body.ow-operational-interface .ow-c-action-menu__panel {
  position: fixed !important;
  z-index: 10050;
  display: grid;
  gap: 3px;
  padding: 6px;
  border: 1px solid #cfdbea;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(7, 27, 53, .2);
}

body.ow-operational-interface .ow-c-action-menu__panel[hidden] {
  display: none;
}

body.ow-operational-interface .ow-c-action-menu__panel button {
  width: 100%;
  min-height: 36px;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #193754;
  text-align: left;
  cursor: pointer;
}

/* Notification drawer is anchored to the application viewport. */
body.ow-operational-interface .ow-notification-panel {
  top: 70px !important;
  right: 0 !important;
  bottom: 0 !important;
  left: auto !important;
  width: min(420px, 100vw) !important;
  max-width: 100vw;
  max-height: none !important;
  overflow: hidden;
  border-left: 1px solid #d7e2ef;
  background: #fff;
  box-shadow: -18px 0 46px rgba(7, 31, 57, .13);
}

body.ow-operational-interface .ow-notification-panel:not(.is-open) {
  transform: translateX(103%);
  pointer-events: none;
}

body.ow-operational-interface .ow-notification-panel.is-open {
  transform: translateX(0);
}

body.ow-operational-interface .ow-notification-panel .ow-notification-tab {
  display: none;
}

body.ow-operational-interface .ow-notification-content {
  width: 100% !important;
  height: 100% !important;
  max-height: none !important;
  padding: 16px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

/* The map remains a workbench, but numbered guided steps stay out of the operational UI. */
body.ow-operational-interface [data-sales-map-shell] .ow-guided-step > header > b {
  display: none;
}

body.ow-operational-interface [data-sales-map-shell] .ow-guided-step > header {
  grid-template-columns: minmax(0, 1fr);
}

body.ow-operational-interface .ow-sales-map-task-list article {
  grid-template-columns: minmax(0, 1fr) auto;
}

/* Lightweight focus mode: one layout state, no Fullscreen API and no workflow automation. */
@media (min-width: 48rem) {
  body.ow-operational-interface .ow-app-shell[data-focus-mode="on"] .ow-sidebar {
    display: none !important;
  }

  body.ow-operational-interface .ow-app-shell[data-focus-mode="on"] .ow-main {
    width: 100% !important;
    max-width: none !important;
    flex-basis: 100% !important;
  }

  body.ow-operational-interface .ow-app-shell[data-focus-mode="on"] .ow-operational-topbar {
    min-height: 54px !important;
    max-height: 54px !important;
    display: flex;
    align-items: center;
    padding: 6px 2px 8px;
    border-bottom: 1px solid #dbe4ef;
    background: rgba(247, 250, 253, .96);
  }

  body.ow-operational-interface .ow-app-shell[data-focus-mode="on"] .ow-topbar-heading .ow-eyebrow {
    display: none;
  }

  body.ow-operational-interface .ow-app-shell[data-focus-mode="on"] .ow-topbar-heading h1 {
    font-size: 20px;
  }

  body.ow-operational-interface .ow-app-shell[data-focus-mode="on"] .ow-topbar-actions {
    flex-wrap: nowrap;
  }

  body.ow-operational-interface .ow-app-shell[data-focus-mode="on"] .ow-topbar-actions > :not(.ow-operational-focus-toggle) {
    display: none !important;
  }

  body.ow-operational-interface .ow-app-shell[data-focus-mode="on"] .ow-operational-focus-toggle > span {
    display: inline !important;
  }

  body.ow-operational-interface .ow-app-shell[data-focus-mode="on"] [data-sales-map-shell] {
    height: calc(100dvh - 82px) !important;
    min-height: 0 !important;
  }
}

@media (hover: hover) {
  body.ow-operational-interface .ow-operational-focus-toggle:hover,
  body.ow-operational-interface .ow-c-action-menu__toggle:hover {
    border-color: #94b9e3;
    background: #edf5ff;
    color: #0d57a6;
    box-shadow: 0 9px 24px rgba(7, 23, 47, .1);
    transform: translateY(-1px);
  }

  body.ow-operational-interface .ow-dashboard-admin-row:hover,
  body.ow-operational-interface .ow-mail-record:hover,
  body.ow-operational-interface .ow-coordinator-ai-priority:hover,
  body.ow-operational-interface .ow-operational-health-row:hover,
  body.ow-operational-interface .ow-coordinator-tabs button:hover,
  body.ow-operational-interface .ow-c-action-menu__panel button:hover {
    background: #f2f7fd;
  }

  body.ow-operational-interface .ow-coordinator-ai-priority:hover,
  body.ow-operational-interface .ow-operational-health-row:hover {
    border-color: #9dbde0;
    box-shadow: 0 6px 16px rgba(15, 53, 88, .07);
  }

  body.ow-operational-interface :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), select, textarea):hover {
    border-color: #9eb9d8;
  }
}

@media (max-width: 74rem) and (min-width: 48rem) {
  body.ow-operational-interface .ow-topbar-actions {
    flex-wrap: nowrap;
  }

  body.ow-operational-interface .ow-ai-assistant-toggle > span,
  body.ow-operational-interface .ow-operational-focus-toggle > span,
  body.ow-operational-interface .ow-operational-profile > span:last-child,
  body.ow-operational-interface .ow-operational-logout > span {
    display: none;
  }

  body.ow-operational-interface .ow-dashboard-metrics--admin {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.ow-operational-interface .ow-department-kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 68rem) {
  body.ow-operational-interface .ow-dashboard-admin-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  body.ow-operational-interface .ow-finance-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.ow-operational-interface .ow-mail-record__meta {
    display: none;
  }
}

@media (max-width: 64rem) {
  body.ow-operational-interface .ow-coordinator-main-grid,
  body.ow-operational-interface .ow-coordinator-secondary-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  body.ow-operational-interface .ow-coordinator-health-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 53.8rem) {
  body.ow-operational-interface .ow-mail-layout.ow-mail-layout-list {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 47.99rem) {
  body.ow-operational-interface .ow-operational-focus-toggle,
  body.ow-operational-interface [data-sales-map-action="fullscreen"] {
    display: none !important;
  }

  body.ow-operational-interface .ow-dashboard-metrics--admin,
  body.ow-operational-interface .ow-dashboard-admin-grid,
  body.ow-operational-interface .ow-finance-metrics,
  body.ow-operational-interface .ow-profile-account-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  body.ow-operational-interface .ow-department-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.ow-operational-interface .ow-coordinator-health-grid,
  body.ow-operational-interface .ow-coordinator-priority-list .ow-operational-ticket-row,
  body.ow-operational-interface .ow-coordinator-list-card .ow-operational-ticket-row,
  body.ow-operational-interface .ow-operational-alert-row {
    grid-template-columns: minmax(0, 1fr);
  }

  body.ow-operational-interface .ow-operational-ticket-meta,
  body.ow-operational-interface .ow-operational-alert-row > .ow-actions {
    justify-content: flex-start;
  }

  body.ow-operational-interface .ow-operational-ticket-meta > small {
    max-width: none;
    text-align: left;
  }

  body.ow-operational-interface .ow-dashboard-global-note {
    grid-template-columns: 32px minmax(0, 1fr);
  }

  body.ow-operational-interface .ow-dashboard-global-note > button {
    grid-column: 1 / -1;
  }

  body.ow-operational-interface .ow-profile-avatar-editor {
    padding-bottom: 16px;
    border-bottom: 1px solid #e2eaf3;
  }

  body.ow-operational-interface .ow-notification-panel {
    top: 58px !important;
    width: 100vw !important;
  }

  body.ow-operational-interface .ow-grid-toolbar,
  body.ow-operational-interface .ow-grid-toolbar-actions,
  body.ow-operational-interface .ow-grid-sort-control {
    align-items: stretch;
  }

  body.ow-operational-interface .ow-grid-toolbar-actions {
    width: 100%;
    justify-content: stretch;
  }

  body.ow-operational-interface .ow-grid-toolbar-actions > * {
    flex: 1 1 auto;
  }

  body.ow-operational-interface .ow-task-grid .ow-table-wrap {
    overflow: visible;
    border: 0;
    border-radius: 0 !important;
    background: transparent;
  }

  body.ow-operational-interface .ow-task-grid .ow-grid-table,
  body.ow-operational-interface .ow-task-grid .ow-grid-table tbody,
  body.ow-operational-interface .ow-task-grid .ow-grid-table tr,
  body.ow-operational-interface .ow-task-grid .ow-grid-table td {
    width: 100%;
    min-width: 0;
    display: block;
  }

  body.ow-operational-interface .ow-task-grid .ow-grid-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
  }

  body.ow-operational-interface .ow-task-grid .ow-grid-table tbody {
    display: grid;
    gap: 11px;
  }

  body.ow-operational-interface .ow-task-grid .ow-grid-table tr {
    overflow: hidden;
    border: 1px solid #d8e3ef;
    border-radius: 15px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(7, 27, 53, .05);
  }

  body.ow-operational-interface .ow-task-grid .ow-grid-table td {
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(92px, 34%) minmax(0, 1fr);
    gap: 10px;
    padding: 9px 11px;
    border-bottom: 1px solid #e8eef5;
    text-align: left;
  }

  body.ow-operational-interface .ow-task-grid .ow-grid-table td:last-child {
    border-bottom: 0;
  }

  body.ow-operational-interface .ow-task-grid .ow-grid-table td::before {
    content: attr(data-label);
    color: #6c7d92;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .035em;
    text-transform: uppercase;
  }

  body.ow-operational-interface .ow-task-grid .ow-grid-table td > .ow-grid-cell-content {
    grid-column: 2;
    min-width: 0;
  }

  body.ow-operational-interface .ow-task-grid .ow-grid-table td.ow-grid-check,
  body.ow-operational-interface .ow-task-grid .ow-grid-table td.ow-task-grid__actions {
    width: 100%;
  }

  body.ow-operational-interface .ow-task-grid__note {
    max-width: 100%;
  }

  body.ow-operational-interface .ow-grid-footer,
  body.ow-operational-interface .ow-grid-pages {
    align-items: stretch;
  }

  body.ow-operational-interface .ow-grid-pages {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
  }
}

@media (max-width: 30rem) {
  body.ow-operational-interface .ow-dashboard-metrics,
  body.ow-operational-interface .ow-dashboard-metrics--admin,
  body.ow-operational-interface .ow-department-kpis,
  body.ow-operational-interface .ow-finance-metrics {
    grid-template-columns: minmax(0, 1fr);
  }

  body.ow-operational-interface .ow-mail-record {
    grid-template-columns: 20px minmax(0, 1fr) auto;
    padding-inline: 9px;
  }

  body.ow-operational-interface .ow-mail-record__sender small,
  body.ow-operational-interface .ow-mail-record__content em {
    display: none;
  }

  body.ow-operational-interface .ow-task-grid .ow-grid-table td {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }

  body.ow-operational-interface .ow-task-grid .ow-grid-table td > .ow-grid-cell-content {
    grid-column: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.ow-operational-interface *,
  body.ow-operational-interface *::before,
  body.ow-operational-interface *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}
