/* Shared CWF identity for access, library, manufacturing and customer screens. */
:root {
  --cwf-ui-blue: #203878;
  --cwf-ui-navy: #142650;
  --cwf-ui-text: #1c2940;
  --cwf-ui-muted: #5d6b80;
  --cwf-ui-line: #dfe5ef;
  --cwf-ui-background: #f5f7fb;
  --cwf-ui-font: "Segoe UI", -apple-system, BlinkMacSystemFont, Arial, sans-serif;
}
body[data-cwf-page], body[data-cwf-page] * { box-sizing: border-box; }
body[data-cwf-page] { font-family: var(--cwf-ui-font); color: var(--cwf-ui-text); font-size: 14px; line-height: 1.5; }
body[data-cwf-page] button, body[data-cwf-page] input, body[data-cwf-page] select, body[data-cwf-page] textarea { font-family: inherit; }
body[data-cwf-page] :focus-visible { outline: 3px solid #769cf2; outline-offset: 3px; }
body[data-cwf-page] img { max-width: 100%; }
body[data-cwf-page] .page { width: 100%; max-width: 1500px; padding: 32px; }
body[data-cwf-page] .heading h1, body[data-cwf-page] .pagehead h1, body[data-cwf-page] .portal-head h1 { font-size: clamp(24px, 2.5vw, 32px); line-height: 1.2; letter-spacing: -.7px; }
body[data-cwf-page] .heading p, body[data-cwf-page] .pagehead p, body[data-cwf-page] .portal-head p { font-size: 14px; line-height: 1.65; max-width: 760px; }
body[data-cwf-page] .top, body[data-cwf-page] .topbar, body[data-cwf-page] .appbar { min-height: 82px; padding: 16px 32px; background: var(--cwf-ui-navy); color: #fff; border: 0; box-shadow: 0 2px 12px #14265012; gap: 20px; }
body[data-cwf-page] .brand { min-width: 0; }
body[data-cwf-page] .brand img, body[data-cwf-page] .appbar-logo { width: 132px; height: 38px; object-fit: contain; object-position: left center; filter: none; flex-shrink: 0; }
body[data-cwf-page] .brand strong, body[data-cwf-page] .appbar-title strong { font-size: 16px; line-height: 1.35; }
body[data-cwf-page] .brand small, body[data-cwf-page] .brand span, body[data-cwf-page] .appbar-title span { font-size: 12px; line-height: 1.5; }
body[data-cwf-page] .top-actions { flex-wrap: wrap; align-items: center; justify-content: flex-end; }
body[data-cwf-page] .top .btn, body[data-cwf-page] .topbar .btn { min-height: 40px; font-size: 13px; }
body[data-cwf-page] .top .btn.dark { background: #ffffff0d; color: #fff; border-color: #ffffff4d; }
body[data-cwf-page] .btn, body[data-cwf-page] .auth-submit { min-height: 42px; font-size: 14px; font-weight: 600; border-radius: 9px; }
body[data-cwf-page] input:not([type="checkbox"]):not([type="radio"]), body[data-cwf-page] select, body[data-cwf-page] textarea { min-height: 44px; font-size: 14px; border-radius: 8px; }
body[data-cwf-page] .form-grid label { font-size: 13px; }
body[data-cwf-page] table { font-size: 13px; line-height: 1.5; }
body[data-cwf-page] th { font-size: 12px; letter-spacing: .03em; }
body[data-cwf-page] td { overflow-wrap: anywhere; }
body[data-cwf-page] .card, body[data-cwf-page] .panel, body[data-cwf-page] .kpi { border-radius: 14px; border-color: var(--cwf-ui-line); }
body[data-cwf-page] .kpi span, body[data-cwf-page] .metric label { font-size: 12px; letter-spacing: .035em; }
body[data-cwf-page] .empty { font-size: 14px; line-height: 1.6; padding: 36px 22px; color: var(--cwf-ui-muted); }
body[data-cwf-page] .error, body[data-cwf-page] .notice, body[data-cwf-page] .alert { font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
body[data-cwf-page] .modal { max-width: 100%; }
.cwf-back-link, .cwf-portal-return, .cwf-module-return { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 42px; padding: 9px 14px; border: 1px solid #d5deec; border-radius: 9px; background: transparent; color: var(--cwf-ui-blue); font: 600 13px/1.4 var(--cwf-ui-font); text-decoration: none; cursor: pointer; }
.cwf-back-link:hover, .cwf-portal-return:hover, .cwf-module-return:hover { background: #edf2fc; }
.cwf-back-link svg, .cwf-portal-return svg, .cwf-module-return svg { width: 16px; height: 16px; }
.cwf-module-header .cwf-module-return { color: #fff; border-color: #ffffff4d; background: #ffffff08; }
.cwf-module-header .cwf-module-return:hover { background: #ffffff18; }
.cwf-module-header a.brand { color: #fff; text-decoration: none; display: flex; align-items: center; gap: 16px; }
.cwf-module-header a.brand strong, .cwf-module-header a.brand small { display: block; }
.cwf-tools-menu { position: relative; }
.cwf-tools-menu summary { list-style: none; cursor: pointer; min-height: 42px; padding: 10px 14px; border: 1px solid #ffffff4d; border-radius: 9px; color: #fff; font-size: 13px; font-weight: 600; }
.cwf-tools-menu summary::after { content: "⌄"; margin-left: 12px; }
.cwf-tools-menu summary::-webkit-details-marker { display: none; }
.cwf-tools-menu > div { position: absolute; z-index: 30; right: 0; top: calc(100% + 8px); width: 250px; border: 1px solid #dfe5ef; border-radius: 11px; background: white; box-shadow: 0 12px 30px #14265022; padding: 6px; }
.cwf-tools-menu > div a { display: block; padding: 11px 13px; color: #203878; font-size: 13px; text-decoration: none; border-radius: 6px; }
.cwf-tools-menu > div a:hover { background: #eff3fb; }
.cwf-portal-return { margin: 0 0 24px; }
.auth-brand .cwf-portal-return, .auth-brand .cwf-back-link { color: #fff; border-color: #ffffff66; }
body[data-cwf-page="portal"] .auth-brand { padding: clamp(28px, 4vw, 64px); background: linear-gradient(145deg, #203878, #142650); }
body[data-cwf-page="portal"] .brand-logo { width: 190px; height: 52px; min-height: 0; filter: none; }
body[data-cwf-page="portal"] .brand-copy h1 { font-size: clamp(28px, 3vw, 42px); line-height: 1.15; letter-spacing: -1.2px; }
body[data-cwf-page="portal"] .brand-point { font-size: 13px; }
body[data-cwf-page="portal"] .brand-footer { font-size: 12px; color: #c1cee8; }
body[data-cwf-page="portal"] .auth-card h2 { font-size: 30px; line-height: 1.2; letter-spacing: -.7px; }
body[data-cwf-page="portal"] .auth-card > p { font-size: 14px; }
body[data-cwf-page="portal"] .auth-submit { min-height: 48px; }
body[data-cwf-page="portal"] .auth-form-wrap { padding: 40px; }
body[data-cwf-page="portal"] .tabs { gap: 6px; flex-wrap: wrap; }
body[data-cwf-page="portal"] .tabs button { min-height: 44px; font-size: 14px; }
.cwf-auth-error { margin: 8vh auto; max-width: 600px; padding: 32px; background: #fff; border: 1px solid var(--cwf-ui-line); border-radius: 16px; font: 15px/1.7 var(--cwf-ui-font); color: var(--cwf-ui-text); }
.cwf-auth-error-brand { background: var(--cwf-ui-blue); padding: 20px 24px; border-radius: 10px; margin-bottom: 24px; }
.cwf-auth-error-brand img { width: 150px; height: 42px; object-fit: contain; }
.cwf-auth-error h1 { font-size: 25px; line-height: 1.3; }
.cwf-auth-error-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.cwf-access-page { margin: 0; min-height: 100vh; background: #f3f6fb; color: var(--cwf-ui-text); font-family: var(--cwf-ui-font); }
.cwf-access-top { display: flex; align-items: center; justify-content: space-between; gap: 20px; width: min(1120px, calc(100% - 64px)); margin: 28px auto; }
.cwf-access-top a { color: #54647b; font-size: 13px; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; min-height: 40px; }
.cwf-access-top a:hover { color: var(--cwf-ui-blue); text-decoration: underline; }
.cwf-access-top span { font-size: 12px; color: #69778b; }
.cwf-access { width: min(1120px, calc(100% - 64px)); margin: 40px auto; display: grid; grid-template-columns: 1.04fr 1fr; min-height: 630px; background: #fff; border-radius: 22px; border: 1px solid #dfe5ef; box-shadow: 0 20px 60px #2038780c; overflow: hidden; }
.cwf-access-brand { position: relative; overflow: hidden; padding: 48px; color: #fff; background: linear-gradient(155deg, #203878 0%, #152851 100%); display: flex; flex-direction: column; justify-content: space-between; }
.cwf-access-brand::before { content: ""; position: absolute; width: 430px; height: 430px; top: 240px; left: -240px; border: 1px solid #ffffff0e; transform: rotate(30deg); box-shadow: 0 0 0 38px #ffffff04, 0 0 0 76px #ffffff03; pointer-events: none; }
.cwf-access-brand > * { position: relative; z-index: 1; }
.cwf-access-logo { display: block; width: 194px; height: 54px; object-fit: contain; object-position: left; }
.cwf-access-brand .eyebrow { color: #b9c9ed; font-size: 11px; font-weight: 600; letter-spacing: .13em; text-transform: uppercase; margin: 48px 0 18px; }
.cwf-access-brand h1 { font-size: clamp(32px, 3.4vw, 44px); line-height: 1.12; font-weight: 600; letter-spacing: -1.5px; margin: 0 0 20px; max-width: 390px; }
.cwf-access-brand p { color: #c4d1e9; font-size: 15px; line-height: 1.7; max-width: 350px; margin: 0; }
.cwf-access-features { margin: 30px 0; padding: 0; list-style: none; display: grid; gap: 13px; }
.cwf-access-features li { display: flex; align-items: center; gap: 12px; font-size: 13px; color: #e3eafa; }
.cwf-access-features svg { width: 18px; height: 18px; stroke: #a9bfe9; flex: 0 0 auto; }
.cwf-access-brand footer { padding-top: 28px; margin-top: 20px; border-top: 1px solid #ffffff20; font-size: 12px; color: #b4c5e4; }
.cwf-access-content { padding: 56px 48px 44px; display: flex; flex-direction: column; justify-content: center; }
.cwf-access-kicker { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; color: var(--cwf-ui-blue); margin-bottom: 18px; }
.cwf-access-kicker svg { width: 15px; height: 15px; }
.cwf-access-content h2 { font-size: 30px; font-weight: 650; letter-spacing: -.9px; line-height: 1.22; margin: 0 0 12px; }
.cwf-access-content > p { color: var(--cwf-ui-muted); font-size: 14px; line-height: 1.65; margin: 0 0 28px; }
.cwf-access-primary { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 15px 20px; min-height: 52px; border: 1px solid var(--cwf-ui-blue); border-radius: 9px; color: white; background: var(--cwf-ui-blue); font-size: 14px; font-weight: 600; text-decoration: none; transition: background .15s; }
.cwf-access-primary:hover { background: #172c62; }
.cwf-microsoft { display: grid; grid-template-columns: 8px 8px; gap: 2px; }
.cwf-microsoft i { width: 8px; height: 8px; background: #fff; }
.cwf-access-status { font-size: 13px; color: #8a3a23; min-height: 24px; margin: 14px 0 0; }
.cwf-access-divider { display: flex; align-items: center; gap: 14px; color: #7b8799; font-size: 12px; margin: 22px 0; }
.cwf-access-divider::before, .cwf-access-divider::after { content: ""; height: 1px; flex: 1; background: #e5e9f1; }
.cwf-access-client { display: flex; align-items: center; gap: 16px; border: 1px solid #dfe5ef; border-radius: 11px; padding: 20px; color: var(--cwf-ui-text); text-decoration: none; transition: background .15s, border-color .15s; }
.cwf-access-client:hover { background: #f7f9fd; border-color: #b7c6e3; }
.cwf-access-client > svg:first-child { width: 25px; height: 25px; color: var(--cwf-ui-blue); flex-shrink: 0; }
.cwf-access-client > svg:last-child { width: 18px; height: 18px; margin-left: auto; flex-shrink: 0; color: #7c8aa1; }
.cwf-access-client strong { display: block; font-size: 14px; font-weight: 650; margin-bottom: 4px; }
.cwf-access-client small { display: block; font-size: 12px; color: #65738a; line-height: 1.5; }
.cwf-access-note { font-size: 12px; color: #758298; margin-top: 28px; line-height: 1.6; }
.cwf-access-footer { margin: 28px auto 32px; width: min(1120px, calc(100% - 64px)); display: flex; justify-content: space-between; gap: 20px; font-size: 12px; color: #778399; }
@media (max-width: 900px) {
  .cwf-access { grid-template-columns: .9fr 1fr; }
  .cwf-access-brand, .cwf-access-content { padding: 32px; }
  body[data-cwf-page] .top, body[data-cwf-page] .topbar, body[data-cwf-page] .appbar { padding: 16px 22px; flex-wrap: wrap; }
  body[data-cwf-page] .page { padding: 24px; }
  body[data-cwf-page] .toolbar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 650px) {
  .cwf-access-top, .cwf-access, .cwf-access-footer { width: calc(100% - 32px); }
  .cwf-access-top { margin: 12px auto; }
  .cwf-access-top span { display: none; }
  .cwf-access { grid-template-columns: 1fr; margin: 16px auto; border-radius: 16px; min-height: 0; }
  .cwf-access-brand { padding: 28px; }
  .cwf-access-logo { width: 158px; height: 43px; }
  .cwf-access-brand .eyebrow { margin: 26px 0 12px; }
  .cwf-access-brand h1 { font-size: 30px; letter-spacing: -.8px; margin-bottom: 12px; max-width: 360px; }
  .cwf-access-brand p { font-size: 13px; }
  .cwf-access-features, .cwf-access-brand footer { display: none; }
  .cwf-access-content { padding: 30px 26px; }
  .cwf-access-content h2 { font-size: 27px; }
  .cwf-access-content > p { margin-bottom: 22px; }
  .cwf-access-footer { flex-direction: column; gap: 6px; margin-top: 22px; }
  body[data-cwf-page] .page { padding: 20px 16px 32px; }
  body[data-cwf-page] .top, body[data-cwf-page] .topbar, body[data-cwf-page] .appbar { padding: 15px 16px; gap: 14px; }
  body[data-cwf-page] .brand { gap: 13px; }
  body[data-cwf-page] .brand img, body[data-cwf-page] .appbar-logo { width: 100px; height: 30px; }
  body[data-cwf-page] .brand strong { font-size: 14px; }
  body[data-cwf-page] .brand .sep { display: none; }
  body[data-cwf-page] .top-actions { width: 100%; justify-content: flex-start; gap: 8px; }
  .cwf-tools-menu > div { left: 0; right: auto; }
  body[data-cwf-page] .toolbar, body[data-cwf-page] .filters { grid-template-columns: minmax(0, 1fr); }
  body[data-cwf-page] .heading { display: flex; flex-direction: column; gap: 18px; }
  body[data-cwf-page] .btn, body[data-cwf-page] .logout { min-height: 44px; }
  body[data-cwf-page] input:not([type="checkbox"]):not([type="radio"]), body[data-cwf-page] select, body[data-cwf-page] textarea { font-size: 16px; }
  body[data-cwf-page="portal"] .auth { grid-template-columns: minmax(0, 1fr); }
  body[data-cwf-page="portal"] .auth-brand { min-height: 0; padding: 30px; }
  body[data-cwf-page="portal"] .brand-copy h1 { margin-top: 28px; }
  body[data-cwf-page="portal"] .brand-points, body[data-cwf-page="portal"] .brand-footer { display: none; }
  body[data-cwf-page="portal"] .auth-form-wrap { padding: 30px 24px; }
  body[data-cwf-page="portal"] .userbar { width: 100%; justify-content: space-between; }
  .cwf-auth-error { margin: 24px 16px; padding: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  body[data-cwf-page] *, body[data-cwf-page] *::before, body[data-cwf-page] *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
