:root {
  --bg: #eef0f2;
  --panel: #ffffff;
  --panel-strong: #f5f6f7;
  --ink: #0f1113;
  --muted: #5f666c;
  --line: #d9dde1;
  --brand: #111111;
  --brand-dark: #000000;
  --accent: #111111;
  --steel: #252b30;
  --steel-soft: #3c454c;
  --green: #15803d;
  --yellow: #b7791f;
  --red: #b91c1c;
  --shadow: 0 18px 34px rgba(15, 17, 19, 0.08);
  --shadow-raised: 0 24px 46px rgba(15, 17, 19, 0.18), 0 8px 16px rgba(15, 17, 19, 0.1);
  --shadow-card-3d: 0 34px 58px rgba(15, 17, 19, 0.22), 0 14px 24px rgba(15, 17, 19, 0.13);
  --shadow-button: 0 10px 18px rgba(15, 17, 19, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  --surface-3d: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, #ffffff 42%, #f2f5f7 100%);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: Arial, Helvetica, sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #ffffff 0%, #f1f2f3 48%, #dfe3e6 100%);
}

.login-panel {
  width: 440px;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  box-shadow: var(--shadow-raised);
}

.login-brand {
  display: grid;
  gap: 12px;
  text-align: center;
}

.login-brand > div {
  position: relative;
  display: grid;
  gap: 5px;
  padding: 6px 12px 0;
  background: transparent;
}

.login-brand > div::before {
  content: "";
  width: 46px;
  height: 2px;
  justify-self: center;
  margin-bottom: 4px;
  border-radius: 999px;
  background: #1f2327;
}

.login-logo {
  width: 206px;
  height: 154px;
  margin: 0 auto;
  object-fit: contain;
}

.login-brand strong {
  display: block;
  font-size: 20px;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: 0;
}

.login-brand span {
  display: block;
  margin-top: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: 0;
}

.brand-stack {
  display: grid;
  gap: 14px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo {
  width: 42px;
  height: 42px;
  display: block;
  object-fit: contain;
  mix-blend-mode: multiply;
}

.brand-lockup strong {
  display: block;
  font-size: 16px;
  letter-spacing: 0.08em;
}

.brand-lockup span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.client-brand-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 12px;
  border: 1px solid #eef1f3;
  border-bottom-color: #aeb7bf;
  border-radius: 7px;
  background: var(--surface-3d);
  box-shadow: 0 16px 28px rgba(15, 17, 19, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.96);
}

.client-brand-slot img {
  max-width: 100%;
  max-height: 64px;
  object-fit: contain;
}

.login-form {
  display: grid;
  gap: 16px;
  margin-top: 28px;
}

.login-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

.login-form input,
.topbar select {
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
}

.login-form button {
  height: 44px;
  border: 0;
  border-radius: 4px;
  color: #fff;
  background: linear-gradient(180deg, #24282b, #050505);
  font-weight: 700;
}

.form-error {
  min-height: 18px;
  margin: 0;
  color: var(--red);
  font-size: 13px;
}

.app-shell {
  min-height: 100vh;
  min-width: 1180px;
  display: grid;
  grid-template-columns: 252px 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  padding: 22px 18px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 10px 0 26px rgba(15, 17, 19, 0.04);
}

.nav-list {
  display: grid;
  gap: 8px;
  margin-top: 34px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.nav-item,
.logout-button,
.icon-button {
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 46px;
  padding: 0 11px;
  border-color: #d4d8dc;
  border-bottom-color: #aeb4ba;
  text-align: left;
  color: #353a3f;
  background: linear-gradient(180deg, #ffffff 0%, #f4f5f6 52%, #e3e7ea 100%);
  box-shadow: var(--shadow-button);
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease, background 120ms ease;
}

.nav-item.active {
  border-color: #111111;
  border-bottom-color: #000000;
  background: linear-gradient(180deg, #2a2e31 0%, #121416 58%, #050505 100%);
  color: #ffffff;
  box-shadow: 0 16px 24px rgba(15, 17, 19, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.22);
  font-weight: 700;
}

.nav-item.active .nav-icon {
  color: #111111;
  background: #ffffff;
}

.nav-item:not(.active):hover {
  border-color: #9da4aa;
  background: linear-gradient(180deg, #ffffff 0%, #f8f9fa 48%, #dfe4e7 100%);
  color: var(--brand-dark);
  font-weight: 700;
  transform: translateY(-1px);
  box-shadow: 0 14px 24px rgba(15, 17, 19, 0.18), inset 0 1px 0 #ffffff;
}

.nav-item:active,
.logout-button:active,
.icon-button:active {
  transform: translateY(1px);
  box-shadow: inset 0 2px 6px rgba(15, 17, 19, 0.18);
}

.nav-icon {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 4px;
  color: #fff;
  background: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

.logout-button {
  height: 42px;
  margin-top: auto;
  border-color: #d4d8dc;
  border-bottom-color: #aeb4ba;
  background: linear-gradient(180deg, #ffffff 0%, #f4f5f6 55%, #e4e8eb 100%);
  box-shadow: var(--shadow-button);
  font-weight: 700;
}

.logout-button:hover,
.nav-item:hover,
.icon-button:hover {
  border-color: #111111;
}

.workspace {
  position: relative;
  isolation: isolate;
  padding: 24px 30px 42px;
}

.workspace::before {
  content: "";
  position: fixed;
  inset: 0 0 0 252px;
  background:
    linear-gradient(rgba(244, 245, 246, 0.42), rgba(244, 245, 246, 0.42)),
    url("/assets/gandara-background-3d.jpg") center 46% / cover no-repeat;
  pointer-events: none;
  z-index: 0;
}

.workspace > * {
  position: relative;
  z-index: 1;
}

.topbar,
.status-strip,
.section-heading,
.chart-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar {
  gap: 20px;
  min-height: 92px;
  padding: 18px 20px;
  border: 1px solid rgba(5, 5, 5, 0.65);
  border-radius: 6px;
  color: #ffffff;
  background: linear-gradient(135deg, #24282b 0%, #111315 58%, #050505 100%);
  box-shadow: 0 26px 54px rgba(15, 17, 19, 0.28), 0 8px 18px rgba(15, 17, 19, 0.16);
}

.eyebrow {
  margin: 0 0 6px;
  color: #c4c9ce;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 28px;
  letter-spacing: 0;
}

h2 {
  font-size: 21px;
  letter-spacing: 0;
}

h3 {
  font-size: 15px;
  letter-spacing: 0;
}

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

.machine-select {
  min-width: 230px;
}

.icon-button {
  width: 42px;
  height: 42px;
  border-color: rgba(255, 255, 255, 0.25);
  background: #fff;
  font-size: 20px;
}

.status-strip {
  margin-top: 14px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-left: 5px solid #111111;
  border-radius: 6px;
  background: var(--panel);
  box-shadow: 0 12px 24px rgba(15, 17, 19, 0.04);
}

.equipment-block span,
.last-update span,
.metric-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.equipment-block strong,
.last-update strong {
  display: block;
  margin-top: 4px;
  font-size: 14px;
}

.status-pill {
  min-width: 184px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 9px 14px;
  border-radius: 999px;
  background: rgba(21, 128, 61, 0.1);
  color: var(--green);
}

.status-pill span {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: currentColor;
}

.status-pill.warning {
  background: rgba(183, 121, 31, 0.12);
  color: var(--yellow);
}

.status-pill.critical {
  background: rgba(185, 28, 28, 0.12);
  color: var(--red);
}

.executive-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(430px, 0.85fr);
  gap: 14px;
  margin-top: 16px;
}

.executive-status,
.kpi-tile {
  border: 1px solid #eef1f3;
  border-bottom-color: #aeb7bf;
  border-radius: 6px;
  box-shadow: var(--shadow-card-3d);
}

.executive-status {
  position: relative;
  min-height: 212px;
  display: grid;
  align-content: space-between;
  gap: 18px;
  padding: 20px;
  color: #ffffff;
  background: linear-gradient(135deg, #202529 0%, #101214 72%, #050505 100%);
  overflow: hidden;
}

.executive-status::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), inset 0 -2px 0 rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

.executive-head,
.executive-main,
.machine-facts,
.executive-kpis {
  display: grid;
}

.executive-head {
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
}

.executive-head span,
.machine-facts span,
.kpi-tile span {
  color: #aeb5bb;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.executive-head strong {
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  color: #ffffff;
  font-size: 12px;
}

.executive-main {
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 14px;
}

.executive-main strong {
  display: block;
  font-size: 42px;
  line-height: 1;
}

.executive-main p {
  max-width: 720px;
  margin-top: 8px;
  color: #d7dce0;
  font-size: 14px;
  line-height: 1.35;
}

.executive-signal {
  width: 58px;
  height: 58px;
  border: 8px solid currentColor;
  border-radius: 999px;
  color: var(--green);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 8px rgba(255, 255, 255, 0.05);
}

.executive-signal.warning {
  color: var(--yellow);
}

.executive-signal.critical {
  color: var(--red);
}

.machine-facts {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.machine-facts strong {
  display: block;
  margin-top: 5px;
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

.executive-kpis {
  grid-template-columns: repeat(auto-fit, minmax(154px, 1fr));
  gap: 12px;
}

.kpi-tile {
  position: relative;
  min-height: 100px;
  padding: 15px;
  background: var(--surface-3d);
  overflow: hidden;
}

.kpi-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.98), inset 0 -2px 0 rgba(15, 17, 19, 0.08);
  pointer-events: none;
}

.kpi-tile span {
  color: var(--muted);
}

.kpi-tile strong {
  display: block;
  margin-top: 12px;
  font-size: 27px;
  line-height: 1;
}

.kpi-tile small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.kpi-tile-actions {
  min-height: 128px;
}

.reset-hours-button,
.reset-maintenance-button {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 34px;
  margin-top: 12px;
  border: 1px solid #d6dce1;
  border-bottom-color: #9da6ad;
  border-radius: 6px;
  color: var(--ink);
  background: linear-gradient(180deg, #ffffff 0%, #f6f8f9 45%, #dfe5e9 100%);
  box-shadow: var(--shadow-button);
  font-size: 12px;
  font-weight: 800;
}

.reset-hours-button:hover {
  border-color: #111111;
  background: linear-gradient(180deg, #ffffff 0%, #f2f4f5 42%, #cfd7dd 100%);
}

.reset-hours-button:active {
  transform: translateY(1px);
  box-shadow: inset 0 2px 6px rgba(15, 17, 19, 0.18);
}

.machine-info-card {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid #eef1f3;
  border-bottom-color: #aeb7bf;
  border-radius: 6px;
  background: var(--surface-3d);
  box-shadow: var(--shadow-card-3d);
}

.machine-info-card span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.machine-info-card strong {
  display: block;
  margin-top: 6px;
  font-size: 14px;
}

.tab-panel {
  margin-top: 24px;
}

.section-heading {
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.section-heading span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.section-heading p {
  color: var(--muted);
  font-size: 13px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}

.metric-grid.compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.health-factor-grid {
  align-self: stretch;
}

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

.metric-card,
.chart-card,
.gauge-card {
  border: 1px solid #eef1f3;
  border-bottom-color: #aeb7bf;
  border-radius: 6px;
  background: var(--surface-3d);
  box-shadow: var(--shadow-card-3d);
  position: relative;
  overflow: hidden;
  transform: translateZ(0);
}

.metric-card::after,
.chart-card::after,
.gauge-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.98), inset 0 -2px 0 rgba(15, 17, 19, 0.08);
  pointer-events: none;
}

.metric-card {
  min-height: 112px;
  padding: 16px;
}

.metric-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: #111111;
  display: none;
}

.metric-card strong {
  display: block;
  margin-top: 12px;
  font-size: 25px;
  letter-spacing: 0;
}

.metric-card small {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
}

.metric-card-actions {
  min-height: 142px;
}

.metric-card.warning {
  border-color: rgba(183, 121, 31, 0.4);
}

.metric-card.warning::before {
  background: var(--yellow);
  display: block;
}

.metric-card.critical {
  border-color: rgba(185, 28, 28, 0.45);
}

.metric-card.critical::before {
  background: var(--red);
  display: block;
}

.metric-card.warning strong,
.event-value.warning {
  color: var(--yellow);
}

.metric-card.critical strong,
.event-value.critical {
  color: var(--red);
}

.metric-card.missing {
  background: linear-gradient(180deg, #fbfbfb 0%, #f8f8f8 45%, #eceff1 100%);
  color: #777777;
}

.health-factor small:last-child {
  color: #5f6a72;
  font-size: 11px;
}

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

.raw-charts {
  grid-template-columns: 1fr 1fr;
}

.chart-card {
  min-height: 322px;
  padding: 16px;
  border-top: 1px solid #ffffff;
}

.chart-card header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3px 12px;
  align-items: start;
  min-height: 44px;
  margin-bottom: 10px;
}

.chart-card header h3 {
  line-height: 1.2;
}

.chart-card header small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.chart-meta {
  max-width: 100%;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chart-controls {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  grid-column: 2;
  grid-row: 1 / span 2;
}

.chart-controls button {
  min-width: 30px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #ffffff;
  color: #111111;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.chart-controls button:hover {
  border-color: #111111;
  background: #f4f4f4;
}

.line-chart {
  width: 100%;
  height: 248px;
  display: block;
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.line-chart:active {
  cursor: grabbing;
}

.chart-axis {
  stroke: #cfcfcf;
  stroke-width: 1;
}

.chart-gridline {
  stroke: #ededed;
  stroke-width: 1;
}

.chart-state-band {
  opacity: 0.38;
  pointer-events: none;
}

.chart-state-strip {
  opacity: 0.88;
  pointer-events: none;
}

.chart-state-transition {
  stroke: #111111;
  stroke-width: 1;
  stroke-dasharray: 3 5;
  opacity: 0.45;
  pointer-events: none;
}

.chart-state-label {
  fill: #111111;
  font-size: 10px;
  font-weight: 700;
  opacity: 0.58;
  pointer-events: none;
}

.chart-average-line {
  stroke: #111111;
  stroke-width: 1.4;
  stroke-dasharray: 7 5;
  opacity: 0.68;
  pointer-events: none;
}

.chart-average-label {
  fill: #111111;
  font-size: 11px;
  font-weight: 700;
  paint-order: stroke;
  stroke: #ffffff;
  stroke-width: 3px;
  pointer-events: none;
}

.chart-line {
  fill: none;
  stroke-width: 3;
  pointer-events: none;
}

.chart-line-right {
  stroke-dasharray: 8 5;
  stroke-width: 2.5;
}

.chart-point {
  stroke: #ffffff;
  stroke-width: 1.4;
  pointer-events: none;
}

.chart-label {
  fill: var(--muted);
  font-size: 11px;
}

.chart-label-right {
  fill: #111111;
}

.state-pie-card {
  min-height: 332px;
}

.state-pie-layout {
  display: grid;
  grid-template-columns: minmax(150px, 0.85fr) minmax(190px, 1fr);
  align-items: center;
  gap: 14px;
  min-height: 248px;
}

.state-pie-chart {
  width: 100%;
  height: 220px;
  display: block;
}

.state-pie-track {
  stroke: #eceff2;
}

.state-pie-segment {
  stroke-linecap: butt;
}

.state-pie-center-value {
  fill: #111111;
  font-size: 22px;
  font-weight: 800;
}

.state-pie-center-label {
  fill: var(--muted);
  font-size: 9.5px;
  font-weight: 700;
}

.state-pie-legend {
  display: grid;
  gap: 10px;
}

.state-pie-row {
  display: grid;
  grid-template-columns: 12px 1fr;
  gap: 9px;
  align-items: start;
}

.state-pie-swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  margin-top: 3px;
  box-shadow: inset 0 0 0 1px rgba(17, 17, 17, 0.12);
}

.state-pie-row strong {
  display: block;
  color: #111111;
  font-size: 12px;
  line-height: 1.2;
}

.state-pie-row small,
.state-pie-empty {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.chart-hit-area {
  fill: transparent;
  cursor: grab;
}

.chart-tooltip-line {
  stroke: #111111;
  stroke-width: 1;
  stroke-dasharray: 4 4;
  opacity: 0.55;
  pointer-events: none;
}

.chart-tooltip-dot {
  stroke: #ffffff;
  stroke-width: 2;
  pointer-events: none;
}

.chart-tooltip-box {
  fill: #ffffff;
  stroke: #111111;
  stroke-width: 1;
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.16));
  pointer-events: none;
}

.chart-tooltip-title {
  fill: #111111;
  font-size: 11px;
  font-weight: 700;
  pointer-events: none;
}

.chart-tooltip-text {
  fill: #333333;
  font-size: 11px;
  pointer-events: none;
}

.health-layout {
  display: grid;
  grid-template-columns: 310px 1fr;
  gap: 14px;
}

.gauge-card {
  min-height: 218px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  padding: 20px;
  text-align: center;
}

.health-gauge {
  width: 122px;
  height: 122px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: var(--green);
  background: conic-gradient(currentColor calc(var(--score, 100) * 1%), #e5e5e5 0);
}

.health-gauge span {
  width: 92px;
  height: 92px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: 32px;
  font-weight: 800;
}

.health-gauge.warning {
  color: var(--yellow);
}

.health-gauge.critical {
  color: var(--red);
}

.gauge-card p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.alerts-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.history-summary-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.history-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.report-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.report-actions p {
  margin-right: 8px;
}

.report-button,
.admin-save-button {
  min-height: 34px;
  border: 1px solid #d6dce1;
  border-bottom-color: #9da6ad;
  border-radius: 6px;
  padding: 0 12px;
  color: var(--ink);
  background: linear-gradient(180deg, #ffffff 0%, #f6f8f9 45%, #dfe5e9 100%);
  box-shadow: var(--shadow-button);
  font-size: 12px;
  font-weight: 800;
}

.alert-row {
  position: relative;
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 12px;
  align-items: center;
  border: 1px solid #eef1f3;
  border-left: 5px solid var(--green);
  border-bottom-color: #aeb7bf;
  border-radius: 6px;
  padding: 12px 14px;
  background: var(--surface-3d);
  box-shadow: var(--shadow-card-3d);
  overflow: hidden;
}

.alert-row::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.98), inset 0 -2px 0 rgba(15, 17, 19, 0.08);
  pointer-events: none;
}

.alert-row.warning {
  border-left-color: var(--yellow);
}

.alert-row.critical {
  border-left-color: var(--red);
}

.alert-row strong {
  display: block;
  margin-bottom: 2px;
}

.alert-row span,
.alert-row p {
  color: var(--muted);
  font-size: 13px;
}

.event-solutions {
  margin: 8px 0 0;
  padding-left: 18px;
  color: #3b4147;
  font-size: 12px;
  line-height: 1.45;
}

.history-row {
  grid-template-columns: 118px minmax(0, 1fr) 210px;
  min-height: 84px;
}

.history-meta {
  display: grid;
  gap: 5px;
  justify-items: end;
  text-align: right;
}

.history-meta strong {
  margin-bottom: 0;
  font-size: 12px;
}

.history-meta span {
  font-size: 12px;
}

.history-empty {
  min-height: 116px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  border: 1px solid #eef1f3;
  border-bottom-color: #aeb7bf;
  border-radius: 6px;
  background: var(--surface-3d);
  box-shadow: var(--shadow-card-3d);
  text-align: center;
}

.history-empty p {
  color: var(--muted);
  font-size: 13px;
}

.admin-form {
  display: grid;
  gap: 14px;
}

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

.threshold-editor {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(285px, 1fr));
  gap: 12px;
}

.admin-form label,
.threshold-row label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.admin-form input,
.admin-form select {
  min-width: 0;
  width: 100%;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0 10px;
  background: #ffffff;
  color: var(--ink);
}

.admin-subhead {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-top: 4px;
  color: var(--muted);
}

.admin-subhead strong {
  color: var(--ink);
}

.admin-users-panel {
  position: relative;
  display: grid;
  gap: 16px;
  margin-top: 26px;
  padding: 18px;
  border: 1px solid #eef1f3;
  border-bottom-color: #aeb7bf;
  border-radius: 7px;
  background: var(--surface-3d);
  box-shadow: var(--shadow-card-3d);
  overflow: hidden;
}

.admin-users-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.98), inset 0 -2px 0 rgba(15, 17, 19, 0.08);
  pointer-events: none;
}

.admin-inner-heading {
  position: relative;
  z-index: 1;
  margin: 0;
}

.admin-user-layout {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 14px;
}

.admin-select-label {
  display: grid;
  gap: 6px;
  max-width: 440px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.admin-select-label select {
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0 10px;
  background: #ffffff;
  color: var(--ink);
}

.machine-access-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.machine-access-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 62px;
  padding: 11px 12px;
  border: 1px solid #eef1f3;
  border-bottom-color: #aeb7bf;
  border-radius: 6px;
  background: var(--surface-3d);
  box-shadow: 0 16px 28px rgba(15, 17, 19, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.96);
}

.machine-access-item input {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.machine-access-item span {
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.machine-access-item small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.machine-access-item.disabled {
  opacity: 0.68;
}

.machine-access-empty {
  min-height: 58px;
  display: grid;
  place-items: center;
  border: 1px dashed #c9d0d6;
  border-radius: 6px;
  color: var(--muted);
  font-size: 13px;
  background: rgba(255, 255, 255, 0.76);
}

.logo-upload-field input {
  padding-top: 8px;
}

.client-logo-preview {
  display: flex;
  align-items: center;
  gap: 14px;
  width: fit-content;
  max-width: 100%;
  padding: 12px;
  border: 1px solid #eef1f3;
  border-bottom-color: #aeb7bf;
  border-radius: 7px;
  background: var(--surface-3d);
  box-shadow: 0 18px 32px rgba(15, 17, 19, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.96);
}

.client-logo-preview img {
  width: 112px;
  height: 58px;
  object-fit: contain;
  border-radius: 5px;
  background: #ffffff;
}

.client-logo-preview div {
  display: grid;
  gap: 8px;
}

.client-logo-preview strong {
  font-size: 13px;
}

.threshold-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(72px, 82px) minmax(72px, 82px);
  gap: 8px;
  align-items: end;
  min-width: 0;
  min-height: 82px;
  padding: 12px;
  border: 1px solid #eef1f3;
  border-bottom-color: #aeb7bf;
  border-radius: 6px;
  background: var(--surface-3d);
  box-shadow: var(--shadow-card-3d);
}

.threshold-row strong {
  min-width: 0;
  align-self: center;
  font-size: 13px;
}

.admin-save-button {
  width: 190px;
}

.admin-save-status {
  min-height: 18px;
  color: var(--muted);
  font-size: 13px;
}

.efficiency-layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 14px;
  margin-top: 14px;
}

.energy-history-card {
  margin-top: 14px;
}

.energy-charts {
  grid-template-columns: 1fr;
}

.pie-wrap {
  height: 242px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
}

.load-pie {
  width: 162px;
  height: 162px;
  border-radius: 999px;
  background: conic-gradient(var(--accent) 0 68%, #d8d8d8 0 100%);
  box-shadow:
    inset 0 0 0 22px #fff,
    inset 0 2px 4px rgba(255, 255, 255, 0.9),
    0 28px 42px rgba(15, 17, 19, 0.22),
    0 0 0 1px #c4cbd1;
}

.pie-legend {
  display: grid;
  gap: 12px;
}

.pie-legend span {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}

.pie-legend i {
  width: 12px;
  height: 12px;
  display: inline-block;
  border-radius: 3px;
}

.pie-legend i.load {
  background: var(--accent);
}

.pie-legend i.unload {
  background: #f59e0b;
}

.pie-legend i.off {
  background: #c8d5dd;
}

.pie-legend strong {
  color: var(--ink);
}

.efficiency-factors {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.efficiency-factors article {
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow:
    0 14px 24px rgba(15, 17, 19, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  color: #2f3437;
  font-size: 13px;
  line-height: 1.35;
  padding: 12px 14px;
}

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

.admin-entity-panel {
  margin-top: 0;
}

.admin-grid-compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.access-matrix {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.access-section {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #eef1f3;
  border-bottom-color: #aeb7bf;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.96), 0 12px 22px rgba(15, 17, 19, 0.09);
}

.access-section > strong {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.access-section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 10px;
}

@media (max-width: 980px) {
  .admin-platform-grid,
  .admin-grid,
  .admin-grid-compact {
    grid-template-columns: 1fr;
  }
}