:root {
  --bg: #f3f5f7;
  --panel: #ffffff;
  --ink: #1f2933;
  --muted: #657483;
  --line: #d8dee6;
  --blue: #1769aa;
  --green: #16803c;
  --red: #bd2b2b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #071322;
  color: var(--ink);
  font-family: "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
}

html,
body {
  height: 100%;
}

body:not(.page-alarm):not(.page-admin):not(.page-program) {
  overflow: hidden;
}

.app-shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  min-height: 100vh;
  height: 100vh;
}

.sidebar {
  background: linear-gradient(180deg, #081724, #132634);
  color: #fff;
  padding: 18px 14px;
  border-right: 1px solid rgba(101, 232, 255, .16);
}

.brand {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 24px;
}

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  background: linear-gradient(135deg, #f08a24, #2f80ed);
}

.brand small {
  display: block;
  color: #b7c2cc;
}

.nav-link {
  color: #c8d1da;
  border-radius: 6px;
  margin-bottom: 4px;
}

.nav-link:hover,
.nav-link.active {
  color: #fff;
  background: linear-gradient(135deg, #0e8ee8, #0ad0bd);
  box-shadow: 0 8px 18px rgba(0, 177, 255, .16);
}

.main {
  min-width: 0;
}

.topbar {
  height: 52px;
  min-height: 52px;
  padding: 7px 18px;
  background: rgba(7, 19, 34, .96);
  border-bottom: 1px solid rgba(101, 232, 255, .18);
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.topbar h1 {
  margin: 0;
  color: #fff;
  font-size: 24px;
  font-weight: 700;
}

.topbar span {
  color: var(--muted);
  font-size: 14px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-chip {
  display: grid;
  gap: 1px;
  min-width: 122px;
  padding: 5px 10px;
  border: 1px solid rgba(103, 222, 255, .24);
  border-radius: 7px;
  background: rgba(4, 20, 34, .76);
}

.user-chip strong {
  color: #ecfbff;
  font-size: 13px;
}

.user-chip span {
  color: #89b9cb;
  font-size: 11px;
}

.logout-link {
  color: #8defff;
  font-weight: 800;
  text-decoration: none;
}

.logout-link:hover {
  color: #fff;
}

.content {
  height: calc(100vh - 52px);
  min-height: 0;
  overflow: hidden;
  padding: 12px 16px;
  background:
    radial-gradient(circle at 12% 8%, rgba(0, 220, 255, .10), transparent 26%),
    radial-gradient(circle at 80% 24%, rgba(22, 128, 255, .10), transparent 30%),
    #071322;
}

.page-alarm .content,
.page-admin .content,
.page-program .content {
  height: auto;
  min-height: calc(100vh - 52px);
  overflow: visible;
}

.status-badge {
  min-width: 76px;
  text-align: center;
  border-radius: 6px;
  padding: 6px 10px;
  font-weight: 700;
}

.status-badge.online {
  color: #fff;
  background: var(--green);
}

.status-badge.offline {
  color: #fff;
  background: var(--red);
}

.page-live-status {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 9px;
}

.page-live-status #timestamp {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border: 1px solid rgba(103, 222, 255, .26);
  border-radius: 6px;
  color: #aeeeff;
  background: rgba(2, 16, 28, .62);
  font-size: 13px;
  font-weight: 800;
}

.page-live-status .status-badge {
  min-width: 68px;
  padding: 6px 10px;
  font-size: 13px;
}

.start-panel {
  position: relative;
  min-height: 260px;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 24px;
  padding: 28px 32px;
  color: #fff;
  border: 1px solid rgba(91, 213, 255, .28);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(4, 13, 24, .92) 0%, rgba(7, 19, 34, .78) 42%, rgba(7, 19, 34, .38) 100%),
    radial-gradient(circle at 18% 18%, rgba(0, 220, 255, .22), transparent 30%),
    url("../img/start-oven-bg.png") center/cover no-repeat;
  box-shadow: inset 0 0 55px rgba(0, 195, 255, .10), 0 16px 32px rgba(0, 0, 0, .22);
}

.start-panel > div:first-child {
  max-width: 720px;
}

.page-start .content {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 12px;
}

.page-start .grid-4 {
  margin-top: 0 !important;
}

.start-panel h2 {
  font-size: 32px;
  margin: 0 0 12px;
}

.company-name {
  margin: 0 0 10px;
  font-size: 22px;
  font-weight: 700;
}

.system-version {
  position: absolute;
  right: 18px;
  bottom: 14px;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .45);
}

.kicker {
  text-transform: uppercase;
  letter-spacing: 0;
  color: #ffcf8a;
  font-weight: 700;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 14px;
}

.metric {
  display: block;
  min-height: 82px;
  padding: 12px;
  border: 1px solid rgba(100, 220, 255, .24);
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(18, 54, 78, .9), rgba(9, 28, 44, .9));
  color: #e8f4ff;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 14px;
}

.metric strong {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
  font-size: 28px;
  line-height: 1.1;
  color: #6ff6ff;
}

.metric strong span {
  display: inline;
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
}

.metric strong em {
  display: inline;
  color: #d4fbff;
  font-size: .58em;
  font-style: normal;
  font-weight: 800;
}

.start-metrics .metric > span {
  color: #fff;
  font-weight: 800;
}

.metric.editor {
  min-height: 92px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0;
}

.status-grid,
.io-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

.status-grid.compact {
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  margin-bottom: 18px;
}

.lamp,
.io-point {
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-left: 6px solid #9aa6b2;
  border-radius: 6px;
  background: #fff;
  font-weight: 700;
}

.lamp.on,
.io-point.on {
  border-left-color: var(--green);
  background: #ecf8f0;
}

.lamp.danger.on {
  border-left-color: var(--red);
  background: #fff0f0;
}

.io-point small {
  display: block;
  color: var(--muted);
  font-weight: 400;
}

.io-point strong {
  display: inline-block;
  min-width: 42px;
  margin-right: 8px;
  font-size: 20px;
}

.section-title {
  margin: 24px 0 12px;
  font-size: 18px;
}

.chart {
  height: 620px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.program-wrap {
  max-height: 62vh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.page-program .tech-page {
  display: grid;
  min-height: calc(100vh - 76px);
  height: auto;
  overflow: visible;
  grid-template-rows: auto auto auto;
  gap: 12px;
}

.page-program .tech-page-head,
.page-program .status-grid.compact {
  margin-bottom: 0;
}

.page-program .program-wrap {
  display: block;
  height: auto;
  max-height: none;
  overflow: visible;
  padding: 10px;
}

.page-program .tech-table th,
.page-program .tech-table td {
  padding: 7px 10px;
  font-size: 14px;
  line-height: 1.25;
}

.page-program .tech-table input {
  height: 38px;
  min-height: 38px;
  padding: 5px 8px;
  font-size: 15px;
}

.page-error .tech-page {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: 10px;
}

.page-error .tech-section {
  min-height: 0;
  margin-top: 0;
  overflow: hidden;
}

.page-error .tech-section h3 {
  min-height: 22px;
  margin: 0 0 4px;
  font-size: 14px;
}

.page-error .metric-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.page-error .error-main-settings .metric-grid {
  grid-template-columns: repeat(2, minmax(220px, 1fr));
}

.page-error .error-main-settings .tech-metric.editor {
  min-height: 50px;
  padding: 5px 8px;
}

.page-error .error-main-settings .input-unit {
  grid-template-columns: 120px 24px;
  justify-content: start;
}

.error-actions {
  display: flex;
  gap: 8px;
}

.page-error .legacy-error-grid {
  grid-template-columns: repeat(8, minmax(0, 1fr));
}

.page-error .legacy-error-settings .tech-metric.editor {
  min-height: 40px;
  padding: 4px 6px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 74px;
  align-items: center;
  gap: 4px;
}

.page-error .legacy-error-settings .tech-metric.editor > span {
  font-size: 12px;
  line-height: 1.1;
}

.page-error .legacy-error-settings .tech-metric input {
  height: 26px;
  min-height: 26px;
  padding: 2px 4px;
}

.error-zone-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  min-height: 0;
}

.error-zone-grid .tech-section {
  display: flex;
  flex-direction: column;
}

.page-error .error-channel-grid {
  grid-template-columns: repeat(7, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  height: auto;
  flex: 1;
  min-height: 0;
  align-content: stretch;
}

.page-error .error-channel-grid .tech-metric.editor {
  min-height: 0;
  height: 100%;
  padding: 5px;
}

.page-error .error-channel-grid .tech-metric.editor > span {
  font-size: 12px;
  white-space: nowrap;
}

.page-error .tech-metric.editor {
  min-height: 70px;
  padding: 8px;
}

.page-error .tech-metric.editor > span {
  color: #fff;
  font-weight: 800;
}

.page-error .tech-metric input {
  height: 30px;
  min-height: 30px;
}

.input-unit {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 24px;
  align-items: center;
  gap: 6px;
}

.input-unit em {
  color: #8cefff;
  font-style: normal;
  font-weight: 800;
}

.program-table {
  margin: 0;
}

.program-table th {
  position: sticky;
  top: 0;
  background: #eef2f6;
  z-index: 1;
}

.table {
  background: #fff;
}

.tech-page {
  color: #e8f4ff;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(7, 19, 34, .98), rgba(11, 36, 52, .96)),
    radial-gradient(circle at 18% 8%, rgba(0, 220, 255, .16), transparent 28%);
  border: 1px solid rgba(91, 213, 255, .28);
  border-radius: 8px;
  box-shadow: inset 0 0 45px rgba(0, 195, 255, .08);
  padding: 12px;
}

.page-alarm .tech-page,
.page-admin .tech-page {
  height: auto;
  overflow: visible;
}

.tech-page-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-bottom: 10px;
  padding: 10px 14px;
  border: 1px solid rgba(94, 225, 255, .28);
  border-radius: 8px;
  background: rgba(9, 28, 44, .78);
}

.tech-page-head h2 {
  margin: 0;
  color: #fff;
  font-size: 26px;
  font-weight: 900;
}

.page-hint {
  color: #9fc3d5;
  font-weight: 800;
}

.tech-section {
  margin-top: 10px;
  padding: 10px;
  border: 1px solid rgba(100, 220, 255, .24);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(18, 54, 78, .72), rgba(9, 28, 44, .82));
}

.tech-section h3 {
  margin: 0 0 8px;
  color: #65e8ff;
  font-size: 16px;
  font-weight: 900;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px;
}

.tech-metric {
  min-height: 74px;
}

.page-io .tech-page {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
}

.page-io .tech-page-head {
  grid-column: 1 / -1;
  margin-bottom: 0;
}

.page-io .tech-section {
  display: flex;
  flex-direction: column;
  min-height: 0;
  margin-top: 0;
  overflow: hidden;
}

.page-io .tech-io-grid {
  flex: 1;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(8, minmax(0, 1fr));
  grid-auto-flow: column;
  gap: 7px;
  min-height: 0;
}

.page-io .io-point {
  min-height: 0;
  height: 100%;
  padding: 6px 8px;
  border-left-width: 4px;
  display: flex;
  align-items: center;
}

.page-io .io-point strong {
  min-width: 34px;
  margin-right: 5px;
  font-size: 16px;
}

.page-io .io-point small {
  display: inline;
  color: #9fc3d5;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
}

.page-monitor .tech-page {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
}

.page-monitor .tech-section {
  min-height: 0;
  margin-top: 0;
  overflow: hidden;
}

.page-monitor .metric-grid {
  gap: 6px;
}

.page-monitor .metric > span {
  color: #fff;
  font-weight: 800;
}

.page-monitor .tech-section:nth-of-type(1) .metric-grid {
  grid-template-columns: repeat(8, minmax(0, 1fr));
}

.page-monitor .tech-section:nth-of-type(2) .metric-grid,
.page-monitor .tech-section:nth-of-type(3) .metric-grid {
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.page-monitor .tech-metric {
  min-height: 54px;
  padding: 7px;
}

.page-monitor .metric strong {
  margin-top: 4px;
  font-size: 21px;
}

.page-monitor .tech-metric em {
  font-size: 14px;
}

.tech-metric em {
  color: #9fc3d5;
  font-size: 18px;
  font-style: normal;
  margin-left: 4px;
}

.tech-metric input,
.tech-table input {
  border: 1px solid rgba(103, 222, 255, .55);
  border-radius: 6px;
  color: #e8fbff;
  background: rgba(2, 15, 26, .78);
  font-weight: 900;
}

.tech-io-grid {
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}

.io-point {
  border-color: rgba(100, 220, 255, .24);
  border-left-color: #607887;
  background: linear-gradient(180deg, rgba(18, 54, 78, .9), rgba(9, 28, 44, .9));
  color: #e8f4ff;
}

.io-point small {
  color: #9fc3d5;
}

.io-point.on {
  color: #061823;
  border-left-color: #35f38a;
  background: #35f38a;
  box-shadow: 0 0 16px rgba(53, 243, 138, .22);
}

.tech-status-grid .lamp,
.status-grid .lamp {
  border-color: rgba(100, 220, 255, .24);
  border-left-color: #607887;
  background: linear-gradient(180deg, rgba(18, 54, 78, .9), rgba(9, 28, 44, .9));
  color: #e8f4ff;
}

.status-grid .lamp.on {
  color: #061823;
  border-left-color: #35f38a;
  background: #35f38a;
}

.tech-table-wrap {
  border-color: rgba(100, 220, 255, .24);
  background: rgba(6, 20, 34, .82);
}

.tech-table {
  --bs-table-bg: transparent;
  --bs-table-color: #e8f4ff;
  --bs-table-striped-bg: rgba(48, 112, 150, .18);
  --bs-table-striped-color: #f2fbff;
  --bs-table-hover-bg: rgba(0, 209, 255, .16);
  --bs-table-hover-color: #ffffff;
  --bs-table-border-color: rgba(100, 220, 255, .18);
  color: #e8f4ff;
  margin-bottom: 0;
  background: rgba(3, 13, 24, .78) !important;
  border-color: rgba(100, 220, 255, .24);
}

.tech-table th {
  color: #8df0ff;
  background: linear-gradient(180deg, rgba(15, 60, 86, .98), rgba(5, 24, 39, .98)) !important;
  border-bottom: 1px solid rgba(117, 235, 255, .42);
  font-weight: 900;
  white-space: nowrap;
}

.tech-table td {
  vertical-align: middle;
  background: rgba(5, 20, 34, .66) !important;
  color: #edfaff;
  border-color: rgba(100, 220, 255, .16);
}

.tech-table tbody tr:nth-child(even) td {
  background: rgba(12, 42, 62, .72) !important;
}

.tech-table tbody tr:hover td {
  background: rgba(0, 177, 225, .20) !important;
}

.tech-table .text-muted {
  color: #9edfff !important;
  font-weight: 800;
  letter-spacing: 0;
}

.btn-primary,
.btn-success,
.btn-outline-primary,
.btn-outline-secondary,
.btn-outline-danger {
  border-radius: 7px;
  font-weight: 800;
}

.operation-hmi {
  display: grid;
  grid-template-columns: minmax(330px, 1fr) 132px minmax(330px, 1fr);
  gap: 8px;
  align-items: stretch;
  background: #f08ce9;
  border: 3px solid #241126;
  padding: 8px;
}

.zone-panel,
.door-panel {
  background-color: #a9c2ff;
  background-image: radial-gradient(rgba(255, 255, 255, .75) 1px, transparent 1px);
  background-size: 24px 24px;
  border: 3px solid #182245;
  padding: 8px;
}

.zone-head {
  display: grid;
  grid-template-columns: 104px 98px minmax(150px, 1fr);
  gap: 6px;
  align-items: center;
}

.zone-title {
  font-size: 44px;
  font-weight: 800;
  line-height: 1;
  color: #000;
}

.zone-title::after {
  content: "";
  display: inline-block;
  width: 40px;
  height: 40px;
  margin-left: 6px;
  border: 4px solid #000;
  vertical-align: middle;
  background: linear-gradient(135deg, transparent 46%, #000 47%, #000 53%, transparent 54%);
}

.hmi-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 84px;
  border: 3px solid #07306d;
  border-radius: 0;
  box-shadow: 4px 4px 0 #07306d;
  color: #000;
  font-size: 24px;
  font-weight: 800;
  line-height: 1.1;
  text-align: center;
  text-decoration: none;
  position: relative;
}

.hmi-button small,
.door-status small,
.door-emergency small,
.temp-title small {
  position: absolute;
  left: 4px;
  top: 3px;
  color: red;
  font-size: 12px;
  font-weight: 700;
}

.hmi-button.cyan {
  background: #39d2e8;
}

.hmi-button.green {
  background: #a7e4a6;
}

.hmi-button.large {
  min-height: 86px;
}

.param-box {
  border: 3px solid #80209a;
  background: #b7c2ff;
  padding: 6px;
  color: #9b0090;
  font-size: 16px;
  font-weight: 700;
}

.param-box label {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 6px;
  white-space: nowrap;
}

.param-box input {
  width: 52px;
  height: 34px;
  border: 2px solid #8aa8ff;
  background: #d9e8ff;
  color: #8a0088;
  font-size: 20px;
  font-weight: 800;
  text-align: center;
}

.mini-save {
  width: 100%;
  border: 2px solid #07306d;
  background: #eef4ff;
  color: #000;
  font-weight: 800;
}

.zone-main {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 10px;
  margin-top: 10px;
}

.zone-actions {
  display: grid;
  gap: 16px;
  align-content: start;
}

.temp-card {
  min-height: 194px;
  background: #72f0c8;
  border: 1px solid #38b48a;
  padding: 8px 12px;
  color: #000;
}

.temp-title {
  position: relative;
  font-size: 28px;
  font-weight: 800;
  padding-left: 8px;
}

.fault {
  display: inline-block;
  min-width: 82px;
  margin-left: 10px;
  padding: 4px 8px;
  background: #ff92d8;
  color: #000;
  font-size: 15px;
  vertical-align: middle;
}

.fault.on {
  background: #ff3333;
  color: #fff;
}

.temp-value {
  margin: 8px 20px 2px;
  border-bottom: 3px solid #ff164d;
  color: #9100a8;
  font-size: 72px;
  font-weight: 900;
  line-height: 1;
  text-align: center;
}

.segment {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  font-size: 30px;
  font-weight: 800;
}

.timer-row {
  display: grid;
  grid-template-columns: auto 1fr auto 1fr;
  gap: 8px;
  align-items: center;
  margin: 12px 0;
  color: #a100a8;
  font-size: 24px;
  font-weight: 800;
}

.timer-row strong {
  color: #8b00a5;
  background: #d9e8ff;
  border: 1px solid #7ea3ff;
  padding: 2px 8px;
  text-align: center;
}

.channel-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 14px;
}

.channel {
  display: grid;
  grid-template-columns: 38px 38px minmax(82px, 1fr);
  align-items: center;
  gap: 6px;
  color: #000;
  font-size: 24px;
  font-weight: 800;
}

.channel strong {
  display: block;
  background: #9fc2ed;
  border: 1px solid #223d68;
  padding: 2px 8px;
  text-align: center;
}

.lamp.round {
  width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  border: 3px solid #7c7c7c;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 28%, #f7f7f7, #333 42%, #161616 70%);
  box-shadow: inset -3px -4px 5px rgba(0, 0, 0, .45);
}

.lamp.round.on {
  border-color: #14a34a;
  background: radial-gradient(circle at 35% 28%, #edfff2, #1fd15a 42%, #087c2e 75%);
}

.lamp.mini {
  min-height: 38px;
  padding: 6px 12px;
  border-left-width: 4px;
  font-size: 16px;
}

.door-panel {
  display: grid;
  grid-template-rows: 74px 32px 74px 1fr 50px 50px;
  gap: 8px;
  background-color: #f8b6c6;
}

.door-status,
.door-emergency {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #0087aa;
  background: #39d2e8;
  color: #000;
  font-size: 22px;
  font-weight: 800;
  text-align: center;
}

.door-status.on,
.door-emergency.on {
  background: #38e06c;
}

.door-note {
  color: #9b0090;
  font-size: 22px;
  font-weight: 800;
  text-align: center;
}

.door-emergency {
  min-height: 150px;
  align-self: stretch;
  font-size: 30px;
}

.door-emergency.on {
  background: #ff3333;
  color: #fff;
}

.limit-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #a00000;
  font-size: 22px;
  font-weight: 800;
}

.operation-console {
  color: #e8f4ff;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(135deg, rgba(7, 19, 34, .98), rgba(11, 36, 52, .96)),
    radial-gradient(circle at 20% 10%, rgba(0, 220, 255, .18), transparent 30%),
    radial-gradient(circle at 80% 30%, rgba(22, 128, 255, .14), transparent 32%);
  border: 1px solid rgba(91, 213, 255, .28);
  border-radius: 8px;
  box-shadow: inset 0 0 45px rgba(0, 195, 255, .08);
  padding: 12px;
}

.op-hero {
  display: grid;
  grid-template-columns: minmax(260px, .7fr) minmax(420px, 1.3fr);
  gap: 14px;
  align-items: center;
  margin-bottom: 10px;
  padding: 10px 14px;
  border: 1px solid rgba(94, 225, 255, .28);
  border-radius: 8px;
  background: rgba(9, 28, 44, .78);
}

.op-kicker,
.zone-chip {
  margin: 0 0 4px;
  color: #65e8ff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

.op-hero h2,
.op-zone-head h3 {
  margin: 0;
  color: #fff;
  font-weight: 900;
}

.op-hero h2 {
  font-size: 26px;
}

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

.op-summary div,
.big-temp,
.op-param-box,
.op-timer-box,
.temp-channel,
.safety-card,
.limit-card {
  border: 1px solid rgba(100, 220, 255, .26);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(18, 54, 78, .9), rgba(9, 28, 44, .9));
  box-shadow: 0 10px 24px rgba(0, 0, 0, .22), inset 0 1px 0 rgba(255, 255, 255, .06);
}

.op-summary div {
  min-height: 74px;
  padding: 12px 14px;
}

.op-summary span,
.big-temp span,
.op-timer-box span {
  display: block;
  color: #9fc3d5;
  font-size: 13px;
  font-weight: 700;
}

.big-temp > span {
  font-size: 16px;
}

.op-summary strong {
  display: inline;
  color: #5ef0ff;
  font-size: 28px;
  line-height: 1;
}

.op-summary em {
  color: #9fc3d5;
  font-style: normal;
  margin-left: 3px;
}

.op-grid {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) 138px minmax(360px, 1fr);
  gap: 12px;
  flex: 1;
  align-items: stretch;
}

.op-zone {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(80, 218, 255, .32);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(11, 39, 59, .9), rgba(7, 22, 36, .96)),
    repeating-linear-gradient(90deg, rgba(255,255,255,.04) 0 1px, transparent 1px 48px);
  height: 680px;
  min-height: 680px;
}

.op-zone-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 0;
}

.op-zone-head h3 {
  font-size: 28px;
}

.op-statusline {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 3px 7px;
  border: 1px solid rgba(117, 150, 166, .6);
  border-radius: 6px;
  color: #98afbd;
  background: rgba(19, 31, 43, .88);
  font-size: 12px;
  font-weight: 800;
}

.status-pill.on {
  color: #05140c;
  border-color: #35f38a;
  background: #35f38a;
  box-shadow: 0 0 16px rgba(53, 243, 138, .32);
}

.status-pill.danger.on {
  color: #fff;
  border-color: #ff4d63;
  background: #d93045;
  box-shadow: 0 0 16px rgba(255, 77, 99, .34);
}

.status-pill.status-error.on {
  color: #3b071f;
  border-color: #ff85bd;
  background: #ff85bd;
  box-shadow: 0 0 16px rgba(255, 133, 189, .4);
}

.status-pill.status-out1.on {
  color: #fff;
  border-color: #ff334f;
  background: #d71937;
  box-shadow: 0 0 16px rgba(255, 51, 79, .4);
}

.status-pill.status-out2.on {
  color: #241b00;
  border-color: #ffd84a;
  background: #ffd84a;
  box-shadow: 0 0 16px rgba(255, 216, 74, .42);
}

.op-control-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 0;
}

.tech-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 8px 10px;
  border: 1px solid rgba(98, 222, 255, .5);
  border-radius: 8px;
  color: #f4fbff;
  background: rgba(18, 52, 75, .92);
  font-size: 16px;
  font-weight: 900;
  text-align: center;
  text-decoration: none;
}

.tech-button small {
  position: absolute;
  left: 8px;
  top: 6px;
  color: #8cefff;
  font-size: 11px;
}

.tech-button.primary {
  background: linear-gradient(135deg, #0e8ee8, #0ad0bd);
  box-shadow: 0 8px 20px rgba(0, 177, 255, .18);
}

.tech-button.cyan {
  background: linear-gradient(135deg, #0a6079, #16c6e8);
}

.tech-button.on {
  color: #03150d;
  border-color: #69ffae;
  background: linear-gradient(135deg, #35f38a, #62f7dc);
  box-shadow: 0 0 20px rgba(53, 243, 138, .52), inset 0 1px 0 rgba(255, 255, 255, .38);
}

.tech-button.on small {
  color: #073821;
}

.tech-button.soft {
  background: linear-gradient(135deg, rgba(54, 243, 139, .85), rgba(63, 206, 255, .82));
  color: #061823;
}

.op-metrics {
  display: grid;
  grid-template-columns: 1.1fr .95fr .95fr;
  gap: 9px;
  margin-bottom: 0;
  height: 220px;
}

.big-temp {
  min-height: 140px;
  padding: 12px;
}

.big-temp strong {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 5px;
  color: #6ff6ff;
  font-size: 48px;
  line-height: 1;
}

.big-temp strong span {
  display: inline;
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
}

.big-temp em {
  color: #d4fbff;
  font-size: 22px;
  font-style: normal;
  margin-left: 4px;
}

.big-temp small {
  color: #9fc3d5;
  font-size: 18px;
  font-weight: 700;
}

.big-temp small b {
  color: #f4fbff;
  font-size: 22px;
}

.op-param-box {
  min-height: 140px;
  padding: 12px;
}

.op-param-box label {
  display: grid;
  grid-template-columns: 1fr 66px 22px;
  gap: 6px;
  align-items: center;
  color: #bfd7e4;
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 7px;
}

.op-param-box input {
  width: 66px;
  height: 32px;
  border: 1px solid rgba(103, 222, 255, .55);
  border-radius: 6px;
  color: #e8fbff;
  background: rgba(2, 15, 26, .78);
  text-align: center;
  font-weight: 900;
}

.op-param-box em {
  color: #8cefff;
  font-style: normal;
}

.save-button {
  width: 100%;
  min-height: 32px;
  border: 0;
  border-radius: 6px;
  color: #061823;
  background: #61e8ff;
  font-weight: 900;
}

.op-timer-box {
  display: grid;
  gap: 7px;
  min-height: 140px;
  padding: 12px;
}

.op-timer-box strong {
  display: block;
  margin-top: 4px;
  color: #f6fdff;
  font-size: 18px;
}

.op-timer-box strong span {
  display: inline;
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
}

.temp-channel-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(72px, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 0;
  flex: 1;
  min-height: 120px;
}

.temp-channel {
  min-height: 0;
  padding: 6px 6px;
  position: relative;
  overflow: hidden;
}

.temp-channel::before {
  content: "";
  position: absolute;
  inset: 0;
  border-top: 2px solid rgba(101, 232, 255, .55);
  opacity: .7;
}

.temp-channel .channel-index {
  display: block;
  color: #88eaff;
  font-size: 17px;
  line-height: 1;
  font-weight: 900;
}

.temp-reading {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
}

.temp-reading strong {
  display: inline;
  color: #fff;
  font-size: 24px;
  line-height: 1.15;
}

.temp-reading em {
  color: #8faebd;
  font-style: normal;
  font-weight: 800;
}

.safety-spine {
  display: grid;
  grid-template-rows: 76px 26px 76px minmax(150px, 1fr) 52px 52px;
  gap: 8px;
  min-height: 0;
}

.safety-card,
.limit-card {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  color: #bfd7e4;
  font-weight: 900;
  min-height: 0;
  height: 100%;
}

button.safety-card {
  width: 100%;
  padding: 0;
  font: inherit;
  cursor: pointer;
}

.safety-card small {
  position: absolute;
  left: 8px;
  top: 7px;
  color: #8cefff;
  font-size: 11px;
}

.safety-card.on,
.limit-card.on {
  color: #05140c;
  border-color: #35f38a;
  background: #35f38a;
}

.safety-card.emergency {
  font-size: 23px;
}

.safety-card.emergency.on {
  color: #fff;
  border-color: #ff4d63;
  background: #d93045;
}

.hold-note {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #65e8ff;
  font-weight: 900;
}

.limit-card {
  gap: 8px;
  font-size: 15px;
}

.limit-card span {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #6c7d88;
}

.limit-card.on span {
  background: #05140c;
}

.trend-console {
  color: #e8f4ff;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(135deg, rgba(7, 19, 34, .98), rgba(11, 36, 52, .96)),
    radial-gradient(circle at 18% 8%, rgba(0, 220, 255, .16), transparent 28%);
  border: 1px solid rgba(91, 213, 255, .28);
  border-radius: 8px;
  padding: 12px;
}

.trend-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-bottom: 10px;
}

.trend-toolbar h2 {
  margin: 0;
  color: #fff;
  font-size: 30px;
  font-weight: 900;
}

.trend-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.trend-report-fields {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.trend-report-fields label {
  color: #9fc3d5;
  font-size: 12px;
  font-weight: 800;
}

.trend-report-fields .form-control {
  width: 140px;
  height: 32px;
  margin-top: 3px;
  color: #eafaff;
  border-color: rgba(103, 222, 255, .42);
  background: rgba(3, 17, 30, .92);
}

.trend-querybar {
  display: grid;
  grid-template-columns: 132px 210px 210px 72px minmax(120px, 1fr);
  gap: 8px;
  align-items: end;
  margin-bottom: 10px;
}

.trend-querybar label {
  color: #9fc3d5;
  font-size: 12px;
  font-weight: 800;
}

.trend-querybar .form-select,
.trend-querybar .form-control {
  height: 34px;
  color: #eafaff;
  border-color: rgba(103, 222, 255, .42);
  background-color: rgba(3, 17, 30, .92);
  font-size: 13px;
}

.trend-query-status {
  align-self: center;
  color: #65e8ff;
  font-size: 12px;
  font-weight: 800;
  text-align: right;
}

.trend-layout {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 14px;
  flex: 1;
  min-height: 0;
}

.channel-picker {
  max-height: none;
  height: 100%;
  overflow: auto;
  padding: 10px;
  border: 1px solid rgba(100, 220, 255, .26);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(18, 54, 78, .9), rgba(9, 28, 44, .9));
}

.channel-picker section + section {
  margin-top: 10px;
}

.channel-picker h3 {
  margin: 0 0 7px;
  color: #65e8ff;
  font-size: 16px;
  font-weight: 900;
}

.picker-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
}

.channel-option {
  display: grid;
  grid-template-columns: 18px 1fr 34px;
  align-items: center;
  gap: 7px;
  min-height: 29px;
  padding: 4px 6px;
  border: 1px solid rgba(100, 220, 255, .18);
  border-radius: 6px;
  background: rgba(4, 18, 30, .62);
  color: #d9f7ff;
  font-size: 12px;
  font-weight: 800;
}

.channel-option input[type="checkbox"] {
  width: 16px;
  height: 16px;
}

.channel-option input[type="color"] {
  width: 32px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
}

.pressure-option {
  border-color: rgba(255, 205, 74, .28);
}

.setpoint-option {
  border-color: rgba(255, 234, 0, .42);
  background: rgba(66, 56, 4, .34);
}

.trend-chart {
  min-height: 0;
  height: 100%;
  border-color: rgba(100, 220, 255, .24);
  background: rgba(6, 20, 34, .82);
}

.log-filter {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.log-filter .form-select {
  max-width: 220px;
  color: #eafaff;
  border-color: rgba(103, 222, 255, .42);
  background-color: rgba(3, 17, 30, .92);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .03);
}

.log-filter .form-select:focus {
  color: #ffffff;
  border-color: rgba(112, 235, 255, .82);
  background-color: rgba(4, 24, 40, .96);
  box-shadow: 0 0 0 .18rem rgba(0, 209, 255, .18);
}

.log-level {
  display: inline-block;
  min-width: 54px;
  padding: 2px 7px;
  border-radius: 5px;
  border: 1px solid rgba(122, 231, 255, .34);
  background: rgba(15, 80, 112, .88);
  color: #dffaff;
  font-weight: 800;
  text-align: center;
}

.log-level.error {
  border-color: rgba(255, 107, 107, .55);
  background: rgba(142, 24, 35, .92);
  color: #ffe6e6;
}

.log-level.warning,
.log-level.warn {
  border-color: rgba(255, 201, 92, .55);
  background: rgba(126, 83, 11, .92);
  color: #fff2c2;
}

.log-level.info {
  border-color: rgba(78, 228, 255, .50);
  background: rgba(8, 89, 121, .92);
  color: #dffaff;
}

.log-details {
  max-width: 360px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.login-body {
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(4, 13, 24, .96), rgba(7, 19, 34, .76)),
    url("../img/start-oven-bg.png") center/cover no-repeat;
}

.login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 42px;
}

.login-panel {
  width: min(460px, 100%);
  padding: 34px;
  border: 1px solid rgba(103, 222, 255, .32);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(10, 34, 54, .92), rgba(4, 17, 30, .94));
  box-shadow: 0 24px 60px rgba(0, 0, 0, .36), inset 0 0 34px rgba(0, 213, 255, .08);
}

.login-panel h1 {
  margin: 0 0 8px;
  color: #fff;
  font-size: 34px;
  font-weight: 900;
}

.login-panel p {
  color: #a8d9ea;
}

.login-form {
  display: grid;
  gap: 14px;
  margin-top: 24px;
}

.login-form label {
  display: grid;
  gap: 7px;
  color: #9ef5ff;
  font-weight: 800;
}

.login-form .form-control,
.admin-console .form-control,
.admin-console .form-select {
  color: #eefcff;
  border-color: rgba(103, 222, 255, .38);
  background-color: rgba(3, 17, 30, .86);
}

.login-form .form-control:focus,
.admin-console .form-control:focus,
.admin-console .form-select:focus {
  color: #fff;
  border-color: rgba(112, 235, 255, .82);
  background-color: rgba(4, 24, 40, .96);
  box-shadow: 0 0 0 .18rem rgba(0, 209, 255, .18);
}

.login-error {
  padding: 10px 12px;
  color: #ffe6e6;
  border: 1px solid rgba(255, 107, 107, .46);
  border-radius: 7px;
  background: rgba(142, 24, 35, .58);
}

.login-version {
  display: block;
  margin-top: 18px;
  color: #7faec0;
}

.admin-form-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 10px;
}

.admin-form-grid.compact {
  grid-template-columns: minmax(160px, 220px) minmax(220px, 1fr) auto;
}

.role-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
}

.role-check,
.permission-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #e8f7ff;
}

.admin-actions {
  display: flex;
  gap: 8px;
  white-space: nowrap;
}

.role-permission-layout {
  display: grid;
  gap: 14px;
}

.role-card {
  padding: 14px;
  border: 1px solid rgba(103, 222, 255, .22);
  border-radius: 8px;
  background: rgba(2, 13, 24, .58);
}

.role-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.role-card-head strong {
  display: block;
  color: #fff;
  font-size: 18px;
}

.role-card-head span {
  color: #91bdcc;
}

.permission-group {
  margin-top: 10px;
}

.permission-group h4 {
  color: #7deeff;
  font-size: 15px;
  font-weight: 900;
}

.permission-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 8px;
}

.permission-check {
  align-items: flex-start;
  flex-direction: column;
  gap: 2px;
  min-height: 70px;
  padding: 9px;
  border: 1px solid rgba(103, 222, 255, .16);
  border-radius: 7px;
  background: rgba(5, 24, 39, .70);
}

.permission-check input {
  align-self: flex-start;
}

.permission-check span {
  color: #ecfbff;
  font-weight: 800;
}

.permission-check small {
  color: #7caec1;
}

.permission-disabled {
  cursor: not-allowed !important;
  opacity: .46 !important;
}

.forbidden-panel {
  max-width: 680px;
}

.forbidden-panel p {
  color: #b8d8e4;
}

.tech-page .tech-section {
  box-shadow: inset 0 0 24px rgba(0, 213, 255, .07), 0 10px 26px rgba(0, 0, 0, .20);
}

.tech-page .tech-section h3 {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 3px 0 10px;
  color: #9ef5ff;
  text-shadow: 0 0 14px rgba(0, 213, 255, .30);
}

.tech-page .tech-section h3::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #27e8ff;
  box-shadow: 0 0 14px rgba(39, 232, 255, .86);
}

.tech-page .table-responsive {
  border: 1px solid rgba(100, 220, 255, .22);
  border-radius: 7px;
  background: rgba(1, 10, 18, .72);
  box-shadow: inset 0 0 22px rgba(0, 213, 255, .06);
}

@media (max-width: 1350px) {
  .operation-hmi {
    grid-template-columns: minmax(300px, 1fr) 124px minmax(300px, 1fr);
    gap: 6px;
    padding: 6px;
  }

  .zone-panel,
  .door-panel {
    padding: 6px;
  }

  .zone-head {
    grid-template-columns: 92px 90px minmax(136px, 1fr);
  }

  .zone-title {
    font-size: 40px;
  }

  .hmi-button {
    font-size: 22px;
  }

  .zone-main {
    grid-template-columns: 130px 1fr;
  }

  .channel-grid {
    grid-template-columns: 1fr;
  }

  .op-grid {
    grid-template-columns: minmax(320px, 1fr) 128px minmax(320px, 1fr);
  }

  .op-metrics {
    grid-template-columns: 1.05fr .95fr .95fr;
    gap: 10px;
  }

  .temp-channel-grid {
    grid-template-columns: repeat(7, minmax(50px, 1fr));
    gap: 8px;
  }

  .temp-channel {
    min-height: clamp(56px, 6.2vh, 74px);
    padding: 6px 5px;
  }

  .temp-reading strong {
    font-size: 20px;
  }

  .temp-channel .channel-index {
    font-size: 15px;
  }

  .big-temp,
  .op-param-box,
  .op-timer-box {
    min-height: 110px;
    padding: 10px;
  }

  .big-temp strong {
    font-size: 44px;
  }

  .op-param-box label {
    grid-template-columns: 1fr 62px 20px;
    gap: 5px;
    font-size: 12px;
    margin-bottom: 6px;
  }

  .op-param-box input {
    width: 62px;
    height: 30px;
  }

  .op-timer-box strong {
    font-size: 17px;
  }
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .grid-4 {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
  }

  .start-panel {
    align-items: flex-start;
    flex-direction: column;
  }

  .op-hero,
  .op-zone-head {
    flex-direction: column;
  }

  .op-summary {
    min-width: 0;
    width: 100%;
  }

  .op-grid {
    grid-template-columns: 1fr;
  }

  .safety-spine {
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: auto;
  }
}

@media (max-width: 560px) {
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .content,
  .topbar {
    padding-left: 14px;
    padding-right: 14px;
  }

  .op-summary {
    grid-template-columns: 1fr;
  }

  .temp-channel-grid {
    grid-template-columns: repeat(2, minmax(92px, 1fr));
  }
}
