*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --teal:        #3d8b85;
  --teal-dark:   #2a6b65;
  --teal-light:  #5aaca7;
  --teal-pale:   #e8f5f4;
  --salmon:      #b35632;
  --salmon-dark: #8f4225;
  --danger:      #c53030;
  --danger-dark: #9b2c2c;
  --text:        #1a2e2d;
  --text-muted:  #5a7170;
  --border:      #d6ecea;
  --white:       #ffffff;
  --bg-light:    #f5fafa;
  --link-blue:   #0ea5e9;
  --link-blue-hover: #0284c7;
  --radius:      12px;
  --shadow:      0 4px 24px rgba(42, 107, 101, 0.10);
}

html { scroll-behavior: smooth; overflow-x: clip; }

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: var(--text);
  background: var(--white);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

body.menu-open { overflow: hidden; }

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; border: none; background: none; }

.container {
  width: min(1160px, calc(100% - 48px));
  max-width: 1160px;
  margin-inline: auto;
  padding-inline: 24px;
}

.container.page-inner--wide {
  width: min(1600px, calc(100% - 48px));
  max-width: 1600px;
}

.container.page-inner--full {
  width: calc(100vw - 48px);
  max-width: none;
}

.page-main--fluid {
  overflow-x: visible;
}

body.page-catalog-list {
  overflow-x: auto;
}

/* Header — fixed top chrome (logo, user, hamburger stay visible while scrolling) */
.site-top-chrome {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--white);
}

.site-top-chrome-spacer {
  flex-shrink: 0;
  height: var(--site-top-chrome-height, 69px);
  pointer-events: none;
}

.portal-search {
  position: relative;
  width: 100%;
  min-width: 0;
  max-width: 320px;
}

.site-header .container:has(.portal-search) {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 320px) auto;
  align-items: center;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.portal-search-input {
  width: 100%;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--teal-dark);
  padding: 8px 16px 8px 38px;
  border-radius: 50px;
  border: 1px solid var(--border);
  background-color: var(--white);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%232a6b65' stroke-width='2' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 14px center;
  background-size: 14px;
  appearance: none;
}

.portal-search-input::placeholder {
  color: var(--text-muted);
  font-weight: 500;
}

.portal-search-input:hover {
  background-color: var(--teal-pale);
}

.portal-search-input:focus {
  outline: none;
  border-color: var(--teal-light);
  box-shadow: 0 0 0 3px rgb(90 172 167 / 25%);
  background-color: var(--white);
}

.portal-search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 200;
  max-height: 320px;
  overflow-y: auto;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgb(42 107 101 / 14%);
}

.portal-search-result {
  display: block;
  padding: 12px 14px;
  text-decoration: none;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}

.portal-search-result:last-child {
  border-bottom: none;
}

.portal-search-result:hover,
.portal-search-result:focus {
  background: var(--teal-pale);
  outline: none;
}

.portal-search-result-title {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-weight: 700;
  color: var(--teal-dark);
}

.portal-search-result-type {
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.portal-search-result-desc {
  margin-top: 4px;
  font-size: 0.84rem;
  color: var(--text-muted);
}

.portal-search-empty,
.portal-search-loading {
  padding: 12px 14px;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-login-link,
.header-user {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--teal-dark);
  padding: 8px 14px;
  border-radius: 50px;
  border: 1px solid var(--border);
  background: var(--white);
  transition: background 0.15s, color 0.15s;
}

.header-login-link:hover,
.header-user:hover {
  background: var(--teal-pale);
  color: var(--teal-dark);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-link img { height: 36px; width: auto; }

.header-dashboard-title {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  font-weight: 800;
  line-height: 1.00;
  color: var(--teal);
  letter-spacing: -0.02em;
}

.ops-badge {
  display: inline-flex;
  align-items: center;
  background: var(--teal-pale);
  color: var(--teal-dark);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 50px;
  border: 1px solid var(--border);
}

/* Navigation */
.nav-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--teal-dark);
  transition: background 0.15s;
}

.nav-toggle:hover { background: var(--teal-pale); }
.nav-toggle:focus-visible { outline: 3px solid var(--teal-light); outline-offset: 2px; }
.nav-toggle svg { display: block; pointer-events: none; }
.nav-toggle .icon-close { display: none; }
.nav-toggle[aria-expanded="true"] .icon-menu { display: none; }
.nav-toggle[aria-expanded="true"] .icon-close { display: block; }

.nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 46, 45, 0.35);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
  z-index: 110;
}

.nav-overlay.is-open { opacity: 1; visibility: visible; }

.nav-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: min(320px, 88vw);
  height: 100vh;
  background: var(--white);
  border-left: 1px solid var(--border);
  box-shadow: -8px 0 32px rgba(42, 107, 101, 0.12);
  transform: translateX(100%);
  transition: transform 0.25s ease;
  z-index: 120;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.nav-panel.is-open { transform: translateX(0); }

.nav-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
}

.nav-panel-title {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal-dark);
}

.nav-list { list-style: none; padding: 12px 0; }

.nav-list a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 20px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  transition: background 0.12s, color 0.12s;
}

.nav-list a:hover,
.nav-list a.is-active { background: var(--teal-pale); color: var(--teal-dark); }

.nav-group.has-children .nav-parent-row {
  display: flex;
  align-items: stretch;
}

.nav-parent-link {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1 1 auto;
  min-width: 0;
  padding: 13px 12px 13px 20px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  transition: background 0.12s, color 0.12s;
}

.nav-parent-link:hover,
.nav-parent-link.is-active,
.nav-group.is-active > .nav-parent-row .nav-parent-link {
  background: var(--teal-pale);
  color: var(--teal-dark);
}

.nav-parent-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  flex-shrink: 0;
  color: var(--text-muted);
  border-left: 1px solid var(--border);
  transition: background 0.12s, color 0.12s;
}

.nav-parent-toggle:hover {
  background: var(--teal-pale);
  color: var(--teal-dark);
}

.nav-parent-toggle:focus-visible {
  outline: none;
  background: var(--teal-pale);
  box-shadow: inset 3px 0 0 var(--teal);
}

.nav-parent-chevron {
  transition: transform 0.2s ease;
}

.nav-group.is-expanded .nav-parent-chevron {
  transform: rotate(180deg);
}

.nav-group.has-children .nav-sublist {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
}

.nav-group.has-children.is-expanded .nav-sublist {
  max-height: 1600px;
}

.nav-list a:focus-visible {
  outline: none;
  background: var(--teal-pale);
  box-shadow: inset 3px 0 0 var(--teal);
}

.nav-list .nav-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--teal-pale);
  color: var(--teal);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nav-sublist {
  list-style: none;
  margin: 0;
  padding: 0 0 4px;
}

.nav-sublist a {
  padding: 8px 20px 8px 64px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
}

.nav-sublist a.is-active {
  color: var(--teal-dark);
  font-weight: 600;
}

.nav-divider { height: 1px; background: var(--border); margin: 8px 20px; }

.nav-section-label {
  padding: 12px 20px 6px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.nav-list a.nav-logout { color: var(--salmon-dark); }
.nav-list a.nav-logout:hover { background: #fdf0eb; }
.nav-list a.nav-logout .nav-icon { background: #fdf0eb; color: var(--salmon); }

/* Shared page sections */
.page-main {
  flex: 1;
  width: 100%;
  background:
    linear-gradient(135deg, rgba(234, 247, 246, 0.72) 0%, rgba(240, 251, 249, 0.55) 50%, rgba(254, 246, 241, 0.72) 100%),
    radial-gradient(ellipse at 80% 20%, rgba(90, 172, 167, 0.18) 0%, transparent 55%),
    radial-gradient(ellipse at 10% 80%, rgba(179, 86, 50, 0.08) 0%, transparent 50%),
    var(--bg-light);
  padding: 56px 0 80px;
  position: relative;
  overflow-x: clip;
}

.page-inner {
  position: relative;
  width: 100%;
  min-width: 0;
}

.page-main::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 50%, rgba(61, 139, 133, 0.06) 0%, transparent 40%),
    radial-gradient(circle at 80% 30%, rgba(61, 139, 133, 0.04) 0%, transparent 35%);
  pointer-events: none;
}

.breadcrumb {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--teal-dark);
  margin-bottom: 24px;
}

.breadcrumb svg { flex-shrink: 0; }

.section-label {
  display: inline-block;
  background: var(--teal-pale);
  color: var(--teal-dark);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 5px 14px;
  border-radius: 50px;
  margin-bottom: 16px;
}

/* Compact 3-line list page header: back|category / title|summary|actions / filters */
.page-list-header {
  margin-bottom: 10px;
}

.page-list-header-row {
  display: flex;
  align-items: center;
  gap: 12px 16px;
}

.page-list-header-row--meta {
  justify-content: space-between;
  margin-bottom: 6px;
}

.page-list-back.breadcrumb {
  margin-bottom: 0;
}

.page-list-category.section-label {
  margin-bottom: 0;
}

.page-list-header-row--title {
  display: grid;
  grid-template-columns: minmax(140px, 22%) minmax(0, 1fr);
  gap: 8px 20px;
  align-items: start;
  margin-bottom: 10px;
}

.page-list-title {
  margin: 0;
  font-size: clamp(1.35rem, 2.4vw, 1.9rem);
  font-weight: 800;
  line-height: 1.15;
  color: var(--text);
}

.page-list-summary {
  min-width: 0;
}

.page-list-lead {
  margin: 0 0 3px;
  font-size: 0.86rem;
  line-height: 1.4;
  color: var(--text-muted);
}

.page-list-permission {
  margin: 0;
  font-size: 0.78rem;
}

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

.page-list-header-row--toolbar {
  justify-content: flex-start;
}

.page-list-filters {
  margin-bottom: 14px;
}

.page-list-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 14px;
}

.page-list-toolbar .inline-form {
  display: inline-flex;
}

.page-sticky-top .page-list-toolbar {
  margin-bottom: 0;
}

.page-sticky-top .page-list-header {
  margin-bottom: 8px;
}

.page-sticky-top .page-list-filters {
  margin-bottom: 0;
}

.page-sticky-top .admin-nav {
  margin: 0 0 10px;
}

@media (max-width: 900px) {
  .page-list-header-row--title {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .page-list-header-row--meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
}

.page-hero {
  max-width: 760px;
  margin-bottom: 40px;
}

.page-hero-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.page-hero-head .module-icon {
  margin-bottom: 0;
}

.page-hero h1 {
  font-size: clamp(1.9rem, 4vw, 2.8rem);
  font-weight: 800;
  line-height: 1.15;
  color: var(--text);
  margin-bottom: 16px;
}

.page-hero h1 span { color: var(--teal); }

.page-lead {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 640px;
}

.module-icon {
  width: 64px;
  height: 64px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--teal);
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

/* Card grids — 4 columns on wide screens */
.functions,
.capability-grid,
.operations-dashboard-links {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.functions {
  text-align: left;
}

.function-card {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s, transform 0.2s, border-color 0.2s;
}

.function-card:hover {
  box-shadow: 0 8px 32px rgba(42, 107, 101, 0.14);
  transform: translateY(-3px);
  border-color: var(--teal-light);
}

.function-card:focus-visible { outline: 3px solid var(--teal-light); outline-offset: 2px; }

.function-icon {
  width: 52px;
  height: 52px;
  background: var(--teal-pale);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  color: var(--teal);
}

.function-card h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.function-card p {
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.55;
  flex: 1;
  margin-bottom: 16px;
}

.function-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--teal-dark);
}

.function-card:hover .function-link svg { transform: translateX(3px); }
.function-link svg { transition: transform 0.2s; }

.operations-dashboard-action-card {
  cursor: default;
}

.operations-dashboard-action-card:hover {
  transform: none;
}

.operations-dashboard-action-form {
  margin-top: auto;
  padding-top: 12px;
}

.operations-dashboard-action-form .btn-primary {
  width: 100%;
  justify-content: center;
}

.operations-dashboard-action-form .btn-primary[disabled] {
  opacity: 0.7;
  cursor: wait;
}

.operations-dashboard-action-note {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin-bottom: 0;
}

.links-category-section { margin-top: 32px; }
.links-category-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.links-card { display: flex; flex-direction: column; }
.links-card h3 a { color: inherit; text-decoration: none; }
.links-card h3 a:hover { color: var(--teal-dark); }
.links-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.links-card-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: auto;
  padding-top: 12px;
}

.hero-inner { max-width: 1000px; margin: 0 auto; text-align: center; }
.hero-inner .page-lead { margin: 0 auto 48px; }

.portal-function-groups {
  display: flex;
  flex-direction: column;
  gap: 36px;
  text-align: left;
}

.portal-function-group {
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  padding: 28px 28px 32px;
  box-shadow: var(--shadow);
}

.portal-function-group--supply-chain {
  border-top: 4px solid var(--teal);
  background: linear-gradient(180deg, var(--teal-pale) 0%, var(--white) 140px);
}

.portal-function-group--admin {
  border-top: 4px solid var(--salmon);
  background: linear-gradient(180deg, #faf6f3 0%, var(--white) 140px);
}

.portal-function-group__header {
  margin-bottom: 24px;
  max-width: 720px;
}

.portal-function-group__title {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
}

.portal-function-group__desc {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.portal-function-group .functions {
  margin-bottom: 0;
}

.hero-inner h1 {
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 800;
  line-height: 1.15;
  color: var(--text);
  margin-bottom: 20px;
}

.capability-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.capability-card h3 {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.capability-card p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.demand-summary-card,
.forecast-plan-card {
  grid-column: 1 / -1;
}

.demand-summary-card-head,
.forecast-plan-card-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.demand-summary-head-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

.demand-summary-meta,
.forecast-plan-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  font-size: 0.84rem;
  color: var(--text-muted);
}

.demand-summary-meta strong,
.forecast-plan-meta strong {
  color: var(--text);
}

.demand-summary-filter,
.forecast-plan-filter {
  margin-bottom: 20px;
}

.demand-summary-table th,
.demand-summary-table td,
.forecast-plan-table th,
.forecast-plan-table td {
  white-space: nowrap;
}

.site-doc-section {
  margin-bottom: 24px;
}

.site-doc-section h2 {
  margin-bottom: 12px;
}

.site-doc-module-group {
  margin-top: 24px;
}

.site-doc-module-group h3 {
  margin-bottom: 8px;
}

.site-doc-module-group h3 a {
  color: var(--teal-dark);
  text-decoration: none;
}

.site-doc-module-group h3 a:hover {
  text-decoration: underline;
}

.site-doc-subheading {
  margin: 20px 0 10px;
  font-size: 1rem;
}

.site-doc-list {
  margin: 12px 0 0 18px;
  color: var(--text-muted);
  line-height: 1.6;
}

.site-doc-list li + li {
  margin-top: 6px;
}

.site-doc-path {
  margin-top: 8px;
}

.site-doc-table code {
  font-size: 0.82rem;
}

.site-doc-note + .site-doc-note {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.site-doc-note h3 {
  margin-bottom: 6px;
  font-size: 0.95rem;
}

.site-doc-note p {
  color: var(--text-muted);
  line-height: 1.55;
}

.site-doc-expand {
  margin-top: 12px;
}

.site-doc-expand > summary {
  cursor: pointer;
  color: var(--teal-dark);
  font-weight: 600;
  font-size: 0.92rem;
  list-style: none;
}

.site-doc-expand > summary::-webkit-details-marker {
  display: none;
}

.site-doc-expand > summary::before {
  content: '…more ';
}

.site-doc-expand[open] > summary::before {
  content: '…less ';
}

.site-doc-expand > summary:hover {
  text-decoration: underline;
}

.site-doc-expand > .admin-table-wrap,
.site-doc-expand > .site-doc-list,
.site-doc-expand > .site-doc-note {
  margin-top: 12px;
}

.module-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 36px;
}

a.btn-primary,
a.btn-secondary,
button.btn-primary,
button.btn-secondary,
button.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.92rem;
  font-weight: 700;
  padding: 12px 24px;
  border-radius: 50px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  line-height: 1.2;
  transition: background 0.15s, transform 0.15s, color 0.15s;
}

.btn-primary {
  background: var(--salmon);
  color: var(--white);
}

.btn-primary:hover { background: var(--salmon-dark); transform: translateY(-1px); }

.btn-secondary {
  background: var(--white);
  color: var(--teal-dark);
  border: 2px solid var(--teal-dark);
}

.btn-secondary:hover { background: var(--teal-dark); color: var(--white); }

button.btn-danger,
a.btn-danger {
  background: var(--danger);
  color: var(--white);
}

button.btn-danger:hover,
a.btn-danger:hover { background: var(--danger-dark); transform: translateY(-1px); }

.status-banner {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: var(--white);
  border: 1px solid var(--border);
  border-left: 4px solid var(--teal);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-top: 32px;
  box-shadow: var(--shadow);
}

.status-banner strong {
  display: block;
  font-size: 0.92rem;
  margin-bottom: 4px;
}

.status-banner p {
  font-size: 0.86rem;
  color: var(--text-muted);
}

.permission-note {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--teal-dark);
  margin-top: 12px;
}

.auth-prompt {
  margin: 24px 0 32px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.auth-prompt-note,
.auth-welcome {
  font-size: 0.92rem;
  color: var(--text-muted);
}

.auth-welcome { margin: 8px 0 24px; }

.auth-card {
  max-width: 440px;
  margin: 0 auto;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
}

.auth-card h1 {
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 10px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 24px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--teal-dark);
}

.form-input {
  font: inherit;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--white);
  color: var(--text);
}

.form-input:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(61, 139, 133, 0.15);
}

.auth-submit { width: 100%; justify-content: center; border: none; }

.auth-error {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #fdf0eb;
  border: 1px solid #f0cdbf;
  color: var(--salmon-dark);
  font-size: 0.88rem;
  font-weight: 600;
}

.auth-success {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #edf7f4;
  border: 1px solid #c5e3dc;
  color: var(--teal-dark);
  font-size: 0.88rem;
  font-weight: 600;
}

.form-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.auth-inline-link {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--teal);
  text-decoration: none;
}

.auth-inline-link:hover {
  text-decoration: underline;
}

.auth-hint {
  margin: -6px 0 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.auth-footnote {
  margin-top: 20px;
  font-size: 0.86rem;
  color: var(--text-muted);
}

.auth-footnote a {
  color: var(--teal-dark);
  font-weight: 600;
}

.account-grid,
.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  width: 100%;
  min-width: 0;
}

.detail-grid-stacked {
  grid-template-columns: minmax(0, 1fr);
}

.detail-grid-stacked .detail-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px 24px;
}

.delivery-appointment-asn-panel {
  margin-top: 24px;
}

.delivery-appointment-asn-panel .detail-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px 24px;
}

.delivery-appointment-asn-panel .admin-table-wrap {
  max-width: 100%;
}

.delivery-appointment-asn-panel .detail-card h3 {
  font-size: 1rem;
  margin: 0 0 14px;
}

.detail-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  min-width: 0;
  max-width: 100%;
}

.detail-card h2 {
  font-size: 1.1rem;
  margin-bottom: 16px;
}

.detail-card-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 16px;
  margin-bottom: 16px;
}

.detail-card-header h2 {
  margin-bottom: 4px;
}

.detail-card-header .form-hint {
  margin: 0;
}

.detail-card--follow {
  margin-top: 28px;
}

.jazz-order-lines {
  margin-top: 24px;
}

.jazz-order-lines-table tbody td {
  color: var(--text);
  font-weight: 500;
}

.jazz-order-lines-table .jazz-order-line-product {
  font-weight: 600;
  color: var(--text);
}

.jazz-order-lines-table .jazz-order-line-sku {
  font-family: ui-monospace, monospace;
  font-size: 0.88rem;
}

.supplier-po-report {
  margin-top: 28px;
}

.supplier-po-report .page-lead {
  margin-bottom: 16px;
  font-size: 0.95rem;
}

.po-lifecycle-bar {
  margin: 0 0 24px;
}

.po-lifecycle-bar-wrap {
  overflow-x: auto;
}

.po-lifecycle-table {
  width: 100%;
  min-width: 1120px;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 0.78rem;
}

.po-lifecycle-table th,
.po-lifecycle-table td {
  border: 1px solid var(--border);
  vertical-align: middle;
}

.po-lifecycle-step-header {
  padding: 10px 8px;
  text-align: center;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.35;
  color: var(--text-muted);
  background: #e5e7eb;
}

.po-lifecycle-step-header.is-complete {
  background: #d1fae5;
  color: #065f46;
}

.po-lifecycle-step-header.is-pending,
.po-lifecycle-step-header.is-not-applicable {
  background: #e5e7eb;
  color: var(--text-muted);
}

.po-lifecycle-step-date {
  padding: 10px 8px;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  background: var(--white);
}

.po-lifecycle-na {
  color: var(--text-muted);
  font-weight: 500;
}

.page-inner--wide .admin-table-wrap {
  overflow-x: auto;
}

.page-inner--wide .admin-table {
  min-width: 960px;
}

.page-inner--wide .production-status-table {
  min-width: 880px;
}

.admin-table-wrap--catalog {
  overflow-x: auto;
  max-width: 100%;
}

.admin-table--catalog {
  width: max-content;
  max-width: 100%;
  table-layout: auto;
  font-size: 0.82rem;
}

.admin-table--catalog th,
.admin-table--catalog td {
  padding: 5px 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-table--catalog th {
  font-size: 0.68rem;
  letter-spacing: 0.03em;
  padding-top: 6px;
  padding-bottom: 6px;
}

.admin-table--catalog .admin-table-sort-link {
  gap: 2px;
}

.admin-table--catalog .catalog-col-product-name {
  max-width: 25ch;
}

.admin-table--catalog .catalog-col-srv,
.admin-table--catalog .catalog-col-cap {
  width: 1%;
  min-width: 3.75rem;
  padding-left: 4px;
  padding-right: 4px;
  text-align: center;
}

.admin-table--catalog th.catalog-col-srv,
.admin-table--catalog th.catalog-col-cap {
  overflow: visible;
}

.admin-table--catalog .catalog-col-whsle {
  width: 1%;
  min-width: 9ch;
}

.admin-table--catalog .catalog-col-actions,
.admin-table--catalog td.table-actions {
  width: 1%;
  min-width: 11ch;
}

.admin-table--catalog th:last-child,
.admin-table--catalog td.table-actions {
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
}

.detail-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.detail-list dt {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.detail-list dd {
  font-size: 0.95rem;
  font-weight: 600;
  min-width: 0;
}

.detail-list dd.is-prose {
  font-weight: 400;
  white-space: pre-wrap;
  line-height: 1.55;
}

.detail-list dd .detail-external-link {
  display: inline-block;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.detail-list-inline {
  gap: 10px;
}

.detail-list-inline > div {
  display: grid;
  grid-template-columns: minmax(8.5rem, 10.5rem) minmax(0, 1fr);
  gap: 6px 12px;
  align-items: baseline;
}

.detail-list-inline dt {
  margin-bottom: 0;
  text-transform: none;
  letter-spacing: normal;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
}

.detail-list-inline dt::after {
  content: ':';
}

.detail-list-inline dd {
  font-size: 0.95rem;
  font-weight: 600;
}

.detail-card .detail-list-inline > div {
  grid-template-columns: minmax(9.5rem, 11.5rem) minmax(0, 1fr);
}

.detail-card .detail-list-inline dd {
  font-weight: 500;
  overflow-wrap: anywhere;
}

.detail-grid-order-contacts {
  align-items: start;
}

.detail-grid-order-contacts .detail-grid-stack {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

.account-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.account-card h2 {
  font-size: 1.1rem;
  margin-bottom: 16px;
}

.account-card-lead {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.account-details {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.account-details dt {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.account-details dd {
  font-size: 0.95rem;
  font-weight: 600;
}

/* PO view: compact label–value rows to keep line items visible above the fold */
.po-summary-grid {
  gap: 12px;
}

.po-summary-grid .account-card {
  padding: 14px 16px;
}

.po-summary-grid .account-card h2 {
  font-size: 0.95rem;
  margin-bottom: 8px;
}

.po-summary-grid .account-details {
  gap: 5px;
}

.po-summary-grid .account-details > div {
  display: grid;
  grid-template-columns: 6.75rem minmax(0, 1fr);
  gap: 0 10px;
  align-items: baseline;
}

.po-summary-grid .account-details dt {
  margin-bottom: 0;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-transform: none;
  color: var(--text-muted);
}

.po-summary-grid .account-details dt::after {
  content: ':';
}

.po-summary-grid .account-details dd {
  font-size: 0.86rem;
  font-weight: 500;
  margin: 0;
  line-height: 1.35;
}

.po-summary-grid .account-details dd strong {
  font-weight: 700;
}

.account-grid-span-full {
  grid-column: 1 / -1;
}

.po-summary-grid .account-grid-span-full .account-details > div {
  grid-template-columns: 10rem minmax(0, 1fr);
}

.po-summary-grid .account-details dd.is-prose {
  font-weight: 400;
  line-height: 1.55;
}

.po-summary-grid .account-details dd .detail-external-link {
  display: inline-block;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.sku-summary-grid {
  gap: 12px;
}

.sku-summary-grid .detail-card {
  padding: 14px 16px;
}

.sku-summary-grid .detail-card h2 {
  font-size: 0.95rem;
  margin-bottom: 8px;
}

.sku-summary-grid .detail-list-inline {
  gap: 5px;
}

.sku-summary-grid .detail-list-inline > div {
  grid-template-columns: 6.75rem minmax(0, 1fr);
  gap: 0 10px;
}

.sku-summary-grid .detail-list-inline dt {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.sku-summary-grid .detail-list-inline dd {
  font-size: 0.86rem;
  font-weight: 500;
}

.form-actions-bar--top {
  margin-top: 0;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.form-actions-bar--bottom {
  margin-top: 24px;
}

.permission-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.permission-table th,
.permission-table td {
  text-align: left;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.permission-table th {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.permission-badge {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 50px;
  font-size: 0.78rem;
  font-weight: 700;
}

.permission-badge.is-granted {
  background: var(--teal-pale);
  color: var(--teal-dark);
}

.permission-badge.is-denied {
  background: #f4f4f4;
  color: var(--text-muted);
}

.admin-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 20px 0 28px;
}

.admin-nav a {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 50px;
  border: 1px solid var(--border);
  background: var(--white);
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--teal-dark);
}

.admin-nav a:hover,
.admin-nav a.is-active {
  background: var(--teal-pale);
}

.admin-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.admin-header h1 {
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  font-weight: 800;
  margin-bottom: 8px;
}

.admin-notice {
  margin-bottom: 20px;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 600;
}

.admin-notice.is-success {
  background: var(--teal-pale);
  border: 1px solid var(--border);
  color: var(--teal-dark);
}

.admin-notice.is-error {
  background: #fdf0eb;
  border: 1px solid #f0cdbf;
  color: var(--salmon-dark);
}

.admin-notice.is-detail {
  font-weight: 500;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.approval-actions-card {
  margin-bottom: 20px;
}

.approval-action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--salmon);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  vertical-align: middle;
}

.status-banner-approval {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.admin-table-wrap {
  overflow-x: auto;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.admin-table th,
.admin-table td {
  text-align: left;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.admin-table th {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--bg-light);
}

.admin-table-sort {
  white-space: nowrap;
}

.admin-table-sort-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

.admin-table-sort-link:hover,
.admin-table-sort-link.is-active {
  color: var(--teal-dark);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.admin-table-sort-indicator {
  font-size: 0.68rem;
  line-height: 1;
  opacity: 0.75;
}

.admin-table-sort-link.is-active .admin-table-sort-indicator {
  opacity: 1;
}

.admin-table tbody tr:last-child td { border-bottom: none; }

.admin-table tbody tr.is-inventory-mismatch td {
  background: #fff5f0;
}

.admin-table-wrap--process-log {
  overflow-x: visible;
}

.admin-table--process-log {
  table-layout: fixed;
  font-size: 0.78rem;
}

.admin-table--process-log th,
.admin-table--process-log td {
  padding: 8px 10px;
}

.admin-table--process-log th:nth-child(1),
.admin-table--process-log td:nth-child(1) { width: 4%; }
.admin-table--process-log th:nth-child(2),
.admin-table--process-log td:nth-child(2) { width: 14%; }
.admin-table--process-log th:nth-child(3),
.admin-table--process-log td:nth-child(3),
.admin-table--process-log th:nth-child(4),
.admin-table--process-log td:nth-child(4),
.admin-table--process-log th:nth-child(7),
.admin-table--process-log td:nth-child(7) { width: 7%; }
.admin-table--process-log th:nth-child(5),
.admin-table--process-log td:nth-child(5),
.admin-table--process-log th:nth-child(6),
.admin-table--process-log td:nth-child(6) { width: 5%; }
.admin-table--process-log th:nth-child(8),
.admin-table--process-log td:nth-child(8) { width: 7%; }
.admin-table--process-log th:nth-child(9),
.admin-table--process-log td:nth-child(9) { width: 7%; }
.admin-table--process-log th:nth-child(10),
.admin-table--process-log td:nth-child(10) { width: 28%; }
.admin-table--process-log th:nth-child(11),
.admin-table--process-log td:nth-child(11) { width: 6%; }

.admin-table--process-log .process-log-datetime {
  white-space: nowrap;
  font-size: 0.74rem;
}

.admin-table--process-log .permission-note {
  font-size: 0.68rem;
  line-height: 1.3;
}

.admin-table--process-log .process-log-result {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  word-break: break-word;
  line-height: 1.35;
  font-size: 0.72rem;
}

.admin-table--process-log .process-log-result.is-error {
  color: var(--error, #c0392b);
}

.admin-table--process-log .status-badge {
  font-size: 0.68rem;
  padding: 3px 8px;
}

.admin-table--process-log .btn-small {
  font-size: 0.72rem;
  padding: 4px 10px;
}

.admin-perm-summary {
  max-width: 420px;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.table-actions {
  white-space: nowrap;
}

.table-actions a,
.table-actions .table-action-btn {
  color: var(--text);
  text-decoration: none;
  font-weight: 400;
  font-size: inherit;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

.table-actions a:hover,
.table-actions .table-action-btn:hover {
  color: var(--teal-dark);
  text-decoration: underline;
}

.table-actions .table-action-btn-danger:hover {
  color: var(--salmon-dark);
}

.table-action-form {
  display: inline;
}

.table-name-link {
  color: var(--link-blue);
  font-weight: 500;
  text-decoration: none;
}

.table-name-link:hover {
  color: var(--link-blue-hover);
  text-decoration: underline;
}

.operations-dashboard-section {
  margin-top: 36px;
}

.operations-dashboard-section-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--teal-dark);
  margin: 0 0 16px;
}

.operations-dashboard-other-links .page-lead {
  margin-bottom: 16px;
}

.planner-launch-banner {
  align-items: center;
}

.planner-launch-note {
  margin-top: 16px;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.btn-text {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--teal-dark);
  background: none;
  border: none;
  padding: 0;
}

.btn-text:hover { color: var(--teal); }

.btn-text-danger { color: var(--salmon-dark); }
.btn-text-danger:hover { color: var(--salmon); }

.inline-form { display: inline; }

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
}

.visually-hidden-form {
  display: none;
}

.admin-form {
  max-width: 900px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.admin-form-subhead {
  font-size: 1.05rem;
  margin: 24px 0 8px;
}

.form-section-title {
  font-size: 1.05rem;
  margin: 24px 0 8px;
}

.form-hint {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 6px;
}

.form-textarea { min-height: 96px; resize: vertical; }

.admin-meta { margin-top: 8px; }

.capability-card-link {
  display: block;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.capability-card-link:hover {
  border-color: var(--teal-light);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.capability-card-static {
  cursor: default;
}

.function-link-muted {
  color: var(--text-muted);
}

.permission-grid {
  margin-top: 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.permission-grid-head,
.permission-grid-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) repeat(4, minmax(72px, 1fr));
  gap: 8px;
  align-items: center;
  padding: 12px 14px;
}

.permission-grid-head {
  background: var(--bg-light);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.permission-grid-row {
  border-top: 1px solid var(--border);
  font-size: 0.86rem;
}

.permission-grid-label { font-weight: 600; }

.perm-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.perm-check input { accent-color: var(--teal); }

.perm-readonly {
  display: inline-flex;
  min-width: 36px;
  justify-content: center;
  font-weight: 700;
  color: var(--text-muted);
}

.perm-readonly.is-on {
  color: var(--teal-dark);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.form-grid-full {
  grid-column: 1 / -1;
}

.production-status-card {
  margin-top: 20px;
}

.production-status-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.production-status-header h2 {
  margin-bottom: 4px;
}

.production-status-header .account-card-lead {
  margin-bottom: 0;
}

.production-status-table-wrap {
  overflow-x: auto;
}

.production-status-table {
  font-size: 0.86rem;
}

.production-status-table th,
.production-status-table td {
  white-space: nowrap;
}

.production-status-table td:nth-child(2) {
  white-space: normal;
  min-width: 160px;
  max-width: 220px;
}

.production-product-cell {
  display: block;
}

.production-product-sku {
  display: block;
  font-size: 0.82rem;
}

.production-status-table td:nth-child(3) {
  min-width: 100px;
}

.production-comments-cell {
  white-space: normal;
  min-width: 120px;
  max-width: 180px;
}

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

.production-line-block:first-of-type {
  border-top: none;
  padding-top: 0;
}

.production-line-header {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: baseline;
  margin-bottom: 14px;
  font-size: 0.92rem;
}

.production-line-grid {
  margin-bottom: 0;
}

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

.production-comments {
  margin-top: 12px;
  font-size: 0.9rem;
}

.production-meta {
  margin-top: 10px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

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

.po-filter label {
  display: block;
  margin-bottom: 4px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--teal-dark);
}

.po-filter .form-input {
  min-width: 0;
  width: 100%;
}

.audit-filter {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 16px;
}

.audit-filter-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 16px;
  flex: 1 1 auto;
  min-width: min(100%, 280px);
}

.audit-filter-grid > div {
  flex: 0 1 180px;
  min-width: 140px;
}

.audit-filter-wide {
  flex: 1 1 220px;
  min-width: 180px;
  max-width: 420px;
}

.audit-filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 0;
  flex-shrink: 0;
  align-items: center;
}

/* List pages: title, notices, and filters stay below the site header while the table scrolls */
.page-sticky-top {
  position: sticky;
  top: var(--site-top-chrome-height, 69px);
  z-index: 90;
  padding-top: 4px;
  padding-bottom: 14px;
  margin-bottom: 12px;
  background:
    linear-gradient(135deg, rgba(234, 247, 246, 0.97) 0%, rgba(240, 251, 249, 0.95) 50%, rgba(254, 246, 241, 0.97) 100%);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 8px 16px rgba(42, 107, 101, 0.06);
}

.page-sticky-top .breadcrumb {
  margin-bottom: 10px;
}

.page-sticky-top .page-list-header-row--meta {
  margin-bottom: 4px;
}

.page-sticky-top .page-list-header-row--title {
  margin-bottom: 8px;
}

.page-sticky-top .admin-header {
  margin-bottom: 14px;
}

.page-sticky-top .admin-notice,
.page-sticky-top .status-banner {
  margin-bottom: 12px;
}

.page-sticky-top .admin-nav {
  margin-bottom: 12px;
}

.page-sticky-top .audit-filter,
.page-sticky-top .po-filter {
  margin-bottom: 0;
}

.audit-sql-preview {
  display: block;
  font-size: 0.78rem;
  white-space: normal;
  word-break: break-word;
}

.audit-sql-block {
  margin: 0;
  padding: 14px;
  background: #f6f8f9;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.82rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-x: auto;
}

.po-lines-section { margin-top: 24px; }

.po-lines-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.po-lines-header h2 {
  font-size: 1.05rem;
}

.btn-small {
  padding: 8px 16px;
  font-size: 0.82rem;
}

.po-lines-table .form-input {
  width: 100%;
  min-width: 0;
  padding: 8px 10px;
}

.empty-cell {
  text-align: center;
  color: var(--text-muted);
  padding: 28px 16px !important;
}

.status-badge {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 50px;
  font-size: 0.78rem;
  font-weight: 700;
}

.status-draft {
  background: #f4f4f4;
  color: var(--text-muted);
}

.status-submitted {
  background: #fff4e5;
  color: #9a5b00;
}

.status-approved {
  background: var(--teal-pale);
  color: var(--teal-dark);
}

.status-received {
  background: #e8f2ff;
  color: #1f4f8f;
}

.status-cancelled {
  background: #fdf0eb;
  color: var(--salmon-dark);
}

.text-error {
  color: var(--salmon-dark);
}

.import-steps {
  margin: 12px 0 16px 18px;
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.6;
}

.import-steps li { margin-bottom: 8px; }

.support-thread {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.support-comment {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  background: #fff;
}

.support-comment.is-internal {
  background: #faf7f2;
  border-color: #eadfce;
}

.support-comment-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 10px;
  font-size: 0.86rem;
  color: var(--text-muted);
}

.support-comment-head strong {
  color: var(--text);
  font-size: 0.92rem;
}

.support-comment-body {
  line-height: 1.55;
  font-size: 0.94rem;
}

.support-comment-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 14px 0 10px;
}

.support-comment-body p {
  margin: 0 0 10px;
}

.support-comment-body p:last-child {
  margin-bottom: 0;
}

.support-comment-body p strong {
  color: var(--text-muted);
  font-weight: 700;
}

.support-comment-body hr + p {
  font-size: 0.86rem;
  color: var(--text-muted);
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 28px;
  font-size: 0.92rem;
}

/* Footer */
.site-footer {
  background: linear-gradient(135deg, var(--teal-dark) 0%, var(--teal) 100%);
  padding: 28px 24px;
  text-align: center;
}

.site-footer p { font-size: 0.85rem; color: rgba(255, 255, 255, 0.85); }
.site-footer strong { color: var(--white); font-weight: 600; }
.site-footer a { color: rgba(255, 255, 255, 0.9); text-decoration: underline; }
.site-footer a:hover { color: var(--white); }

.legal-document { max-width: 820px; }
.legal-prose { color: var(--text); line-height: 1.7; }
.legal-prose h2 {
  margin: 2rem 0 0.75rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
}
.legal-prose p,
.legal-prose ul { margin: 0 0 1rem; }
.legal-prose ul { padding-left: 1.25rem; }
.legal-prose li { margin-bottom: 0.35rem; }
.legal-prose a { color: var(--teal-dark); font-weight: 600; }

@media (max-width: 1400px) {
  .capability-grid--six { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 1100px) {
  .functions,
  .capability-grid,
  .operations-dashboard-links { grid-template-columns: repeat(3, 1fr); }
  .capability-grid--six { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 900px) {
  .functions,
  .capability-grid,
  .operations-dashboard-links { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .audit-filter {
    flex-direction: column;
    align-items: stretch;
  }

  .audit-filter-grid {
    width: 100%;
  }

  .audit-filter-wide {
    max-width: none;
  }

  .audit-filter-actions {
    width: 100%;
  }
}

@media (max-width: 600px) {
  .page-main { padding: 40px 0 56px; }
  .portal-function-group {
    padding: 20px 18px 24px;
  }
  .portal-function-groups {
    gap: 28px;
  }
  .functions,
  .capability-grid,
  .operations-dashboard-links,
  .account-grid,
  .detail-grid,
  .production-read-grid { grid-template-columns: 1fr; }
  .admin-header { flex-direction: column; }
  .permission-grid-head,
  .permission-grid-row,
  .form-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .ops-badge,
  .header-dashboard-title { display: none; }
  .header-login-link,
  .header-user { display: none; }
  .module-actions { flex-direction: column; }
  .btn-primary,
  .btn-secondary,
  .btn-danger { justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  .function-card,
  .function-link svg,
  .nav-panel,
  .nav-overlay,
  .btn-primary,
  .btn-secondary,
  .btn-danger { transition: none; }
  .function-card:hover,
  .btn-primary:hover,
  .btn-danger:hover { transform: none; }
}

/* PO printable view */
body.po-print-page {
  display: block;
  background: #fff;
}

.po-print-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-light);
  position: sticky;
  top: var(--site-top-chrome-height, 69px);
  z-index: 10;
}

.po-print-shell {
  max-width: 900px;
  margin: 0 auto;
  padding: 32px 24px 48px;
}

.po-print-document {
  color: #111;
  font-size: 0.92rem;
  line-height: 1.5;
}

.po-print-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 2px solid #222;
}

.po-print-doc-type {
  margin-top: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.po-print-po-number {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.po-print-meta p {
  margin: 2px 0;
  font-size: 0.88rem;
}

.po-print-parties {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

.po-print-party h2,
.po-print-lines h2,
.po-print-notes h2 {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.po-print-party-name {
  font-weight: 700;
  margin-bottom: 6px;
}

.po-print-party p {
  margin: 0 0 4px;
}

.po-print-terms {
  margin-bottom: 24px;
  padding: 16px;
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.po-print-terms-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 24px;
  font-size: 0.88rem;
}

.po-print-lines {
  margin-bottom: 20px;
}

.po-print-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}

.po-print-table th,
.po-print-table td {
  border: 1px solid #ccc;
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}

.po-print-table th {
  background: #f3f3f3;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.po-print-table td:nth-child(4),
.po-print-table td:nth-child(6),
.po-print-table td:nth-child(7),
.po-print-table th:nth-child(4),
.po-print-table th:nth-child(6),
.po-print-table th:nth-child(7) {
  text-align: right;
  white-space: nowrap;
}

.po-print-totals {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 24px;
}

.po-print-totals-list {
  min-width: 260px;
}

.po-print-totals-list div {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 6px 0;
  border-bottom: 1px solid #e5e5e5;
}

.po-print-totals-list dt {
  font-weight: 600;
}

.po-print-totals-list dd {
  font-weight: 700;
  text-align: right;
}

.po-print-total-due {
  border-top: 2px solid #222;
  margin-top: 4px;
  padding-top: 10px !important;
  font-size: 1rem;
}

.po-print-notes {
  margin-bottom: 20px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.po-print-footer {
  margin-top: 32px;
  padding-top: 12px;
  border-top: 1px solid #ddd;
  font-size: 0.78rem;
  color: var(--text-muted);
}

@media print {
  .no-print,
  .po-print-toolbar {
    display: none !important;
  }

  body.po-print-page {
    background: #fff;
  }

  .po-print-shell {
    max-width: none;
    padding: 0;
    margin: 0;
  }

  .po-print-terms,
  .po-print-notes {
    background: #fff;
    break-inside: avoid;
  }

  .po-print-table {
    break-inside: auto;
  }

  .po-print-table tr {
    break-inside: avoid;
  }
}

@media (max-width: 720px) {
  .po-print-header,
  .po-print-parties,
  .po-print-terms-grid {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .po-print-header {
    display: block;
  }

  .po-print-meta {
    margin-top: 16px;
  }
}

/* Travel & Expense print (mirrors PO print layout) */
body.te-print-page {
  display: block;
  background: #fff;
}

.te-print-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-light);
}

.te-print-shell {
  max-width: 900px;
  margin: 0 auto;
  padding: 32px 24px 48px;
}

.te-print-company {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  margin: 0 0 4px;
}

.te-expense-table-wrap {
  overflow-x: auto;
}

.te-expense-table .te-line-input {
  min-width: 72px;
  font-size: 0.82rem;
  padding: 6px 8px;
}

.te-report-form .form-static {
  margin: 0;
  font-weight: 600;
}

@media print {
  .te-print-toolbar {
    display: none !important;
  }

  body.te-print-page {
    background: #fff;
  }

  .te-print-shell {
    max-width: none;
    padding: 0;
    margin: 0;
  }
}

@media (max-width: 768px) {
  .te-print-header,
  .te-print-parties {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .te-print-header {
    display: block;
  }

  .te-print-meta {
    margin-top: 16px;
  }
}

.operations-dashboard-section .hub-uat-section-title {
  margin: 28px 0 12px;
}

.function-card.card-tier-production,
.function-card.card-tier-uat,
.function-card.card-tier-external,
.function-card.card-tier-hub {
  border-width: 1px;
  border-style: solid;
}

.card-tier-hub,
.capability-card.card-tier-hub {
  background: #e8ede6;
  border-color: #c5d4c0;
}

.card-tier-production,
.capability-card.card-tier-production {
  background: #e8f5e9;
  border-color: #b9dcc0;
}

.card-tier-uat,
.capability-card.card-tier-uat {
  background: #fdecea;
  border-color: #f0c4bf;
}

.card-tier-external,
.capability-card.card-tier-external {
  background: #f0f0f0;
  border-color: #d8d8d8;
}

.uat-environment-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0;
  padding: 12px 16px;
  background: #fdecea;
  border: 1px solid #e57373;
  border-left: 4px solid #c62828;
  border-radius: var(--radius);
  color: #7f1d1d;
  font-size: 0.92rem;
}

.uat-environment-banner-wrap {
  background: #fff5f5;
  border-bottom: 1px solid #f0c4bf;
  padding: 12px 0;
}

.uat-environment-banner strong {
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.capability-grid--six {
  grid-template-columns: repeat(6, 1fr);
}

.hub-section-title {
  margin: 28px 0 4px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hub-production-section-title {
  color: #2e7d32;
}

.hub-uat-section-title {
  grid-column: 1 / -1;
  margin: 28px 0 4px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #c62828;
}

.enh-log-paste-zone {
  margin-top: 16px;
  padding: 20px;
  border: 2px dashed var(--border, #d9dee7);
  border-radius: 10px;
  background: var(--surface-muted, #f7f8fa);
  color: var(--text-muted, #5c6578);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.enh-log-paste-zone:hover,
.enh-log-paste-zone:focus,
.enh-log-paste-zone.is-dragover {
  outline: none;
  border-color: var(--teal, #2a9d8f);
  background: #eef8f6;
  color: var(--text, #1f2937);
}

.enh-log-paste-zone.is-dragover {
  border-style: solid;
}

.enh-log-upload-dropzone.is-dragover .enh-log-paste-zone {
  border-color: var(--teal, #2a9d8f);
  background: #eef8f6;
  color: var(--text, #1f2937);
  border-style: solid;
}

.enh-log-paste-zone.is-uploading {
  pointer-events: none;
  opacity: 0.7;
}

.enh-log-paste-zone.is-error {
  border-color: #c62828;
  background: #fdecea;
  color: #7f1d1d;
}

.enh-log-paste-zone-title {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  color: inherit;
}

.enh-log-paste-zone-hint {
  display: block;
  font-size: 0.92rem;
}

.enh-log-paste-preview {
  display: block;
  max-width: 240px;
  max-height: 160px;
  margin: 12px auto 0;
  border-radius: 6px;
  border: 1px solid var(--border, #d9dee7);
  object-fit: contain;
}

.enh-log-thumb {
  display: block;
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border, #d9dee7);
}

.enh-log-thumb-missing {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: 6px;
  border: 1px dashed var(--border, #d9dee7);
  font-size: 0.75rem;
  color: var(--text-muted, #5c6578);
}

.enh-log-image-viewer {
  padding: 20px;
  text-align: center;
}

.enh-log-image-full {
  display: block;
  max-width: 100%;
  width: auto;
  height: auto;
  margin: 0 auto;
  border-radius: 8px;
  border: 1px solid var(--border, #d9dee7);
}

