:root {
  --bg: #061018;
  --bg-2: #0a1924;
  --panel: rgba(16, 36, 51, 0.72);
  --panel-solid: #102433;
  --panel-2: #143042;
  --line: rgba(148, 197, 214, 0.14);
  --text: #e8f4f8;
  --muted: #8aa8b5;
  --accent: #2dd4bf;
  --accent-2: #38bdf8;
  --warn: #fbbf24;
  --danger: #f87171;
  --ok: #34d399;
  --font: 'Outfit', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --radius: 16px;
  --nav-w: 228px;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.32);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  min-height: 100%;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}

body {
  background:
    radial-gradient(ellipse 80% 55% at 8% -10%, rgba(45, 212, 191, 0.16), transparent 55%),
    radial-gradient(ellipse 60% 45% at 95% 5%, rgba(56, 189, 248, 0.12), transparent 50%),
    radial-gradient(ellipse 50% 40% at 50% 100%, rgba(20, 80, 100, 0.22), transparent 60%),
    linear-gradient(168deg, #0a1822 0%, #061018 42%, #0b1c28 100%);
  background-attachment: fixed;
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(148, 197, 214, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 197, 214, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 20%, transparent 75%);
}

body::after {
  content: '';
  position: fixed;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  top: -80px;
  right: -60px;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(circle, rgba(45, 212, 191, 0.14), transparent 68%);
  animation: orbDrift 18s ease-in-out infinite alternate;
}

a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- Login ---- */
.login-page { display: grid; place-items: center; min-height: 100dvh; padding: 24px; position: relative; z-index: 1; }
.login__card {
  width: min(920px, 100%);
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  background: color-mix(in srgb, var(--panel-solid) 88%, transparent);
  border: 1px solid var(--line);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  animation: riseIn 0.7s var(--ease) both;
}
.login__brand {
  padding: 48px 40px;
  background:
    linear-gradient(160deg, rgba(45, 212, 191, 0.18), transparent 50%),
    linear-gradient(180deg, #0e2433, #0a1a25);
  border-right: 1px solid var(--line);
}
.login__logo {
  width: 120px;
  height: 120px;
  object-fit: contain;
  margin-bottom: 24px;
  display: block;
  background: #fff;
  border-radius: 16px;
  padding: 10px;
}
.login__mark {
  width: 56px; height: 56px; border-radius: 14px;
  display: grid; place-items: center;
  font-weight: 800; letter-spacing: 0.04em;
  background: var(--accent); color: #04201c; margin-bottom: 28px;
}
.login__inst { color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.login__brand h1 { font-size: 28px; font-weight: 800; line-height: 1.15; margin-bottom: 10px; }
.login__lead { color: var(--muted); font-size: 14px; line-height: 1.5; max-width: 28ch; }
.login__form { padding: 40px 36px; display: flex; flex-direction: column; gap: 8px; }
.login__form h2 { font-size: 20px; margin-bottom: 12px; }
.login__form label { font-size: 12px; color: var(--muted); margin-top: 8px; }
.login__form input {
  width: 100%; padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--bg-2); color: var(--text);
  font: inherit; font-size: 15px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.login__form input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.18); }

@media (max-width: 760px) {
  .login-page { padding: 16px; align-items: stretch; }
  .login__card { grid-template-columns: 1fr; border-radius: 18px; min-height: auto; }
  .login__brand {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 28px 22px 22px;
    text-align: center;
  }
  .login__logo { margin-left: auto; margin-right: auto; width: 96px; height: 96px; }
  .login__lead { max-width: none; margin: 0 auto; }
  .login__brand h1 { font-size: 22px; }
  .login__form { padding: 24px 20px 28px; }
  .login__form input { font-size: 16px; padding: 14px; }
  .btn { min-height: 48px; font-size: 15px; }
}

.app-shell {
  display: flex;
  min-height: 100dvh;
  position: relative;
  z-index: 1;
}
.shell__nav {
  width: var(--nav-w);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  padding: 18px 14px;
  border-right: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel-solid) 78%, transparent);
  backdrop-filter: blur(14px);
  animation: slideNav 0.55s var(--ease) both;
}
.shell__brand {
  display: flex; gap: 12px; align-items: center;
  text-decoration: none; color: inherit;
  padding: 6px 8px 18px; border-bottom: 1px solid var(--line); margin-bottom: 14px;
}
.shell__brand:hover { text-decoration: none; }
.shell__logo {
  width: 40px; height: 40px; border-radius: 11px;
  display: grid; place-items: center; overflow: hidden;
  background: #fff; flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.08);
}
.shell__logo img {
  width: 100%; height: 100%; object-fit: contain;
}
.shell__brand strong { display: block; font-size: 13px; }
.shell__brand small { color: var(--muted); font-size: 11px; }
.shell__links { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.shell__links a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 10px;
  color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 500;
  transition: background 0.2s, color 0.2s, transform 0.2s;
}
.shell__links a i { width: 18px; text-align: center; transition: transform 0.25s var(--ease); }
.shell__links a:hover {
  background: rgba(255,255,255,0.05); color: var(--text); text-decoration: none;
  transform: translateX(2px);
}
.shell__links a:hover i { transform: scale(1.08); }
.shell__links a.is-active {
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--accent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 25%, transparent);
}
.shell__foot { border-top: 1px solid var(--line); padding-top: 12px; margin-top: auto; }
.shell__user { font-size: 13px; font-weight: 600; padding: 6px 8px 10px; display: flex; gap: 8px; align-items: center; }
.shell__user i { color: var(--accent); }
.shell__user span { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.shell__user strong { font-size: 13px; font-weight: 600; line-height: 1.2; }
.shell__user small { font-size: 11px; font-weight: 500; color: var(--muted); }
.shell__logout {
  display: flex; gap: 8px; align-items: center;
  padding: 8px 10px; border-radius: 8px; color: var(--muted); font-size: 13px; text-decoration: none;
  transition: color 0.2s, background 0.2s;
}
.shell__logout:hover { color: var(--danger); text-decoration: none; background: rgba(248,113,113,0.08); }

.shell__links-logout { display: none; }
.shell__mbar { display: none; }

.shell__main {
  flex: 1; min-width: 0;
  padding: 22px 28px 40px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.shell__top {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 16px; margin-bottom: 22px;
  animation: riseIn 0.55s var(--ease) both;
}
.shell__top h1 {
  font-size: 26px; font-weight: 800; letter-spacing: -0.03em;
  background: linear-gradient(120deg, #fff 30%, #9ad8e8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.shell__sub { color: var(--muted); font-size: 13px; margin-top: 4px; }
.shell__top-right {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  flex-wrap: wrap;
  flex-shrink: 0;
  max-width: 100%;
}
.clock {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  white-space: nowrap;
  line-height: 1.4;
  flex-shrink: 0;
}

.live-status {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
  overflow: visible;
}
.live-status__main {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.live-status__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--danger);
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.15);
  transition: background 0.35s, box-shadow 0.35s;
}
.live-status[data-on="1"] .live-status__dot {
  background: var(--ok);
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.18);
  animation: liveDot 2s ease-in-out infinite;
}
.live-status__label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  white-space: nowrap;
}
.live-status[data-on="0"] .live-status__label { color: #fca5a5; }
.live-status[data-on="1"] .live-status__label { color: #a7f3d0; }
.live-status__sep {
  width: 1px;
  height: 12px;
  background: var(--line);
  flex-shrink: 0;
}
.live-status__rel {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
}
.live-status__time {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  font-family: var(--mono);
  letter-spacing: 0.01em;
  white-space: nowrap;
  line-height: 1.45;
  overflow: visible;
}

.pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--panel-solid);
  font-size: 12px; font-weight: 600;
  transition: border-color 0.3s, background 0.3s;
}
.pill i { font-size: 8px; color: var(--muted); transition: color 0.3s; }
.pill[data-on="1"] i {
  color: var(--ok);
  animation: liveDot 1.8s ease-in-out infinite;
}
.pill[data-on="0"] i { color: var(--danger); }

.status-box {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px 8px 8px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel-solid) 85%, transparent);
  backdrop-filter: blur(10px);
  transition: border-color 0.35s, background 0.35s, box-shadow 0.35s;
}
.status-box[data-on="1"] {
  border-color: color-mix(in srgb, var(--ok) 40%, var(--line));
  background: color-mix(in srgb, var(--ok) 8%, var(--panel-solid));
  box-shadow: 0 0 24px rgba(52, 211, 153, 0.08);
}
.status-box[data-on="0"] {
  border-color: color-mix(in srgb, var(--danger) 35%, var(--line));
  background: color-mix(in srgb, var(--danger) 7%, var(--panel-solid));
}
.status-box__meta {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.status-box__meta strong {
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.status-box__meta span {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.status-box__meta time {
  font-size: 11px;
  color: var(--muted);
  font-family: var(--mono);
}

.link-banner {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  margin-bottom: 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel-solid) 80%, transparent);
  backdrop-filter: blur(10px);
  animation: riseIn 0.6s var(--ease) 0.05s both;
  transition: border-color 0.35s, background 0.35s;
}
.link-banner[hidden] { display: none !important; }
.link-banner i {
  margin-top: 2px;
  color: var(--danger);
  transition: color 0.3s, transform 0.4s var(--ease);
}
.link-banner[data-on="1"] {
  border-color: color-mix(in srgb, var(--ok) 40%, var(--line));
  background: color-mix(in srgb, var(--ok) 8%, var(--panel-solid));
}
.link-banner[data-on="1"] i {
  color: var(--ok);
  animation: dishPulse 2.4s ease-in-out infinite;
}
.link-banner[data-on="0"] {
  border-color: color-mix(in srgb, var(--danger) 40%, var(--line));
  background: color-mix(in srgb, var(--danger) 8%, var(--panel-solid));
}
.link-banner[data-on="0"] i { animation: warnShake 3s ease-in-out infinite; }
.link-banner strong { display: block; font-size: 14px; margin-bottom: 2px; }
.link-banner span { display: block; font-size: 12px; color: var(--muted); line-height: 1.45; }

/* ---- Panel ---- */
.sensors {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
.sensor {
  display: flex; gap: 12px; align-items: center;
  padding: 16px;
  background: color-mix(in srgb, var(--panel-solid) 88%, transparent);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  backdrop-filter: blur(8px);
  transition: transform 0.3s var(--ease), border-color 0.3s, background 0.3s, box-shadow 0.3s;
  animation: riseIn 0.55s var(--ease) both;
}
.sensor:nth-child(1) { animation-delay: 0.08s; }
.sensor:nth-child(2) { animation-delay: 0.12s; }
.sensor:nth-child(3) { animation-delay: 0.16s; }
.sensor:nth-child(4) { animation-delay: 0.2s; }
.sensor:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent-2) 28%, var(--line));
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
}
.sensor i {
  width: 42px; height: 42px; border-radius: 12px;
  display: grid; place-items: center;
  background: rgba(56, 189, 248, 0.12); color: var(--accent-2);
  transition: transform 0.35s var(--ease), background 0.3s, color 0.3s;
}
.sensor:hover i { transform: scale(1.06); }
.sensor strong { display: block; font-size: 12px; color: var(--muted); font-weight: 500; }
.sensor span {
  font-size: 16px; font-weight: 700;
  transition: color 0.3s;
}
.sensor[data-bad="1"] {
  border-color: color-mix(in srgb, var(--danger) 45%, var(--line));
  background: color-mix(in srgb, var(--danger) 10%, var(--panel-solid));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--danger) 15%, transparent);
}
.sensor[data-bad="1"] i {
  background: rgba(248,113,113,0.15); color: var(--danger);
  animation: alarmPulse 1.5s ease-in-out infinite;
}
.sensor[data-bad="1"] span { color: var(--danger); }
.sensor--info i { background: rgba(45, 212, 191, 0.12); color: var(--accent); }

.lines {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 18px;
}
.line {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(145deg, rgba(45, 212, 191, 0.06), transparent 40%),
    linear-gradient(180deg, var(--panel-2), var(--panel-solid));
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 20px;
  box-shadow: var(--shadow);
  animation: riseIn 0.65s var(--ease) both;
  transition: border-color 0.35s, box-shadow 0.35s, transform 0.35s var(--ease);
}
.line:nth-child(1) { animation-delay: 0.18s; }
.line:nth-child(2) { animation-delay: 0.26s; }
.line::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,0.04) 50%, transparent 60%);
  transform: translateX(-100%);
}
.line:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--accent) 30%, var(--line));
  box-shadow: 0 24px 56px rgba(0, 0, 0, 0.38);
}
.line:hover::before { animation: sheen 1.1s var(--ease); }
.line[data-flow="1"] {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
  box-shadow: 0 0 40px rgba(45, 212, 191, 0.08), var(--shadow);
}
.line__head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 18px;
  position: relative;
}
.line__head h2 { font-size: 18px; font-weight: 800; letter-spacing: -0.02em; }
.line__tag {
  font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 5px 10px; border-radius: 999px;
  background: rgba(255,255,255,0.05); color: var(--muted); border: 1px solid var(--line);
  transition: color 0.3s, border-color 0.3s, background 0.3s, box-shadow 0.3s;
}
.line__tag[data-flow="1"] {
  color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, transparent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  box-shadow: 0 0 16px rgba(45, 212, 191, 0.2);
}

.line__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
  position: relative;
}
.metric {
  padding: 12px;
  border-radius: 12px;
  background: rgba(0,0,0,0.22);
  border: 1px solid var(--line);
  transition: border-color 0.3s, background 0.3s;
}
.metric.is-flash {
  animation: valueFlash 0.55s var(--ease);
}
.metric__label { display: block; font-size: 11px; color: var(--muted); margin-bottom: 6px; }
.metric__value {
  font-size: 22px; font-weight: 800; letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.metric__value small { font-size: 12px; font-weight: 600; color: var(--muted); }
.metric__value.mono, .mono { font-family: var(--mono); font-size: 16px; }

.flow-gauge {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: rgba(0,0,0,0.28);
  border: 1px solid var(--line);
  margin-bottom: 16px;
  overflow: hidden;
}
.flow-gauge__fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0d9488, var(--accent), #7dd3fc);
  box-shadow: 0 0 12px rgba(45, 212, 191, 0.45);
  transition: width 0.7s var(--ease);
  position: relative;
}
.flow-gauge__fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.35), transparent);
  animation: gaugeShine 2.2s linear infinite;
  opacity: 0;
}
.line[data-flow="1"] .flow-gauge__fill::after { opacity: 1; }

.pump {
  display: flex; align-items: center; gap: 12px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(0,0,0,0.18);
  position: relative;
  overflow: hidden;
  transition: border-color 0.35s, background 0.35s, box-shadow 0.35s;
}
.pump__icon {
  width: 44px; height: 44px; border-radius: 12px;
  display: grid; place-items: center;
  background: rgba(255,255,255,0.05); color: var(--muted);
  transition: background 0.35s, color 0.35s, transform 0.35s;
  position: relative;
  z-index: 1;
}
.pump[data-on="1"] {
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  box-shadow: inset 0 0 30px rgba(45, 212, 191, 0.08);
}
.pump[data-on="1"]::before {
  content: '';
  position: absolute;
  left: -20%;
  top: 0;
  bottom: 0;
  width: 40%;
  background: linear-gradient(90deg, transparent, rgba(45, 212, 191, 0.12), transparent);
  animation: pumpWave 2s ease-in-out infinite;
}
.pump[data-on="1"] .pump__icon {
  background: var(--accent); color: #04201c;
  animation: pumpBeat 1.4s ease-in-out infinite;
  box-shadow: 0 0 20px rgba(45, 212, 191, 0.45);
}
.pump__body { flex: 1; min-width: 0; position: relative; z-index: 1; }
.pump__body strong { display: block; font-size: 14px; }
.pump__body span { font-size: 13px; color: var(--muted); transition: color 0.3s; }
.pump[data-on="1"] .pump__body span { color: var(--accent); font-weight: 600; }
.pump__expect {
  font-size: 11px; font-weight: 700; color: var(--muted);
  padding: 6px 10px; border-radius: 8px; background: rgba(255,255,255,0.04);
}

.hint {
  color: var(--muted); font-size: 13px; line-height: 1.5;
  padding: 12px 4px;
  animation: riseIn 0.7s var(--ease) 0.32s both;
}

/* ---- Forms / events ---- */
.form-card {
  max-width: 720px;
  display: flex; flex-direction: column; gap: 16px;
  animation: riseIn 0.55s var(--ease) both;
}
.form-block {
  background: color-mix(in srgb, var(--panel-solid) 90%, transparent);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  backdrop-filter: blur(8px);
  transition: border-color 0.3s, box-shadow 0.3s;
}
.form-block:hover {
  border-color: color-mix(in srgb, var(--accent) 22%, var(--line));
  box-shadow: 0 12px 32px rgba(0,0,0,0.2);
}
.form-block h2 {
  font-size: 15px; margin-bottom: 16px;
  display: flex; gap: 8px; align-items: center;
}
.form-block h2 i { color: var(--accent); }
.form-row { margin-bottom: 14px; }
.form-row:last-child { margin-bottom: 0; }
.form-row label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.form-row input {
  width: 100%; padding: 11px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg-2); color: var(--text);
  font: inherit; font-size: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-row input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.15); }
.form-row select {
  width: 100%; padding: 11px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg-2); color: var(--text);
  font: inherit; font-size: 14px;
}
.form-row select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.15); }
.form-row--check label {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text); cursor: pointer;
}
.form-row--check input { width: auto; }
.form-row small { color: var(--muted); font-weight: 500; }
.field-hint { font-size: 12px; color: var(--muted); margin-top: 6px; }
.form-actions { display: flex; gap: 10px; }

/* ---- Program (modern) ---- */
.prog-sync {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  max-width: 980px;
  margin-bottom: 16px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--accent-2) 28%, var(--line));
  background: color-mix(in srgb, var(--accent-2) 8%, var(--panel-solid));
  animation: riseIn 0.45s var(--ease) both;
}
.prog-sync i {
  margin-top: 2px;
  color: var(--accent-2);
}
.prog-sync strong { display: block; font-size: 13px; margin-bottom: 2px; }
.prog-sync span { display: block; font-size: 12px; color: var(--muted); line-height: 1.45; }

.prog-form { max-width: 980px; }
.prog-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
.prog-card {
  position: relative;
  overflow: visible;
  padding: 20px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background:
    linear-gradient(155deg, rgba(45, 212, 191, 0.07), transparent 42%),
    color-mix(in srgb, var(--panel-solid) 92%, transparent);
  box-shadow: var(--shadow);
  animation: riseIn 0.55s var(--ease) both;
  transition: border-color 0.3s, transform 0.3s var(--ease);
}
.prog-card:nth-child(2) { animation-delay: 0.08s; }
.prog-card:hover {
  border-color: color-mix(in srgb, var(--accent) 28%, var(--line));
  transform: translateY(-2px);
}
.prog-card__head {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}
.prog-card__badge {
  width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center;
  font-weight: 800; font-size: 16px;
  background: var(--accent); color: #04201c;
  flex-shrink: 0;
}
.prog-card__head h2 {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0;
}
.prog-card__head p {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}
.prog-flow {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(0,0,0,0.22);
  border: 1px solid var(--line);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
}
.prog-flow span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
}
.prog-flow span i { color: var(--accent); }
.prog-flow > i { font-size: 9px; opacity: 0.5; }

.prog-section { margin-bottom: 16px; }
.prog-section h3 {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}
.prog-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.prog-field { display: flex; flex-direction: column; gap: 6px; }
.prog-field__label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.prog-field__control {
  display: flex;
  align-items: center;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg-2);
  overflow: visible;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.prog-field__control:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.15);
}
.prog-field__control input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 18px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  padding: 12px 14px;
  outline: none;
  line-height: 1.3;
  height: auto;
}
.prog-field__unit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  padding: 0 14px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--muted);
  background: rgba(255,255,255,0.03);
  border-left: 1px solid var(--line);
  white-space: nowrap;
  flex-shrink: 0;
}
.prog-field__hint {
  font-size: 11px;
  color: color-mix(in srgb, var(--muted) 85%, transparent);
  line-height: 1.35;
}
.prog-summary {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line));
}
.prog-summary i { color: var(--accent); margin-top: 2px; }
.prog-summary p {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
  margin: 0;
}
.prog-summary strong { color: var(--text); font-weight: 700; }

.prog-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel-solid) 92%, transparent);
  backdrop-filter: blur(10px);
  position: sticky;
  bottom: 12px;
  z-index: 5;
  animation: riseIn 0.6s var(--ease) 0.1s both;
}
.prog-bar p {
  font-size: 12px;
  color: var(--muted);
  max-width: 46ch;
  line-height: 1.4;
  margin: 0;
}
.prog-bar__actions { display: flex; gap: 10px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border-radius: 12px; border: 1px solid transparent;
  font: inherit; font-size: 14px; font-weight: 700; cursor: pointer;
  text-decoration: none;
  transition: transform 0.2s var(--ease), filter 0.2s, background 0.2s, box-shadow 0.2s;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: scale(0.98); }
.btn--primary {
  background: linear-gradient(135deg, #2dd4bf, #14b8a6);
  color: #04201c;
  box-shadow: 0 8px 24px rgba(45, 212, 191, 0.25);
}
.btn--primary:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn--ghost { background: transparent; border-color: var(--line); color: var(--text); }
.btn--ghost:hover { background: rgba(255,255,255,0.04); }
.btn--danger {
  background: transparent;
  border-color: rgba(248, 113, 113, 0.4);
  color: #fecaca;
}
.btn--danger:hover { background: rgba(248, 113, 113, 0.12); }
.btn--block { width: 100%; margin-top: 12px; }

.alert {
  padding: 12px 14px; border-radius: 12px; margin-bottom: 16px;
  font-size: 13px; font-weight: 500;
  animation: riseIn 0.4s var(--ease) both;
}
.alert--err { background: rgba(248,113,113,0.12); color: #fecaca; border: 1px solid rgba(248,113,113,0.3); }
.alert--ok { background: rgba(52,211,153,0.12); color: #a7f3d0; border: 1px solid rgba(52,211,153,0.3); }

.event-list { list-style: none; display: flex; flex-direction: column; gap: 8px; max-width: 760px; }
.event {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 14px 16px; border-radius: 14px;
  background: color-mix(in srgb, var(--panel-solid) 90%, transparent);
  border: 1px solid var(--line);
  animation: riseIn 0.45s var(--ease) both;
  transition: transform 0.25s var(--ease), border-color 0.25s;
}
.event:nth-child(1) { animation-delay: 0.04s; }
.event:nth-child(2) { animation-delay: 0.08s; }
.event:nth-child(3) { animation-delay: 0.12s; }
.event:nth-child(4) { animation-delay: 0.16s; }
.event:nth-child(5) { animation-delay: 0.2s; }
.event:hover { transform: translateX(3px); border-color: color-mix(in srgb, var(--accent-2) 25%, var(--line)); }
.event.is-unread { border-color: color-mix(in srgb, var(--accent-2) 35%, var(--line)); }
.event__type {
  width: 40px; height: 40px; border-radius: 11px;
  display: grid; place-items: center; flex-shrink: 0;
  background: rgba(255,255,255,0.05); color: var(--muted);
}
.event__type--door { color: var(--warn); background: rgba(251,191,36,0.12); }
.event__type--klor_empty { color: var(--danger); background: rgba(248,113,113,0.12); }
.event__type--power { color: var(--danger); background: rgba(248,113,113,0.12); }
.event strong { display: block; font-size: 14px; }
.event p { color: var(--muted); font-size: 13px; margin-top: 2px; }
.event time { display: block; font-size: 11px; color: var(--muted); margin-top: 6px; font-family: var(--mono); }

/* ---- Events (commercial) ---- */
.ev-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
  max-width: 920px;
  animation: riseIn 0.5s var(--ease) both;
}
.ev-stat {
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel-solid) 88%, transparent);
  backdrop-filter: blur(8px);
}
.ev-stat__label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}
.ev-stat__value {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.ev-stat--critical {
  border-color: color-mix(in srgb, var(--danger) 35%, var(--line));
  background: color-mix(in srgb, var(--danger) 7%, var(--panel-solid));
}
.ev-stat--critical .ev-stat__value { color: #fecaca; }
.ev-stat--warning {
  border-color: color-mix(in srgb, var(--warn) 35%, var(--line));
  background: color-mix(in srgb, var(--warn) 7%, var(--panel-solid));
}
.ev-stat--warning .ev-stat__value { color: #fde68a; }

.ev-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
  max-width: 920px;
  animation: riseIn 0.55s var(--ease) 0.04s both;
}
.ev-filter {
  appearance: none;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel-solid) 70%, transparent);
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: color 0.2s, background 0.2s, border-color 0.2s, transform 0.2s;
}
.ev-filter:hover { color: var(--text); border-color: color-mix(in srgb, var(--accent-2) 30%, var(--line)); }
.ev-filter.is-active {
  color: #04201c;
  background: linear-gradient(135deg, #2dd4bf, #14b8a6);
  border-color: transparent;
}
.ev-filter:active { transform: scale(0.98); }

.ev-feed { max-width: 920px; }
.ev-day { margin-bottom: 22px; animation: riseIn 0.55s var(--ease) both; }
.ev-day__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding: 0 2px;
}
.ev-day__head h2 {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.ev-day__head span {
  font-size: 12px;
  color: color-mix(in srgb, var(--muted) 80%, transparent);
  font-variant-numeric: tabular-nums;
}

.ev-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
}
.ev-item {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background:
    linear-gradient(120deg, rgba(255,255,255,0.02), transparent 40%),
    color-mix(in srgb, var(--panel-solid) 92%, transparent);
  backdrop-filter: blur(8px);
  transition: border-color 0.25s, transform 0.25s var(--ease), box-shadow 0.25s;
}
.ev-item:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--accent-2) 22%, var(--line));
  box-shadow: 0 14px 34px rgba(0,0,0,0.22);
}
.ev-item.is-unread {
  border-color: color-mix(in srgb, var(--accent) 28%, var(--line));
  box-shadow: inset 3px 0 0 var(--accent);
}
.ev-item__rail { display: flex; justify-content: center; padding-top: 2px; }
.ev-item__icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 15px;
}
.ev-item__icon--critical {
  color: #fecaca;
  background: rgba(248, 113, 113, 0.14);
  box-shadow: 0 0 0 1px rgba(248, 113, 113, 0.2);
}
.ev-item__icon--warning {
  color: #fde68a;
  background: rgba(251, 191, 36, 0.14);
  box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.2);
}
.ev-item__icon--info {
  color: var(--accent-2);
  background: rgba(56, 189, 248, 0.12);
}
.ev-item__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
}
.ev-item__badges { display: flex; flex-wrap: wrap; gap: 6px; }
.ev-badge {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 7px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: rgba(255,255,255,0.03);
}
.ev-badge--critical {
  color: #fecaca;
  border-color: rgba(248, 113, 113, 0.35);
  background: rgba(248, 113, 113, 0.1);
}
.ev-badge--warning {
  color: #fde68a;
  border-color: rgba(251, 191, 36, 0.35);
  background: rgba(251, 191, 36, 0.1);
}
.ev-badge--cat { color: #b6d4e0; }
.ev-badge--new {
  color: #04201c;
  background: var(--accent);
  border-color: transparent;
}
.ev-item__when {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
  text-align: right;
  overflow: visible;
  max-width: none;
}
.ev-item__when span:first-child {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}
.ev-item__when span:last-child {
  font-size: 11px;
  font-family: var(--mono);
  color: var(--muted);
  white-space: nowrap;
  line-height: 1.4;
}
.ev-item__title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}
.ev-item__msg {
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
  max-width: 62ch;
}
.ev-item__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(148, 197, 214, 0.1);
  font-size: 11px;
  color: var(--muted);
  font-family: var(--mono);
}
.ev-item__meta i { margin-right: 4px; opacity: 0.7; }
.ev-empty-filter {
  text-align: center;
  color: var(--muted);
  padding: 28px 12px;
  font-size: 13px;
}
.empty--events { max-width: 520px; }
.empty__icon {
  width: 56px; height: 56px; margin: 0 auto 14px;
  border-radius: 16px;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--ok) 12%, transparent);
  color: var(--ok);
  font-size: 22px;
}
.empty--events i { margin-bottom: 0; opacity: 1; font-size: inherit; }

.empty {
  text-align: center; padding: 60px 20px; color: var(--muted);
  background: var(--panel-solid); border: 1px dashed var(--line); border-radius: var(--radius);
  max-width: 480px;
  animation: riseIn 0.5s var(--ease) both;
}
.empty i { font-size: 28px; margin-bottom: 12px; opacity: 0.5; }
.empty h3 { color: var(--text); margin-bottom: 6px; }

/* ---- Users ---- */
.usr-roles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
  max-width: 980px;
  animation: riseIn 0.5s var(--ease) both;
}
.usr-role {
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel-solid) 88%, transparent);
}
.usr-role strong {
  display: block;
  font-size: 14px;
  margin-bottom: 4px;
}
.usr-role span {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}
.usr-role--admin {
  border-color: color-mix(in srgb, var(--accent) 30%, var(--line));
  background: color-mix(in srgb, var(--accent) 7%, var(--panel-solid));
}
.usr-role--operator {
  border-color: color-mix(in srgb, var(--accent-2) 28%, var(--line));
}
.usr-layout {
  display: grid;
  grid-template-columns: minmax(260px, 340px) 1fr;
  gap: 16px;
  align-items: start;
  max-width: 980px;
}
.usr-create { animation: riseIn 0.55s var(--ease) both; }
.usr-table-wrap {
  animation: riseIn 0.6s var(--ease) 0.05s both;
}
.usr-table-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
  padding: 0 2px;
}
.usr-table-head h2 {
  font-size: 15px;
  font-weight: 700;
}
.usr-table-head span {
  font-size: 12px;
  color: var(--muted);
}
.usr-table {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.usr-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: color-mix(in srgb, var(--panel-solid) 92%, transparent);
  padding: 14px 16px;
  transition: border-color 0.25s, box-shadow 0.25s;
}
.usr-card:hover {
  border-color: color-mix(in srgb, var(--accent-2) 22%, var(--line));
  box-shadow: 0 12px 28px rgba(0,0,0,0.2);
}
.usr-card.is-disabled { opacity: 0.72; }
.usr-card__main {
  display: flex;
  gap: 12px;
  align-items: center;
}
.usr-card__avatar {
  width: 42px; height: 42px; border-radius: 12px;
  display: grid; place-items: center;
  font-weight: 800; font-size: 16px;
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--accent);
  flex-shrink: 0;
}
.usr-card__info { min-width: 0; flex: 1; }
.usr-card__info strong { display: block; font-size: 15px; }
.usr-card__user {
  display: block;
  font-size: 12px;
  color: var(--muted);
  font-family: var(--mono);
  margin: 2px 0 8px;
}
.usr-card__tags { display: flex; flex-wrap: wrap; gap: 6px; }
.usr-tag {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 7px;
  border: 1px solid var(--line);
  color: var(--muted);
}
.usr-tag--admin {
  color: #04201c;
  background: var(--accent);
  border-color: transparent;
}
.usr-tag--operator {
  color: #bae6fd;
  border-color: rgba(56, 189, 248, 0.35);
  background: rgba(56, 189, 248, 0.1);
}
.usr-tag--viewer {
  color: #cbd5e1;
}
.usr-tag--on {
  color: #a7f3d0;
  border-color: rgba(52, 211, 153, 0.35);
  background: rgba(52, 211, 153, 0.1);
}
.usr-tag--off {
  color: #fecaca;
  border-color: rgba(248, 113, 113, 0.35);
  background: rgba(248, 113, 113, 0.1);
}
.usr-edit {
  margin-top: 12px;
  border-top: 1px solid rgba(148, 197, 214, 0.1);
  padding-top: 10px;
}
.usr-edit summary {
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-2);
  list-style: none;
  user-select: none;
}
.usr-edit summary::-webkit-details-marker { display: none; }
.usr-edit[open] summary { margin-bottom: 12px; }
.usr-form--edit { display: flex; flex-direction: column; gap: 0; }
.usr-delete { margin-top: 10px; }
.usr-delete .btn { width: 100%; }

/* ---- Keyframes ---- */
@keyframes riseIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slideNav {
  from { opacity: 0; transform: translateX(-12px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes orbDrift {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(-40px, 30px) scale(1.12); }
}
@keyframes liveDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.85); }
}
@keyframes dishPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.12); opacity: 0.75; }
}
@keyframes warnShake {
  0%, 90%, 100% { transform: translateX(0); }
  92% { transform: translateX(-2px); }
  94% { transform: translateX(2px); }
  96% { transform: translateX(-1px); }
}
@keyframes alarmPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(248,113,113,0.35); }
  50% { box-shadow: 0 0 0 8px rgba(248,113,113,0); }
}
@keyframes sheen {
  from { transform: translateX(-100%); }
  to { transform: translateX(120%); }
}
@keyframes valueFlash {
  0% { background: color-mix(in srgb, var(--accent) 22%, rgba(0,0,0,0.22)); }
  100% { background: rgba(0,0,0,0.22); }
}
@keyframes gaugeShine {
  from { transform: translateX(-100%); }
  to { transform: translateX(200%); }
}
@keyframes pumpBeat {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}
@keyframes pumpWave {
  from { transform: translateX(0); }
  to { transform: translateX(320%); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  body::after { display: none; }
}

/* ---- Responsive / mobil ---- */
@media (max-width: 980px) {
  .sensors { grid-template-columns: 1fr 1fr; }
  .lines { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .app-shell {
    flex-direction: column;
    min-height: 100dvh;
    padding-bottom: calc(68px + env(safe-area-inset-bottom, 0px));
  }

  .shell__mbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    position: sticky;
    top: 0;
    z-index: 40;
    padding: 10px 14px;
    padding-top: calc(10px + env(safe-area-inset-top, 0px));
    background: color-mix(in srgb, var(--panel-solid) 92%, transparent);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
    animation: riseIn 0.4s var(--ease) both;
  }
  .shell__mbar-brand {
    display: flex; align-items: center; gap: 10px;
    text-decoration: none; color: inherit; min-width: 0;
  }
  .shell__mbar-brand:hover { text-decoration: none; }
  .shell__mbar-brand img {
    width: 32px; height: 32px; border-radius: 8px;
    background: #fff; object-fit: contain; flex-shrink: 0;
  }
  .shell__mbar-brand strong { display: block; font-size: 13px; line-height: 1.1; }
  .shell__mbar-brand small {
    display: block; font-size: 11px; color: var(--muted);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 52vw;
  }
  .shell__mbar-user {
    font-size: 11px; color: var(--muted); font-weight: 600;
    max-width: 28vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }

  .shell__nav {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 50;
    width: 100% !important;
    height: auto;
    flex-direction: row !important;
    align-items: stretch;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
    border-right: 0;
    border-top: 1px solid var(--line);
    background: color-mix(in srgb, var(--panel-solid) 94%, #000);
    backdrop-filter: blur(14px);
    box-shadow: 0 -8px 30px rgba(0,0,0,0.35);
    overflow: visible;
    animation: none;
  }
  .shell__brand,
  .shell__foot { display: none !important; }
  .shell__links {
    flex: 1;
    flex-direction: row !important;
    justify-content: space-around;
    gap: 0;
  }
  .shell__links a {
    flex: 1;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    padding: 8px 4px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    min-height: 52px;
    text-align: center;
    transform: none !important;
  }
  .shell__links a i { width: auto; font-size: 18px; }
  .shell__links-logout { display: flex !important; color: #fca5a5; }
  .shell__links-logout:hover { color: var(--danger); }

  .shell__main { padding: 14px 12px 24px; width: 100%; }
  .shell__top {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    margin-bottom: 14px;
  }
  .shell__top h1 { font-size: 20px; }
  .shell__sub { font-size: 12px; line-height: 1.4; word-break: break-word; }
  .shell__top-right { justify-content: space-between; align-items: flex-start; width: 100%; }
  .clock { font-size: 13px; align-self: flex-start; }
  .live-status { align-items: flex-start; width: auto; max-width: 100%; }
  .live-status__main { justify-content: flex-start; }
  .live-status__rel { font-size: 12px; }
  .live-status__time { font-size: 11px; }
  .status-box { flex: 1; min-width: 0; }
  .status-box__meta span { font-size: 13px; }

  .sensors { gap: 8px; margin-bottom: 12px; }
  .sensor { padding: 12px; gap: 10px; border-radius: 14px; }
  .sensor:hover { transform: none; }
  .sensor i { width: 36px; height: 36px; border-radius: 10px; font-size: 14px; }
  .sensor span { font-size: 15px; }

  .lines { gap: 12px; }
  .line { padding: 14px; border-radius: 16px; }
  .line:hover { transform: none; }
  .line__head h2 { font-size: 16px; }
  .line__grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .metric { padding: 10px; }
  .metric__value { font-size: 18px; }
  .pump { flex-wrap: wrap; }
  .pump__expect { width: 100%; text-align: center; }

  .form-card { max-width: none; }
  .form-block { padding: 16px; border-radius: 14px; }
  .form-row input { font-size: 16px; padding: 12px; }
  .form-actions {
    flex-direction: column;
    gap: 8px;
    padding-top: 8px;
  }
  .form-actions .btn { width: 100%; min-height: 48px; }

  .prog-grid { grid-template-columns: 1fr; }
  .prog-card:hover { transform: none; }
  .prog-fields { grid-template-columns: 1fr; }
  .prog-field__control input { font-size: 16px; }
  .prog-bar {
    flex-direction: column;
    align-items: stretch;
    bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  }
  .prog-bar__actions { width: 100%; }
  .prog-bar__actions .btn { flex: 1; min-height: 48px; }

  .event { padding: 12px; }
  .event:hover { transform: none; }

  .ev-stats { grid-template-columns: 1fr 1fr; gap: 8px; }
  .ev-stat { padding: 12px; }
  .ev-stat__value { font-size: 22px; }
  .ev-toolbar { gap: 6px; margin-bottom: 14px; }
  .ev-filter { padding: 7px 10px; font-size: 11px; }
  .ev-item {
    grid-template-columns: 36px 1fr;
    gap: 10px;
    padding: 14px;
  }
  .ev-item:hover { transform: none; }
  .ev-item__icon { width: 36px; height: 36px; border-radius: 10px; font-size: 13px; }
  .ev-item__top { flex-direction: column; align-items: stretch; gap: 8px; }
  .ev-item__when { align-items: flex-start; text-align: left; }
  .ev-item__title { font-size: 14px; }
  .ev-item__meta { gap: 10px; }
  .hint { font-size: 12px; padding: 8px 2px 20px; }
  .empty { max-width: none; padding: 40px 16px; }

  .usr-roles { grid-template-columns: 1fr; gap: 8px; }
  .usr-layout { grid-template-columns: 1fr; }
  .usr-card:hover { box-shadow: none; }
  .form-row select { font-size: 16px; padding: 12px; }
}

@media (max-width: 520px) {
  .sensors { grid-template-columns: 1fr 1fr; }
  .metric__value { font-size: 20px; }
}

@media (max-width: 380px) {
  .sensors { grid-template-columns: 1fr; }
  .shell__links a span { font-size: 9px; }
}
