.app-shell:has(.scada-production-view) .page-heading p { font-size: 13px; line-height: 1.4; }

.scada-production-view { max-width: 1180px; display: grid; gap: 18px; margin: 0 auto; }
.scada-production-intro { min-height: 132px; display: flex; align-items: center; gap: 18px; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(135deg, #f7fbff, #edf6ff); box-shadow: var(--shadow); }
.scada-production-mark { width: 62px; height: 62px; flex: 0 0 62px; display: grid; place-items: center; border-radius: 16px; background: var(--brand); color: #fff; }
.scada-production-mark svg { width: 31px; height: 31px; }
.scada-production-intro h2 { margin: 0; color: #132a48; font-size: 24px; font-weight: 800; }
.scada-production-intro p { margin: 6px 0 0; color: var(--ink-soft); font-size: 14px; }

.scada-production-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.scada-production-card { min-width: 0; min-height: 126px; display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: inherit; text-align: left; box-shadow: var(--shadow); opacity: 1; cursor: not-allowed; }
.scada-production-card:disabled { opacity: 1; }
.scada-production-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 12px; background: var(--brand-soft); color: var(--brand); }
.scada-production-icon svg { width: 24px; height: 24px; }
.scada-production-copy { min-width: 0; display: grid; gap: 5px; }
.scada-production-copy b { color: #18304e; font-size: 15px; line-height: 1.3; }
.scada-production-copy small { color: var(--ink-soft); font-size: 12px; line-height: 1.45; }
.scada-production-card em { padding: 5px 9px; border-radius: 999px; background: #eef2f6; color: #65758a; font-size: 11px; font-style: normal; font-weight: 700; white-space: nowrap; }
.scada-production-card.is-enabled { cursor: pointer; border-color: #b9d8f4; }
.scada-production-card.is-enabled:hover { transform: translateY(-1px); border-color: var(--brand); box-shadow: 0 10px 24px rgba(18, 73, 119, .12); }
.scada-production-card.is-enabled em { background: var(--brand-soft); color: var(--brand); }

.scada-manual-view { padding-bottom: 24px; }
.scada-manual-breadcrumb { display: flex; align-items: center; gap: 9px; color: var(--ink-soft); font-size: 12px; }
.scada-manual-breadcrumb .button { min-height: 34px; padding: 0 12px; }
.scada-manual-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 22px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(135deg, #f7fbff, #eef7ff); }
.scada-manual-header h2 { margin: 0; color: #132a48; font-size: 22px; }
.scada-manual-header p { margin: 5px 0 0; color: var(--ink-soft); font-size: 12px; }
.scada-manual-status { padding: 7px 11px; border-radius: 999px; background: #fff4d6; color: #9a6200; font-size: 11px; font-weight: 800; white-space: nowrap; }
.scada-manual-status.is-confirmed { background: #e3f7eb; color: #147942; }
.scada-manual-audit { display: flex; flex-wrap: wrap; gap: 18px; padding: 11px 15px; border: 1px solid #cfe3d7; border-radius: 8px; background: #f2fbf5; color: #476255; font-size: 11px; }
.scada-operation-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 220px)); gap: 6px; padding: 5px; border: 1px solid #c9d8e6; border-radius: 10px; background: #eef4f9; }
.scada-operation-tabs button { min-height: 42px; padding: 0 18px; border: 0; border-radius: 7px; background: transparent; color: #5e7186; font: inherit; font-size: 12px; font-weight: 800; cursor: pointer; }
.scada-operation-tabs button[aria-selected="true"] { background: #fff; color: var(--brand); box-shadow: 0 2px 8px rgba(30, 66, 98, .12); }
.scada-operation-tabs button:focus-visible { outline: 3px solid rgba(16, 117, 190, .18); outline-offset: 1px; }
.scada-operation-panel { min-width: 0; }
.scada-operation-panel[hidden] { display: none; }
.scada-manual-form { display: grid; gap: 14px; padding-bottom: 8px; }
.scada-manual-section { min-width: 0; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.scada-manual-section legend { float: left; width: 100%; padding: 13px 18px; border-bottom: 1px solid var(--line); background: #f7f9fc; color: #173452; font-size: 12px; font-weight: 800; letter-spacing: .035em; }
.scada-manual-fields { clear: both; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 18px; padding: 18px; }
.scada-manual-field { min-width: 0; display: grid; align-content: start; gap: 6px; color: #30465e; font-size: 12px; font-weight: 650; }
.scada-manual-field > span:first-child span { color: #c73737; }
.scada-manual-control { position: relative; display: block; }
.scada-manual-control input, .scada-manual-control select, .scada-manual-control textarea { width: 100%; min-width: 0; border: 1px solid #cdd7e2; border-radius: 7px; background: #fff; color: #172b42; font: inherit; font-weight: 500; outline: none; }
.scada-manual-control input, .scada-manual-control select { height: 40px; padding: 0 12px; }
.scada-manual-control textarea { min-height: 82px; padding: 10px 12px; resize: vertical; }
.scada-manual-control:has(.scada-manual-unit) input { padding-right: 58px; }
.scada-manual-control input:focus, .scada-manual-control select:focus, .scada-manual-control textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(16, 117, 190, .11); }
.scada-manual-control input:disabled, .scada-manual-control select:disabled, .scada-manual-control textarea:disabled { background: #f2f5f8; color: #5e6e80; cursor: not-allowed; }
.scada-derived-output { display: flex; align-items: center; min-height: 40px; padding: 8px 12px; border: 1px solid #bdd6c5; border-radius: 7px; background: #f2faf5; color: #245b39; font-weight: 800; }
.scada-manual-field:has(.scada-derived-output) > span:first-child::after { content: " · READ ONLY"; color: #4d8060; font-size: 9px; font-weight: 850; }
.scada-manual-unit { position: absolute; top: 50%; right: 11px; transform: translateY(-50%); color: #748398; font-size: 10px; font-weight: 700; pointer-events: none; }
.scada-manual-field small { min-height: 14px; color: #c73737; font-size: 10px; font-weight: 500; }
.scada-manual-field.has-error input, .scada-manual-field.has-error select, .scada-manual-field.has-error textarea { border-color: #d54b4b; background: #fff9f9; }
.scada-manual-pair { grid-column: 1 / -1; display: grid; gap: 9px; padding: 12px; border: 1px solid #d9e4ee; border-radius: 8px; background: #f9fbfd; }
.scada-manual-pair > b { color: #25445f; font-size: 12px; }
.scada-manual-pair > div { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.scada-scan-panel { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 7px 16px; padding: 14px 16px; border: 1px solid #cbdceb; border-radius: var(--radius); background: #f7fbff; box-shadow: var(--shadow); }
.scada-scan-panel > div { display: flex; align-items: center; gap: 10px; }
.scada-scan-panel b { color: #173452; font-size: 13px; }
.scada-scan-panel span { padding: 4px 8px; border-radius: 999px; background: #e9eff5; color: #60748b; font-size: 10px; font-weight: 800; }
.scada-scan-panel p { grid-column: 1; margin: 0; color: var(--ink-soft); font-size: 11px; line-height: 1.45; }
.scada-scan-panel > .button { grid-column: 2; grid-row: 1 / span 2; min-height: 40px; }
.scada-scan-panel.is-reading span { background: #e5f1ff; color: #1768b4; }
.scada-scan-panel.is-success { border-color: #b9dec8; background: #f3fbf6; }
.scada-scan-panel.is-success span { background: #ddf5e7; color: #147942; }
.scada-scan-panel.is-error { border-color: #efc5ca; background: #fff8f8; }
.scada-scan-panel.is-error span { background: #fde7e9; color: #a52b38; }
.scada-manual-message { padding: 11px 13px; border-radius: 7px; background: #fdebed; color: #a52b38; font-size: 12px; font-weight: 650; }
.scada-manual-message.is-success { background: #e7f7ed; color: #147942; }
.scada-manual-actions { position: sticky; bottom: 8px; z-index: 20; display: flex; align-items: center; gap: 10px; padding: 13px 16px; border: 1px solid #bfd5e7; border-radius: var(--radius); background: rgba(255, 255, 255, .97); box-shadow: 0 -7px 22px rgba(34, 57, 82, .13); backdrop-filter: blur(8px); }
.scada-manual-actions-title { color: #35506c; font-size: 12px; font-weight: 800; }
.scada-manual-actions-spacer { flex: 1; }
.scada-manual-confirmed-badge { display: inline-flex; min-height: 36px; align-items: center; padding: 0 13px; border-radius: 999px; background: #e3f7eb; color: #147942; font-size: 11px; font-weight: 800; }
.scada-manual-actions .button { min-height: 40px; }
.scada-manual-actions button:disabled { opacity: .55; cursor: not-allowed; }
.scada-optional-warning { position: fixed; inset: 0; z-index: 1100; display: grid; place-items: center; padding: 18px; }
.scada-optional-warning-backdrop { position: absolute; inset: 0; background: rgba(16, 31, 48, .52); }
.scada-optional-warning-box { position: relative; width: min(520px, 100%); padding: 22px; border-radius: 12px; background: #fff; box-shadow: 0 22px 60px rgba(10, 30, 50, .25); }
.scada-optional-warning-box h3 { margin: 0; color: #173452; font-size: 18px; line-height: 1.4; }
.scada-optional-warning-box p { margin: 10px 0 20px; color: var(--ink-soft); font-size: 13px; line-height: 1.55; }
.scada-optional-warning-box > div { display: flex; justify-content: flex-end; gap: 10px; }
.scada-scan-warning { position: fixed; inset: 0; z-index: 1110; display: grid; place-items: center; padding: 18px; }
.scada-scan-warning-backdrop { position: absolute; inset: 0; background: rgba(16, 31, 48, .52); }
.scada-scan-warning-box { position: relative; width: min(520px, 100%); padding: 22px; border-radius: 12px; background: #fff; box-shadow: 0 22px 60px rgba(10, 30, 50, .25); }
.scada-scan-warning-box h3 { margin: 0; color: #173452; font-size: 18px; line-height: 1.4; }
.scada-scan-warning-box p { margin: 10px 0 20px; color: var(--ink-soft); font-size: 13px; line-height: 1.55; }
.scada-scan-warning-box > div { display: flex; justify-content: flex-end; gap: 10px; }

.scada-shift-closing { display: grid; gap: 14px; }
.scada-shift-header { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 19px 20px; border: 1px solid #bdd4e7; border-radius: var(--radius); background: linear-gradient(135deg, #f5faff, #eaf5ff); box-shadow: var(--shadow); }
.scada-shift-header p, .scada-day-summary header p { margin: 0 0 4px; color: var(--brand); font-size: 11px; font-weight: 850; letter-spacing: .07em; }
.scada-shift-header h3, .scada-day-summary header h3 { margin: 0; color: #173452; font-size: 17px; }
.scada-shift-header div > span { display: block; margin-top: 6px; color: #718296; font-size: 10px; }
.scada-shift-status { display: inline-flex; min-height: 28px; align-items: center; padding: 0 10px; border-radius: 999px; font-size: 10px; font-weight: 850; white-space: nowrap; }
.scada-shift-status.is-open { background: #fff1cf; color: #946000; }
.scada-shift-status.is-production { background: #e2f2ff; color: #1768a7; }
.scada-shift-status.is-no-production { background: #eef0f3; color: #536477; }
.scada-shift-status.is-confirmed { background: #dff5e7; color: #147942; }
.scada-shift-mode { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.scada-shift-mode > span { margin-right: 4px; color: #40566d; font-size: 11px; font-weight: 800; }
.scada-shift-mode button { min-height: 34px; padding: 0 12px; border: 1px solid #cbd7e2; border-radius: 7px; background: #f8fafc; color: #53677d; font: inherit; font-size: 11px; font-weight: 750; cursor: pointer; }
.scada-shift-mode button[aria-pressed="true"] { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.scada-shift-group { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); overflow: hidden; }
.scada-shift-group > header { min-height: 57px; padding: 12px 15px; border-bottom: 1px solid var(--line); background: #f7f9fc; }
.scada-shift-group h4 { margin: 0; color: #193853; font-size: 11px; letter-spacing: .035em; }
.scada-shift-group header p { margin: 5px 0 0; color: #718095; font-size: 10px; line-height: 1.4; }
.scada-shift-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; padding: 15px; }
.scada-shift-group.is-production-flow .scada-shift-fields { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.scada-shift-chemical-layout { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: stretch; }
.scada-shift-group.is-pac-solution { border-color: #acd7df; }
.scada-shift-group.is-pac-solution > header { background: #eef9fb; }
.scada-shift-group.is-pac-stock { border-color: #dfcda8; }
.scada-shift-group.is-pac-stock > header { background: #fff8e9; }
.scada-shift-group.is-pac-stock .scada-shift-fields { grid-template-columns: 1fr; }
.scada-shift-field { min-width: 0; display: grid; gap: 6px; color: #344b62; font-size: 11px; font-weight: 700; }
.scada-shift-control { position: relative; display: block; }
.scada-shift-control input { width: 100%; height: 40px; padding: 0 48px 0 11px; border: 1px solid #cdd7e2; border-radius: 7px; background: #fff; color: #172b42; font: inherit; outline: none; }
.scada-shift-control input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(16, 117, 190, .11); }
.scada-shift-control > span { position: absolute; top: 50%; right: 10px; transform: translateY(-50%); color: #718296; font-size: 10px; pointer-events: none; }
.scada-shift-note { display: grid; gap: 7px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; color: #344b62; font-size: 12px; font-weight: 750; box-shadow: var(--shadow); }
.scada-shift-note textarea { width: 100%; min-height: 88px; padding: 10px 12px; border: 1px solid #cdd7e2; border-radius: 7px; color: #172b42; font: inherit; resize: vertical; outline: none; }
.scada-shift-note textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(16, 117, 190, .11); }
.scada-shift-actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 16px; border: 1px solid #c8d7e4; border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.scada-shift-actions > span { color: #35506c; font-size: 11px; font-weight: 800; }
.scada-shift-actions > div { display: flex; gap: 9px; }
.scada-shift-actions button:disabled { opacity: .62; cursor: not-allowed; }
.scada-shift-confirmed { display: inline-flex; min-height: 36px; align-items: center; padding: 0 13px; border-radius: 999px; background: #dff5e7; color: #147942; font-size: 11px; font-weight: 850; }
.scada-day-summary { margin-top: 4px; padding: 18px; border: 1px solid #bcd8c7; border-radius: var(--radius); background: #f5fbf7; box-shadow: var(--shadow); }
.scada-day-summary > header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 14px; border-bottom: 1px solid #d4e5d9; }
.scada-day-summary > header > span { padding: 5px 8px; border-radius: 999px; background: #e0f1e5; color: #32704b; font-size: 9px; font-weight: 850; }
.scada-day-shifts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 14px 0; padding: 0; list-style: none; }
.scada-day-shifts li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 11px; border: 1px solid #d2e1d7; border-radius: 8px; background: #fff; }
.scada-day-shifts b { color: #355345; font-size: 11px; }
.scada-day-totals { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.scada-day-total { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; padding: 11px 12px; border: 1px solid #d5e3d9; border-radius: 8px; background: rgba(255,255,255,.85); }
.scada-day-total > span { color: #526b5c; font-size: 10px; font-weight: 700; }
.scada-day-total output { color: #1f4932; font-size: 14px; font-weight: 850; white-space: nowrap; }
.scada-day-total output small { margin-left: 5px; color: #718778; font-size: 9px; }

@media (max-width: 760px) {
  .scada-production-grid { grid-template-columns: 1fr; }
  .scada-production-card { grid-template-columns: 44px minmax(0, 1fr); }
  .scada-production-card em { grid-column: 2; justify-self: start; }
  .scada-manual-fields { grid-template-columns: 1fr; padding: 14px; }
  .scada-manual-pair > div { grid-template-columns: 1fr; }
  .scada-scan-panel { grid-template-columns: 1fr; }
  .scada-scan-panel p, .scada-scan-panel > .button { grid-column: 1; grid-row: auto; }
  .scada-scan-panel > .button { width: 100%; }
  .scada-manual-header { align-items: flex-start; }
  .scada-operation-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .scada-operation-tabs button { padding: 0 8px; }
  .scada-manual-actions { bottom: calc(8px + env(safe-area-inset-bottom)); flex-wrap: wrap; }
  .scada-manual-actions-title { width: 100%; }
  .scada-manual-actions-spacer { display: none; }
  .scada-manual-actions .button { flex: 1; }
  .scada-shift-header, .scada-shift-actions, .scada-day-summary > header { align-items: flex-start; flex-direction: column; }
  .scada-shift-mode { align-items: stretch; flex-direction: column; }
  .scada-shift-mode button { width: 100%; }
  .scada-shift-fields, .scada-shift-group.is-production-flow .scada-shift-fields, .scada-shift-chemical-layout, .scada-day-shifts, .scada-day-totals { grid-template-columns: 1fr; }
  .scada-shift-actions > div { width: 100%; }
  .scada-shift-actions .button { flex: 1; }
}

@media (min-width: 761px) and (max-width: 1050px) {
  .scada-manual-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .scada-shift-group.is-production-flow .scada-shift-fields, .scada-day-totals { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .scada-shift-chemical-layout { grid-template-columns: 1fr 1fr; }
  .scada-shift-group.is-pac-stock { grid-column: 1 / -1; }
}
