:root {
  --cds-background: #ffffff;
  --cds-layer-01: #f4f4f4;
  --cds-layer-02: #e0e0e0;
  --cds-text-primary: #161616;
  --cds-text-secondary: #525252;
  --cds-border-subtle: #c6c6c6;
  --cds-interactive: #0f62fe;
  --cds-interactive-hover: #0043ce;
  --cds-danger: #da1e28;
  --cds-success: #198038;
  --cds-warning: #f1c21b;
  --cds-info: #4589ff;
  --cds-dark: #161616;
  --sidebar-width: 248px;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--cds-background); color: var(--cds-text-primary); }
body { font-family: "IBM Plex Sans", "Segoe UI", Arial, sans-serif; font-size: 14px; letter-spacing: .16px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.masthead { position: fixed; inset: 0 0 auto 0; z-index: 30; height: 48px; display: flex; align-items: center; color: #f4f4f4; background: var(--cds-dark); }
.brand { display: flex; align-items: center; gap: 12px; min-width: var(--sidebar-width); padding: 0 16px; font-weight: 500; }
.brand-mark { display: inline-grid; place-items: center; width: 28px; height: 28px; color: white; background: var(--cds-interactive); font-family: "IBM Plex Mono", monospace; font-size: 12px; }
.masthead-meta { flex: 1; display: flex; align-items: center; gap: 16px; color: #c6c6c6; font-size: 12px; }
.environment { padding: 3px 8px; color: #fff; border: 1px solid #6f6f6f; border-radius: 16px; }
.masthead-actions { height: 100%; display: flex; }
.auth-screen { min-height: 100vh; display: grid; grid-template-columns: minmax(420px, 1.15fr) minmax(420px, .85fr); background: #fff; }
.auth-brand-panel { position: relative; display: flex; min-height: 100vh; flex-direction: column; justify-content: space-between; overflow: hidden; padding: 40px 56px; color: #f4f4f4; background: #161616; }
.auth-brand-panel::before { position: absolute; right: -160px; bottom: -220px; width: 520px; height: 520px; content: ""; border: 1px solid #525252; transform: rotate(45deg); }
.auth-brand-panel::after { position: absolute; right: 120px; bottom: 80px; width: 160px; height: 160px; content: ""; background: #0f62fe; transform: rotate(45deg); opacity: .9; }
.auth-brand-lockup { position: relative; z-index: 1; display: flex; align-items: center; gap: 14px; font-size: 16px; font-weight: 500; }
.auth-brand-mark { width: 34px; height: 34px; }
.auth-brand-copy { position: relative; z-index: 1; max-width: 650px; margin: auto 0; padding: 80px 0; }
.auth-brand-copy .eyebrow { color: #78a9ff; }
.auth-brand-copy h1 { margin: 12px 0 24px; color: #fff; font-size: clamp(42px, 5vw, 72px); line-height: 1.08; }
.auth-brand-copy > p:last-child { max-width: 570px; color: #c6c6c6; font-size: 18px; line-height: 1.6; }
.auth-security-note { position: relative; z-index: 1; display: flex; align-items: center; gap: 14px; max-width: 580px; padding-top: 20px; border-top: 1px solid #525252; }
.auth-security-note > span { color: #78a9ff; }
.auth-security-note strong, .auth-security-note small { display: block; }
.auth-security-note small { margin-top: 4px; color: #a8a8a8; }
.auth-form-panel { display: grid; min-height: 100vh; place-items: center; padding: 48px; background: #f4f4f4; }
.auth-card { width: min(440px, 100%); padding: 40px; background: #fff; border-top: 4px solid var(--cds-interactive); box-shadow: 0 8px 28px rgba(0,0,0,.12); }
.auth-card-heading { margin-bottom: 32px; }
.auth-card-heading h2 { margin: 6px 0 8px; font-size: 30px; font-weight: 300; }
.auth-card-heading > p:last-child { margin: 0; color: var(--cds-text-secondary); }
.auth-card .field input { background: #f4f4f4; }
.auth-submit { width: 100%; min-height: 48px; margin-top: 8px; }
.auth-message { margin-bottom: 20px; padding: 12px 14px; color: #a2191f; background: #fff1f1; border-left: 4px solid var(--cds-danger); line-height: 1.45; }
.password-guidance, .auth-footnote { color: var(--cds-text-secondary); font-size: 12px; line-height: 1.5; }
.password-guidance { margin: -6px 0 18px; }
.auth-footnote { margin: 24px 0 0; text-align: center; }
.account-menu { position: relative; height: 100%; }
.account-button { display: flex; height: 48px; min-width: 210px; align-items: center; gap: 10px; padding: 0 14px; color: #f4f4f4; background: #262626; border: 0; border-left: 1px solid #525252; text-align: left; }
.account-button:hover, .account-button[aria-expanded="true"] { background: #393939; }
.account-avatar { display: grid; width: 30px; height: 30px; flex: 0 0 auto; place-items: center; color: #fff; background: #005d5d; border-radius: 50%; font-weight: 600; }
.account-summary { min-width: 0; flex: 1; }
.account-summary strong, .account-summary small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-summary strong { font-size: 12px; }
.account-summary small { margin-top: 2px; color: #c6c6c6; font-size: 10px; }
.account-panel { position: absolute; top: 48px; right: 0; z-index: 45; width: 280px; color: var(--cds-text-primary); background: #fff; border: 1px solid var(--cds-border-subtle); box-shadow: 0 8px 24px rgba(0,0,0,.24); }
.account-panel-header { padding: 18px 16px; background: #f4f4f4; border-bottom: 1px solid #e0e0e0; }
.account-panel-header strong, .account-panel-header span { display: block; }
.account-panel-header span { margin-top: 4px; color: var(--cds-text-secondary); font-size: 11px; }
.account-panel > button { width: 100%; min-height: 42px; padding: 0 16px; text-align: left; color: inherit; background: #fff; border: 0; border-bottom: 1px solid #e0e0e0; }
.account-panel > button:hover { background: #edf5ff; }
.account-panel > .account-logout { color: var(--cds-danger); border-bottom: 0; }
.menu-toggle { display: none; height: 48px; color: #fff; background: transparent; border: 0; padding: 0 16px; }
.shell { display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); min-height: 100vh; padding-top: 48px; }
.sidebar { position: fixed; top: 48px; bottom: 0; left: 0; z-index: 20; width: var(--sidebar-width); display: flex; flex-direction: column; overflow-y: auto; background: var(--cds-layer-01); border-right: 1px solid var(--cds-layer-02); }
.nav-section-label { padding: 24px 16px 8px; color: #6f6f6f; font-size: 11px; font-weight: 600; letter-spacing: .8px; }
.sidebar nav { display: flex; flex-direction: column; }
.nav-item { min-height: 40px; padding: 0 16px; text-align: left; color: var(--cds-text-primary); background: transparent; border: 0; border-left: 4px solid transparent; }
.nav-item:hover { background: #e8e8e8; }
.nav-item.active { color: var(--cds-interactive); background: #edf5ff; border-left-color: var(--cds-interactive); font-weight: 600; }
.sidebar-footer { margin-top: auto; display: grid; grid-template-columns: 12px 1fr; gap: 8px; align-items: start; padding: 16px; border-top: 1px solid var(--cds-layer-02); }
.sidebar-footer strong, .sidebar-footer small { display: block; }
.sidebar-footer small { margin-top: 3px; overflow-wrap: anywhere; color: var(--cds-text-secondary); font-size: 11px; }
.status-dot { width: 8px; height: 8px; margin-top: 4px; background: #8d8d8d; border-radius: 50%; }
.status-dot.online { background: var(--cds-success); }
.main { grid-column: 2; min-width: 0; padding: 32px; }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.eyebrow { margin: 0 0 4px; color: var(--cds-text-secondary); font-size: 11px; font-weight: 600; letter-spacing: .8px; }
h1 { margin: 0; font-size: 32px; line-height: 1.25; font-weight: 300; }
h2 { margin: 0; font-size: 20px; line-height: 1.4; font-weight: 500; }
h3 { margin: 0; font-size: 16px; line-height: 1.5; font-weight: 600; }
p { line-height: 1.5; }
.btn { min-height: 40px; padding: 0 16px; border: 1px solid transparent; border-radius: 0; font-weight: 500; }
.btn-primary { color: #fff; background: var(--cds-interactive); }
.btn-primary:hover { background: var(--cds-interactive-hover); }
.btn-secondary { color: #fff; background: #393939; }
.btn-tertiary { color: var(--cds-interactive); background: transparent; border-color: var(--cds-interactive); }
.btn-danger { color: #fff; background: var(--cds-danger); }
.btn-danger-ghost { color: var(--cds-danger); background: transparent; border-color: transparent; }
.btn-danger-ghost:hover { background: #fff1f1; }
.btn-ghost-light { height: 48px; color: #f4f4f4; background: transparent; border: 0; }
.btn-ghost-light:hover { background: #393939; }
.btn-small { min-height: 32px; padding: 0 10px; font-size: 12px; }
.btn:disabled { cursor: not-allowed; opacity: .45; }
.button-row { display: flex; gap: 8px; flex-wrap: wrap; }
.table-actions { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }
.person-actions { gap: 8px; flex-wrap: nowrap; }
.master-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 32px; margin-bottom: 16px; padding: 24px; background: var(--cds-layer-01); border-left: 4px solid var(--cds-interactive); }
.master-toolbar h2 { margin-bottom: 4px; }
.master-toolbar p:last-child { max-width: 720px; margin: 4px 0 0; color: var(--cds-text-secondary); }
.master-toolbar-actions { display: flex; flex: 0 0 auto; gap: 8px; }
.master-metrics .metric { min-height: 112px; }
.master-metrics .metric-value { margin-top: 12px; }
.master-assignment-grid { align-items: stretch; margin-bottom: 32px; }
.master-assignment-grid .panel { height: 100%; margin-bottom: 0; border-top: 3px solid #8d8d8d; }
.master-assignment-grid .panel:first-child { border-top-color: var(--cds-interactive); }
.compact-form { display: flex; min-height: 258px; flex-direction: column; }
.compact-form .btn { width: 100%; margin-top: auto; }
.master-section-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin: 32px 0 12px; padding-bottom: 12px; border-bottom: 1px solid var(--cds-border-subtle); }
.master-section-heading p { max-width: 520px; margin: 0; color: var(--cds-text-secondary); }
.master-section-heading .eyebrow { margin-bottom: 4px; }
.master-resource-list { display: grid; gap: 16px; }
.master-resource-list .panel { margin-bottom: 0; }
.user-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 32px; margin-bottom: 20px; padding: 24px; color: #fff; background: #262626; border-left: 4px solid var(--cds-interactive); }
.user-toolbar h2 { margin-bottom: 5px; }
.user-toolbar p { max-width: 680px; margin: 0; color: #c6c6c6; }
.user-toolbar .btn { flex: 0 0 auto; }
.user-identity { display: flex; align-items: center; gap: 10px; }
.user-identity-avatar { display: grid; width: 32px; height: 32px; place-items: center; color: #fff; background: #005d5d; border-radius: 50%; font-weight: 600; }
.user-identity small { display: block; margin-top: 3px; color: var(--cds-text-secondary); }
.own-account-label { color: var(--cds-text-secondary); font-size: 11px; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; margin-bottom: 24px; background: var(--cds-layer-02); }
.metric { min-height: 136px; padding: 16px; background: var(--cds-layer-01); }
.metric-label { color: var(--cds-text-secondary); font-size: 12px; }
.metric-value { margin: 16px 0 6px; font-family: "IBM Plex Mono", monospace; font-size: 32px; line-height: 1; }
.metric-detail { color: var(--cds-text-secondary); font-size: 12px; }
.metric-danger .metric-value { color: var(--cds-danger); }
.metric-success .metric-value { color: var(--cds-success); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.panel { min-width: 0; margin-bottom: 16px; background: var(--cds-layer-01); }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 48px; padding: 12px 16px; border-bottom: 1px solid var(--cds-layer-02); }
.panel-body { padding: 16px; }
.panel-flush .panel-body { padding: 0; }
.notice { display: flex; gap: 12px; margin-bottom: 16px; padding: 12px 16px; background: #edf5ff; border-top: 3px solid var(--cds-info); }
.notice-danger { background: #fff1f1; border-top-color: var(--cds-danger); }
.notice-warning { background: #fff8e1; border-top-color: #b28600; }
.notice-success { background: #defbe6; border-top-color: var(--cds-success); }
.notice strong { display: block; margin-bottom: 2px; }
.toolbar { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.toolbar .field { min-width: 280px; margin: 0; }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 16px; }
.field label { color: var(--cds-text-secondary); font-size: 12px; letter-spacing: .32px; }
.field input, .field select, .field textarea { width: 100%; min-height: 40px; padding: 8px 12px; color: var(--cds-text-primary); background: var(--cds-layer-01); border: 0; border-bottom: 2px solid #8d8d8d; border-radius: 0; outline: 0; }
.field textarea { min-height: 80px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-bottom-color: var(--cds-interactive); box-shadow: inset 0 0 0 1px var(--cds-interactive); }
.checkbox { display: flex; align-items: center; gap: 8px; min-height: 40px; }
.checkbox input { width: 18px; height: 18px; accent-color: var(--cds-interactive); }
.machine-picker { margin: 4px 0 16px; padding: 0; border: 1px solid var(--cds-border-subtle); }
.machine-picker legend { margin-left: 12px; padding: 0 6px; color: var(--cds-text-primary); font-size: 12px; font-weight: 600; }
.machine-picker > p { margin: 8px 12px 10px; color: var(--cds-text-secondary); font-size: 12px; }
.machine-checkbox-grid { columns: 2; column-gap: 1px; background: var(--cds-layer-02); border-top: 1px solid var(--cds-layer-02); }
.machine-option { break-inside: avoid; display: flex; min-height: 48px; align-items: center; gap: 10px; margin-bottom: 1px; padding: 8px 12px; background: var(--cds-layer-01); cursor: pointer; }
.machine-option:hover { background: #edf5ff; }
.machine-option input { width: 18px; height: 18px; flex: 0 0 auto; accent-color: var(--cds-interactive); }
.machine-option strong, .machine-option small { display: block; }
.machine-option small { margin-top: 2px; color: var(--cds-text-secondary); font-size: 11px; }
.tool-output-editor { margin: 4px 0 16px; padding: 0 0 12px; border: 1px solid var(--cds-border-subtle); }
.tool-output-editor legend { margin-left: 12px; padding: 0 6px; color: var(--cds-text-primary); font-size: 12px; font-weight: 600; }
.tool-output-editor > p { margin: 8px 12px 10px; color: var(--cds-text-secondary); font-size: 12px; }
.tool-output-editor > .btn { margin: 12px 12px 0; }
.tool-output-list:empty { display: none; }
.tool-cavity-component-row { display: grid; grid-template-columns: minmax(0, 1fr) 140px auto; align-items: end; gap: 12px; padding: 12px; border-top: 1px solid var(--cds-layer-02); }
.form-grid { display: grid; grid-template-columns: repeat(4, minmax(140px, 1fr)); gap: 0 16px; align-items: end; }
.form-grid.shift-form-grid { align-items: start; }
.form-grid .span-2 { grid-column: span 2; }
.form-grid .form-actions { margin-bottom: 16px; }
.form-grid.modal-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.contact-cell small { display: block; margin-top: 3px; color: var(--cds-text-secondary); }
.time-chip { display: inline-flex; margin: 2px 4px 2px 0; padding: 3px 7px; color: #0043ce; background: #edf5ff; border-left: 2px solid var(--cds-interactive); font-family: "IBM Plex Mono", monospace; font-size: 11px; }
.muted, .availability-hint { color: var(--cds-text-secondary); font-size: 11px; }
.availability-hint { min-height: 16px; }
[hidden] { display: none !important; }
.table-wrap { width: 100%; overflow: auto; }
table { width: max-content; min-width: 100%; border-collapse: collapse; white-space: nowrap; }
th { position: sticky; top: 0; z-index: 2; height: 40px; padding: 0 12px; text-align: left; color: var(--cds-text-secondary); background: var(--cds-layer-02); border-bottom: 1px solid #8d8d8d; font-size: 12px; font-weight: 500; }
.sortable-table th { padding: 0; }
.table-sort { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-height: 40px; padding: 0 12px; color: inherit; background: transparent; border: 0; text-align: left; font-weight: 500; white-space: nowrap; }
.table-sort:hover { color: var(--cds-text-primary); background: #d6d6d6; }
.table-sort:focus-visible { outline: 2px solid var(--cds-interactive); outline-offset: -2px; }
.sortable-table.has-actions th:last-child,
.sortable-table.has-actions td:last-child { width: 320px; min-width: 320px; }
.sortable-table.has-actions th:last-child .table-sort { justify-content: space-between; }
.sortable-table.has-actions { min-width: 100%; table-layout: auto; }
.sortable-table.has-actions .table-sort { min-height: 48px; line-height: 1.2; white-space: nowrap; }
.sortable-table.has-actions th:not(:last-child),
.sortable-table.has-actions td:not(:last-child) { width: auto; }
.sortable-table.has-actions td:not(:last-child) { overflow: visible; text-overflow: clip; }
.sortable-table.has-actions .table-spacer { padding: 0; }
.sortable-table.has-actions.natural-table { min-width: 900px; table-layout: auto; }
.sortable-table.has-actions.natural-table th:not(:last-child),
.sortable-table.has-actions.natural-table td:not(:last-child) { width: auto; }
.sortable-table.has-actions.natural-table th:first-child,
.sortable-table.has-actions.natural-table td:first-child { min-width: 230px; }
.sortable-table.has-actions.natural-table th:last-child,
.sortable-table.has-actions.natural-table td:last-child { min-width: 320px; }
.sortable-table.has-actions.natural-table td:not(:last-child) { overflow: visible; text-overflow: clip; }
.natural-table .user-identity-avatar { flex: 0 0 32px; }
.sort-indicator { width: 12px; color: var(--cds-interactive); }
th[aria-sort="ascending"] .sort-indicator::before { content: "▲"; font-size: 9px; }
th[aria-sort="descending"] .sort-indicator::before { content: "▼"; font-size: 9px; }
td { height: 42px; padding: 8px 12px; border-bottom: 1px solid var(--cds-layer-02); vertical-align: middle; }
tbody tr:nth-child(even) { background: #fafafa; }
tbody tr:hover { background: #edf5ff; }
.cell-wrap { max-width: none; overflow: visible; text-overflow: clip; white-space: nowrap; }
.mono { font-family: "IBM Plex Mono", monospace; font-size: 12px; }
.badge { display: inline-flex; align-items: center; min-height: 22px; padding: 2px 8px; color: #0043ce; background: #edf5ff; border-radius: 14px; font-size: 12px; }
.badge-success { color: #0e6027; background: #defbe6; }
.badge-warning { color: #684e00; background: #fff1c2; }
.badge-danger { color: #a2191f; background: #fff1f1; }
.badge-neutral { color: #525252; background: #e0e0e0; }
.empty { padding: 48px 24px; text-align: center; color: var(--cds-text-secondary); }
.empty h3 { margin-bottom: 8px; color: var(--cds-text-primary); }
.loading { display: flex; align-items: center; gap: 12px; padding: 64px 0; color: var(--cds-text-secondary); }
.spinner { width: 20px; height: 20px; border: 2px solid var(--cds-layer-02); border-top-color: var(--cds-interactive); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.progress-track { width: 100%; height: 8px; margin-top: 12px; background: var(--cds-layer-02); }
.progress-bar { height: 100%; background: var(--cds-interactive); }
.progress-0 { width: 0; }
.progress-20 { width: 20%; }
.progress-40 { width: 40%; }
.progress-60 { width: 60%; }
.progress-80 { width: 80%; }
.progress-100 { width: 100%; }
.detail-list { display: grid; grid-template-columns: 1fr auto; gap: 10px; margin: 0; }
.technical-detail-list { grid-template-columns: 160px 1fr; gap: 8px; }
.machine-board { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.machine-board + .panel { margin-top: 24px; }
.machine-card { background: var(--cds-layer-01); border-top: 4px solid var(--cds-interactive); }
.machine-shift-card[data-shift-state="running"] { border-top-color: var(--cds-success); }
.machine-shift-card[data-shift-state="paused"] { border-top-color: #f1c21b; }
.machine-shift-card[data-shift-state="disturbance"] { border-top-color: var(--cds-danger); }
.machine-shift-card[data-shift-state="stopped"] { border-top-color: #8d8d8d; }
.machine-card-header { display: flex; justify-content: space-between; padding: 16px; border-bottom: 1px solid var(--cds-layer-02); }
.machine-card-body { padding: 16px; }
.machine-card dl { display: grid; grid-template-columns: 120px 1fr; gap: 8px; margin: 0 0 16px; }
.machine-card dt { color: var(--cds-text-secondary); }
.machine-card dd { margin: 0; }
.shift-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.shift-actions .btn { width: 100%; min-width: 0; min-height: 40px; padding: 0 12px; }
.shift-overdue { color: var(--cds-danger); font-weight: 600; }
.form-guidance { margin: 0 0 16px; padding: 12px; color: var(--cds-text-secondary); background: var(--cds-layer-02); font-size: 13px; }
.calendar-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: end; gap: 16px; padding: 16px; background: #fff; border-bottom: 1px solid var(--cds-layer-02); }
.calendar-navigation, .calendar-view-switch { display: flex; align-items: end; gap: 4px; }
.calendar-navigation { justify-self: start; }
.calendar-view-switch { justify-self: end; }
.calendar-date-field { display: flex; flex-direction: column; gap: 4px; margin-left: 8px; color: var(--cds-text-secondary); font-size: 11px; }
.calendar-date-field input { width: 150px; min-height: 40px; padding: 7px 10px; color: var(--cds-text-primary); background: var(--cds-layer-01); border: 0; border-bottom: 2px solid #8d8d8d; }
.calendar-date-field input:focus { border-bottom-color: var(--cds-interactive); outline: 2px solid var(--cds-interactive); outline-offset: -2px; }
.calendar-range-summary { min-width: 240px; text-align: center; }
.calendar-range-summary strong, .calendar-range-summary small { display: block; }
.calendar-range-summary strong { text-transform: capitalize; }
.calendar-range-summary small { margin-top: 4px; color: var(--cds-text-secondary); }
.calendar-zoom-hint { padding: 6px 16px; color: var(--cds-text-secondary); background: var(--cds-layer-01); border-bottom: 1px solid var(--cds-layer-02); font-size: 11px; text-align: right; }
.calendar-scroll { width: 100%; max-height: 640px; overflow: auto; overscroll-behavior: contain; touch-action: pan-x pan-y; background: #fff; border-bottom: 1px solid var(--cds-border-subtle); }
.calendar-grid { --major-line-width: 1px; display: grid; width: max-content; min-width: 100%; grid-template-columns: 180px var(--timeline-width); background: var(--cds-layer-02); gap: 1px 0; }
.calendar-corner, .calendar-machine-label { position: sticky; left: 0; z-index: 8; width: 180px; background: var(--cds-layer-01); border-right: 1px solid #8d8d8d; }
.calendar-corner { top: 0; z-index: 12; min-height: 68px; padding: 14px 12px; }
.calendar-corner strong, .calendar-corner small, .calendar-machine-label strong, .calendar-machine-label small { display: block; }
.calendar-corner small, .calendar-machine-label small { margin-top: 4px; color: var(--cds-text-secondary); font-size: 11px; }
.calendar-axis { position: sticky; top: 0; z-index: 10; width: var(--timeline-width); min-height: 68px; background: #fff; box-shadow: 0 1px 0 #8d8d8d; }
.calendar-day-headers, .calendar-hour-headers { display: flex; width: 100%; }
.calendar-day-headers { height: 34px; }
.calendar-day-header { display: flex; flex: 1 0 0; min-width: 0; align-items: center; padding: 0 10px; color: var(--cds-text-primary); background: var(--cds-layer-01); border-right: 1px solid #8d8d8d; font-weight: 600; text-transform: capitalize; }
.calendar-day-header.is-today { color: #0043ce; background: #edf5ff; box-shadow: inset 0 -3px 0 var(--cds-interactive); }
.calendar-hour-headers { height: 34px; }
.calendar-hour-header { position: relative; display: flex; flex: 1 0 0; min-width: 0; align-items: center; justify-content: center; overflow: visible; color: var(--cds-text-secondary); background: #fff; border-right: var(--major-line-width) solid #b0b0b0; font-family: "IBM Plex Mono", monospace; font-size: 10px; }
.calendar-hour-header.has-label { z-index: 1; justify-content: flex-start; padding-left: 2px; }
.calendar-hour-label { color: var(--cds-text-primary); font-weight: 600; white-space: nowrap; }
.calendar-minute-label { position: absolute; top: 0; bottom: 0; z-index: 2; display: none; align-items: center; padding-left: 2px; border-left: 1px solid #dcdcdc; white-space: nowrap; }
.calendar-minute-label.minute-15 { left: 25%; }
.calendar-minute-label.minute-30 { left: 50%; }
.calendar-minute-label.minute-45 { left: 75%; }
.calendar-scale-half .calendar-minute-label.minute-30 { display: flex; }
.calendar-scale-quarter .calendar-minute-label { display: flex; }
.calendar-machine-label { min-height: 76px; padding: 16px 12px; }
.calendar-track { position: relative; width: var(--timeline-width); min-height: 76px; overflow: hidden; background-color: #fff; background-image: repeating-linear-gradient(to right, transparent 0 calc(var(--minor-step-width) - 1px), var(--minor-line-color) calc(var(--minor-step-width) - 1px) var(--minor-step-width)), repeating-linear-gradient(to right, transparent 0 calc(var(--hour-width) - var(--major-line-width)), #b0b0b0 calc(var(--hour-width) - var(--major-line-width)) var(--hour-width)); }
.calendar-day-line { position: absolute; top: 0; bottom: 0; z-index: 1; width: 1px; background: #8d8d8d; pointer-events: none; }
.calendar-now-line { position: absolute; top: 0; bottom: 0; z-index: 5; width: 2px; background: var(--cds-danger); pointer-events: none; }
.calendar-now-line::before { position: absolute; top: 0; left: -4px; width: 10px; height: 10px; content: ""; background: var(--cds-danger); border-radius: 50%; }
.calendar-event { position: absolute; top: 8px; bottom: 8px; z-index: 3; min-width: 3px; overflow: hidden; padding: 7px 30px 7px 9px; color: #fff; background: var(--order-trace-color, #0f62fe); border-left: 3px solid rgba(0,0,0,.48); box-shadow: inset 0 0 0 1px rgba(255,255,255,.3); white-space: nowrap; cursor: grab; }
.calendar-event.sorting { background: var(--order-trace-color, #007d79); border-top: 3px solid rgba(255,255,255,.7); }
.calendar-event.is-locked { box-shadow: inset 0 0 0 2px #161616, 0 0 0 2px #f1c21b; cursor: default; }
.calendar-event.is-dragging { opacity: .45; cursor: grabbing; }
.calendar-event.is-derived { cursor: default; }
.calendar-event-lock { position: absolute; top: 3px; right: 3px; z-index: 2; width: 24px; height: 24px; padding: 0; color: #fff; background: rgba(0,0,0,.35); border: 0; font-size: 12px; line-height: 24px; }
.calendar-change { position: absolute; top: 8px; bottom: 8px; z-index: 4; min-width: 4px; overflow: hidden; padding: 7px 8px; border: 1px solid #6f6f6f; color: #161616; white-space: nowrap; pointer-events: none; }
.calendar-change strong, .calendar-change small { display: block; overflow: hidden; text-overflow: ellipsis; }
.calendar-change small { margin-top: 3px; }
.calendar-tool-change { background: repeating-linear-gradient(135deg, #dcdcdc 0 6px, #a8a8a8 6px 12px); }
.calendar-color-change { background: repeating-linear-gradient(135deg, #fff1c2 0 6px, #f1c21b 6px 12px); }
.trace-order { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.trace-order > i { width: 10px; height: 24px; flex: 0 0 auto; background: var(--order-trace-color, #0f62fe); border: 1px solid rgba(0,0,0,.25); }
.calendar-event:hover { z-index: 6; filter: brightness(.92); }
.calendar-event strong, .calendar-event small { display: block; overflow: hidden; text-overflow: ellipsis; }
.calendar-event-quantity { margin-left: 6px; font-size: 11px; opacity: .88; }
.calendar-event-time { margin-top: 3px; color: #fff; font-family: "IBM Plex Mono", monospace; }
.calendar-event-detail { margin-top: 2px; color: #e0e0e0; }
.calendar-event-compact .calendar-event-detail { display: none; }
.calendar-event-minimal { padding: 0; border-left-width: 1px; }
.calendar-event-minimal > * { display: none; }
.calendar-event.clipped-start { border-left-style: dashed; }
.calendar-event.clipped-end { border-right: 3px dashed rgba(255,255,255,.85); }
.source-list { display: grid; gap: 1px; background: var(--cds-layer-02); }
.source-row { display: grid; grid-template-columns: 130px 1fr 100px 60px; gap: 16px; padding: 12px 16px; background: #fff; }
.modal { width: min(680px, calc(100vw - 32px)); max-height: calc(100vh - 32px); padding: 0; border: 0; box-shadow: 0 8px 32px rgba(0,0,0,.35); }
.modal::backdrop { background: rgba(22,22,22,.55); }
.modal-card { display: flex; flex-direction: column; max-height: calc(100vh - 32px); }
.modal-header, .modal-actions { display: flex; align-items: center; justify-content: space-between; padding: 16px; }
.modal-header { border-bottom: 1px solid var(--cds-layer-02); }
.modal-actions { justify-content: flex-end; gap: 8px; background: var(--cds-layer-01); }
.modal-body { overflow-y: auto; padding: 16px; }
.icon-button { width: 40px; height: 40px; color: var(--cds-text-primary); background: transparent; border: 0; font-size: 24px; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 50; max-width: 420px; padding: 14px 18px; color: #fff; background: #262626; opacity: 0; transform: translateY(16px); pointer-events: none; transition: .2s ease; }
.toast.show { opacity: 1; transform: none; }
.toast.error { background: var(--cds-danger); }
.risk-row td:first-child { border-left: 4px solid var(--cds-danger); }
@media (max-width: 1120px) {
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .form-grid { grid-template-columns: repeat(2, minmax(140px, 1fr)); }
}
@media (max-width: 760px) {
  .auth-screen { grid-template-columns: 1fr; }
  .auth-brand-panel { min-height: 220px; padding: 24px; }
  .auth-brand-copy { padding: 48px 0 20px; }
  .auth-brand-copy h1 { font-size: 36px; }
  .auth-brand-copy > p:last-child, .auth-security-note { display: none; }
  .auth-brand-panel::before, .auth-brand-panel::after { display: none; }
  .auth-form-panel { min-height: auto; padding: 24px 16px; }
  .auth-card { padding: 28px 24px; }
  .masthead-meta { display: none; }
  .menu-toggle { display: block; }
  .brand { min-width: 0; flex: 1; padding-left: 0; }
  .brand span:last-child { display: none; }
  .masthead-actions .btn-ghost-light { display: none; }
  .account-button { min-width: 48px; padding: 0 9px; }
  .account-summary, .account-button > span:last-child { display: none; }
  .account-panel { position: fixed; top: 48px; right: 0; }
  .shell { display: block; }
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; box-shadow: 4px 0 16px rgba(0,0,0,.2); }
  .sidebar.open { transform: translateX(0); }
  .main { padding: 24px 16px; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .metrics, .grid-2, .grid-3, .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .toolbar .field { min-width: 0; }
  .master-toolbar, .master-section-heading, .user-toolbar { align-items: stretch; flex-direction: column; }
  .master-toolbar-actions { flex-direction: column; }
  .master-toolbar-actions .btn { width: 100%; }
  .table-actions { align-items: center; flex-direction: row; }
  .machine-checkbox-grid { columns: 1; }
  .tool-cavity-component-row { grid-template-columns: 1fr; }
  .tool-cavity-component-row .btn { width: 100%; }
  .source-row { grid-template-columns: 1fr; gap: 4px; }
  .calendar-toolbar { grid-template-columns: 1fr; align-items: stretch; }
  .calendar-navigation, .calendar-view-switch { justify-self: stretch; flex-wrap: wrap; }
  .calendar-view-switch .btn { flex: 1; }
  .calendar-range-summary { grid-row: 1; text-align: left; }
  .calendar-grid { grid-template-columns: 150px var(--timeline-width); }
  .calendar-corner, .calendar-machine-label { width: 150px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; } }
