:root {
  --bg: #0e141c;
  --ink: #f3f0ea;
  --muted: #a8b0bc;
  --accent: #d97706;
  --accent-2: #f59e0b;
  --line: rgba(255, 255, 255, 0.12);
  --panel: rgba(14, 20, 28, 0.78);
  --ok: #34d399;
  --bad: #f87171;
  --font-display: "Oswald", "Cairo", sans-serif;
  --font-body: "Cairo", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
}

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

.login-body { min-height: 100vh; }
.login-hero {
  min-height: 100vh;
  background:
    linear-gradient(
      90deg,
      rgba(8, 12, 18, 0.12) 0%,
      rgba(8, 12, 18, 0.18) 38%,
      rgba(8, 12, 18, 0.55) 68%,
      rgba(8, 12, 18, 0.82) 100%
    ),
    var(--truck) left center / cover no-repeat;
  display: grid;
  align-items: stretch;
}
.login-scrim {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at 78% 45%, rgba(8, 12, 18, 0.35), transparent 42%);
}
.login-frame {
  position: relative;
  z-index: 1;
  width: min(1240px, 100%);
  margin: 0 auto;
  padding: 48px 28px 56px;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  min-height: 100vh;
}
.login-side {
  width: min(400px, 100%);
  display: grid;
  gap: 22px;
}
.login-brand h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 6vw, 4.6rem);
  letter-spacing: 0.04em;
  line-height: 0.92;
  text-transform: uppercase;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.45);
}
.eyebrow {
  margin: 0 0 10px;
  color: var(--accent-2);
  font-weight: 800;
  letter-spacing: 0.18em;
  font-size: 0.78rem;
}
.tagline {
  max-width: 22rem;
  color: #d7dde6;
  font-size: 1.02rem;
  line-height: 1.7;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.4);
}
.login-card {
  background: rgba(10, 14, 20, 0.72);
  border: 1px solid var(--line);
  backdrop-filter: blur(12px);
  padding: 28px 24px 24px;
  display: grid;
  gap: 14px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}
.login-card h2 {
  margin: 0 0 4px;
  font-family: var(--font-display);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.login-card label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.92rem;
}
.login-card input {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.35);
  color: var(--ink);
  padding: 12px 14px;
  font: inherit;
}
.login-card button, .btn, .admin-form button, .inline button {
  border: 0;
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  color: #1a1208;
  font-weight: 800;
  padding: 12px 16px;
  cursor: pointer;
  font-family: var(--font-body);
}
.login-card button:hover, .btn:hover { filter: brightness(1.05); }
.hint { margin: 4px 0 0; color: var(--muted); font-size: 0.86rem; }
.error {
  margin: 0;
  padding: 10px 12px;
  background: rgba(248, 113, 113, 0.15);
  border: 1px solid rgba(248, 113, 113, 0.4);
  color: #fecaca;
}

.app-body { min-height: 100vh; background:
  radial-gradient(ellipse at top left, rgba(217, 119, 6, 0.12), transparent 40%),
  linear-gradient(180deg, #121925, #0b1017 55%, #090d13);
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 28px;
  border-bottom: 1px solid var(--line);
}
.brand-lockup {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}
.brand-lockup:hover { text-decoration: none; color: inherit; }
.site-logo {
  width: 52px;
  height: 52px;
  object-fit: contain;
  border-radius: 0;
  flex-shrink: 0;
  background: transparent;
  box-shadow: none;
  border: 0;
}
.brand-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
}
.brand-group {
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: var(--accent-2);
  text-transform: uppercase;
  line-height: 1;
}
.brand-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0 10px;
}
.brand-mark {
  font-family: var(--font-display);
  letter-spacing: 0.08em;
  font-size: 1.35rem;
}
.brand-sub { color: var(--muted); font-size: 0.85rem; }
.login-logo {
  width: min(220px, 70vw);
  height: auto;
  display: block;
  margin: 0 0 8px;
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.45));
}
.login-brand {
  display: grid;
  gap: 4px;
  justify-items: start;
}
.login-group {
  margin: 10px 0 0;
  color: #c5ccd6;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.dash-logo {
  width: min(168px, 42vw);
  height: auto;
  display: block;
  margin: 0 0 12px;
  filter: drop-shadow(0 10px 28px rgba(0, 0, 0, 0.5));
}
.dash-group {
  margin: 0 0 10px;
  color: var(--accent-2);
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.22em;
  font-size: 0.78rem;
  text-transform: uppercase;
}
.topbar nav { display: flex; gap: 18px; }
.wrap { width: min(1100px, 100%); margin: 0 auto; padding: 28px 20px 60px; }
.tool-page .wrap.tool-wrap { padding: 14px 16px 28px; width: min(1280px, 100%); }
.welcome h1 { margin: 0 0 8px; font-size: 2rem; }
.status { margin: 0; }
.status.ok { color: var(--ok); }
.status.bad { color: var(--bad); }
.programs { margin-top: 34px; }
.programs h2, .panel h2 {
  font-family: var(--font-display);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.program-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.program, .panel {
  border: 1px solid var(--line);
  background: rgba(18, 24, 34, 0.75);
  padding: 22px;
}
.program-badge {
  display: inline-block;
  color: #1a1208;
  background: var(--accent-2);
  font-weight: 800;
  padding: 4px 10px;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
}
.program h3 { margin: 12px 0 4px; font-size: 1.5rem; }
.program-sub { color: var(--muted); margin: 0 0 10px; }
.btn {
  display: inline-block;
  margin-top: 14px;
  text-decoration: none !important;
}
.btn.disabled {
  background: #334155;
  color: #94a3b8;
  cursor: not-allowed;
}

/* —— Dashboard (home) —— */
.dash-body {
  position: relative;
  overflow-x: hidden;
  background: #070a0f;
}
.dash-atmosphere {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    linear-gradient(180deg, rgba(7, 10, 15, 0.28) 0%, rgba(7, 10, 15, 0.45) 45%, rgba(7, 10, 15, 0.78) 100%),
    linear-gradient(90deg, rgba(7, 10, 15, 0.55) 0%, rgba(7, 10, 15, 0.2) 48%, rgba(7, 10, 15, 0.5) 100%),
    radial-gradient(ellipse 55% 40% at 82% 12%, rgba(245, 158, 11, 0.18), transparent 58%),
    url("/static/img/md1-bg-sway-tway.jpg") center 38% / cover no-repeat;
  transform: scale(1.02);
  filter: saturate(1.08) contrast(1.06) brightness(0.95);
}
.dash-atmosphere::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.04;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.5) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.5) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.55), transparent 70%);
}
.dash-topbar {
  position: relative;
  z-index: 2;
  backdrop-filter: blur(10px);
  background: rgba(9, 13, 19, 0.55);
  border-bottom-color: rgba(255, 255, 255, 0.08);
  animation: dash-fade-down 0.55s ease both;
}
.dash-nav .nav-link {
  color: var(--ink);
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  opacity: 0.88;
  transition: opacity 0.15s ease, color 0.15s ease;
}
.dash-nav .nav-link:hover { opacity: 1; color: var(--accent-2); text-decoration: none; }
.dash-nav .nav-link-muted { color: var(--muted); font-weight: 600; }
.dash-wrap {
  position: relative;
  z-index: 1;
  width: min(1080px, 100%);
  padding-top: 36px;
  padding-bottom: 72px;
}
.dash-hero {
  max-width: 36rem;
  animation: dash-fade-up 0.65s ease 0.05s both;
}
.dash-brand {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 7vw, 4.4rem);
  letter-spacing: 0.05em;
  line-height: 0.92;
  text-transform: uppercase;
}
.dash-welcome {
  margin: 14px 0 0;
  color: #e8edf4;
  font-size: 1.15rem;
  font-weight: 700;
}
.dash-status {
  margin-top: 22px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border: 1px solid var(--line);
  background: rgba(10, 14, 20, 0.55);
  backdrop-filter: blur(8px);
  max-width: 28rem;
}
.dash-status strong {
  display: block;
  margin-bottom: 2px;
  font-size: 0.98rem;
}
.dash-status p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}
.dash-status-dot {
  width: 10px;
  height: 10px;
  margin-top: 6px;
  border-radius: 50%;
  flex: 0 0 auto;
  box-shadow: 0 0 12px currentColor;
}
.dash-status.is-ok { border-color: rgba(52, 211, 153, 0.28); }
.dash-status.is-ok .dash-status-dot { background: var(--ok); color: var(--ok); }
.dash-status.is-ok strong { color: #a7f3d0; }
.dash-status.is-warn { border-color: rgba(251, 191, 36, 0.38); }
.dash-status.is-warn .dash-status-dot { background: #fbbf24; color: #fbbf24; }
.dash-status.is-warn strong { color: #fde68a; }
.dash-status.is-bad { border-color: rgba(248, 113, 113, 0.32); }
.dash-status.is-bad .dash-status-dot { background: var(--bad); color: var(--bad); }
.dash-status.is-bad strong { color: #fecaca; }

.dash-tools {
  margin-top: 40px;
  animation: dash-fade-up 0.7s ease 0.16s both;
}
.dash-tools + .dash-tools {
  margin-top: 32px;
}
.dash-tools-head {
  margin-bottom: 14px;
  max-width: 34rem;
}
.dash-tools-head h2 {
  margin: 0 0 4px;
  font-family: var(--font-display);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 1.05rem;
  color: var(--accent-2);
  font-weight: 600;
}
.dash-tools-head p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 600;
}
.dash-tool-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.dash-tool {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 260px;
  padding: 24px 22px 22px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  background:
    linear-gradient(165deg, rgba(245, 158, 11, 0.07), transparent 42%),
    rgba(14, 20, 28, 0.72);
  transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
  overflow: hidden;
}
.dash-tool.is-locked {
  opacity: 0.78;
}
.dash-tool.is-soon {
  opacity: 0.92;
}
.dash-tool.has-visual {
  display: grid;
  /* RTL: first col (copy) on the right, second (image) fills the empty left */
  grid-template-columns: minmax(0, 1.15fr) minmax(170px, 0.95fr);
  gap: 8px 18px;
  align-items: stretch;
  min-height: 236px;
  padding: 0;
}
.dash-tool-visual {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 200px;
  margin: 0;
  padding: 18px 12px;
  background:
    radial-gradient(ellipse at 45% 55%, rgba(245, 158, 11, 0.22), transparent 58%),
    linear-gradient(160deg, rgba(28, 36, 48, 0.55), rgba(8, 12, 18, 0.9));
  border-inline-end: 1px solid rgba(255, 255, 255, 0.06);
}
.dash-tool-visual img {
  max-height: 190px;
  max-width: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 14px 22px rgba(0, 0, 0, 0.55));
  transition: transform 0.25s ease;
}
.dash-tool.is-wide-visual {
  grid-template-columns: minmax(0, 0.85fr) minmax(260px, 1.35fr);
  min-height: 260px;
}
.dash-tool.is-wide-visual .dash-tool-visual {
  min-height: 240px;
  padding: 10px 8px;
}
.dash-tool.is-wide-visual .dash-tool-visual img {
  max-height: 235px;
  width: 100%;
  max-width: 100%;
  object-fit: contain;
}
.dash-tool-copy {
  display: flex;
  flex-direction: column;
  padding: 22px 22px 20px;
  min-width: 0;
}
.dash-tool.has-visual .dash-tool-top {
  margin-bottom: 12px;
}
.dash-tool.has-visual .dash-tool-btn {
  margin-top: auto;
}
.dash-tool:hover .dash-tool-visual img {
  transform: translateY(-4px) scale(1.04);
}
.dash-tool:hover {
  border-color: rgba(245, 158, 11, 0.4);
  transform: translateY(-3px);
  background:
    linear-gradient(165deg, rgba(245, 158, 11, 0.12), transparent 48%),
    rgba(16, 22, 32, 0.88);
}
.dash-tool.is-locked:hover {
  transform: none;
  border-color: rgba(255, 255, 255, 0.1);
}
@media (max-width: 700px) {
  .dash-tool.has-visual {
    grid-template-columns: 1fr;
  }
  .dash-tool.is-wide-visual {
    grid-template-columns: 1fr;
  }
  .dash-tool-visual {
    min-height: 160px;
    border-inline-end: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  }
  .dash-tool.is-wide-visual .dash-tool-visual {
    min-height: 200px;
  }
  .dash-tool.is-wide-visual .dash-tool-visual img {
    max-height: 190px;
  }
  .dash-tool-visual img { max-height: 140px; }
}
.dash-tool-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}
.dash-tool-badge {
  display: inline-block;
  color: #1a1208;
  background: linear-gradient(180deg, #fbbf24, #d97706);
  font-weight: 800;
  padding: 5px 11px;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
}
.dash-tool-lock {
  font-family: var(--font-display);
  color: #fecaca;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  font-weight: 700;
  border: 1px solid rgba(248, 113, 113, 0.35);
  padding: 4px 8px;
}
.dash-tool-lock.is-soon {
  color: #1a1208;
  background: linear-gradient(180deg, #fbbf24, #d97706);
  border-color: rgba(251, 191, 36, 0.55);
}
.dash-tool h3 {
  margin: 0;
  font-size: 1.5rem;
  line-height: 1.15;
}
.dash-tool-sub {
  margin: 8px 0 0;
  color: var(--accent-2);
  font-size: 0.9rem;
  font-weight: 700;
}
.dash-tool-desc {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 0.92rem;
  flex: 1;
}
.dash-tool-btn {
  margin-top: 18px;
  align-self: flex-start;
  min-width: 9.5rem;
  text-align: center;
}

@keyframes dash-fade-up {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes dash-fade-down {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Parameter Change teaser — dashboard only */
.dash-announce {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 24px;
  pointer-events: none;
  overscroll-behavior: none;
}
.dash-announce[hidden] {
  display: none !important;
}
.dash-announce:not([hidden]) { pointer-events: auto; }
.dash-announce-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse at 50% 42%, rgba(217, 119, 6, 0.22), transparent 55%),
    rgba(6, 10, 16, 0.72);
  backdrop-filter: none;
  animation: announce-fade 0.35s ease both;
}
.dash-announce-card {
  position: relative;
  z-index: 2;
  width: min(420px, 100%);
  max-height: min(92vh, 640px);
  overflow: auto;
  overscroll-behavior: contain;
  padding: 28px 26px 26px;
  text-align: center;
  border-radius: 22px;
  border: 1px solid rgba(245, 158, 11, 0.35);
  background:
    linear-gradient(165deg, rgba(28, 36, 48, 0.96), rgba(12, 17, 24, 0.98));
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 28px 64px rgba(0, 0, 0, 0.45);
  animation: announce-pop 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
  pointer-events: auto;
}
.dash-announce.is-leaving .dash-announce-backdrop,
.dash-announce.is-leaving .dash-announce-card {
  animation: announce-out 0.28s ease both;
}
.dash-announce-eyebrow {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  color: var(--accent-2);
  font-weight: 700;
}
.dash-announce-mascot {
  display: block;
  width: min(200px, 58vw);
  height: auto;
  margin: 4px auto 8px;
  filter: drop-shadow(0 16px 28px rgba(0, 0, 0, 0.45));
  animation: announce-bob 2.8s ease-in-out infinite;
}
.dash-announce-title {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 5vw, 2.15rem);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff7ed;
}
.dash-announce-line {
  margin: 0 0 8px;
  font-size: clamp(1.05rem, 3.4vw, 1.25rem);
  font-weight: 800;
  color: var(--accent-2);
  line-height: 1.45;
}
.dash-announce-sub {
  margin: 0 auto 18px;
  max-width: 28rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}
.dash-announce-ticks {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 18px;
}
.dash-announce-ticks span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.35;
  animation: announce-tick 1.2s ease-in-out infinite;
}
.dash-announce-ticks span:nth-child(2) { animation-delay: 0.2s; }
.dash-announce-ticks span:nth-child(3) { animation-delay: 0.4s; }
.dash-announce-ok {
  position: relative;
  z-index: 3;
  min-width: 148px;
  padding: 12px 28px;
  font-weight: 800;
  font-size: 1rem;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  color: #1a1208;
  background: linear-gradient(135deg, #fbbf24, #d97706);
  box-shadow: 0 10px 24px rgba(217, 119, 6, 0.35);
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.dash-announce-ok:hover {
  filter: brightness(1.06);
  text-decoration: none;
}
body.has-announce {
  overflow: hidden;
  position: fixed;
  left: 0;
  right: 0;
  width: 100%;
}
body.has-announce .support-fab {
  visibility: hidden;
  pointer-events: none;
}
@keyframes announce-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes announce-pop {
  from { opacity: 0; transform: translateY(18px) scale(0.94); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes announce-out {
  to { opacity: 0; transform: scale(0.96); }
}
@keyframes announce-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}
@keyframes announce-tick {
  0%, 100% { opacity: 0.28; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.15); }
}

@media (max-width: 800px) {
  .dash-tool-grid { grid-template-columns: 1fr; }
  .dash-wrap { padding-top: 28px; }
  .dash-brand { font-size: clamp(2.4rem, 12vw, 3.2rem); }
  .dash-tool { min-height: 0; }
}

.flash {
  padding: 12px 14px;
  border: 1px solid rgba(52, 211, 153, 0.35);
  background: rgba(52, 211, 153, 0.12);
  color: #a7f3d0;
}
.admin-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  gap: 10px;
  align-items: end;
}
.admin-form label { display: grid; gap: 6px; color: var(--muted); font-size: 0.9rem; }
.admin-form input, .inline input {
  border: 1px solid var(--line);
  background: rgba(0,0,0,.28);
  color: var(--ink);
  padding: 10px 12px;
  font: inherit;
}
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: right; padding: 10px 8px; border-bottom: 1px solid var(--line); font-size: 0.92rem; }
.inline { display: flex; gap: 6px; align-items: center; }
.inline input { width: 64px; }
.inline input[type="date"] { width: auto; min-width: 138px; }
.name-edit input[type="text"] { width: 140px; min-width: 120px; }
.sub-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 210px;
}
.sub-actions .btn-danger,
.inline button.btn-danger {
  background: #8b2e2e;
  border-color: #a33;
}
.sub-actions .btn-danger:hover,
.inline button.btn-danger:hover {
  background: #a83838;
}
.license-box {
  grid-column: 1 / -1;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  padding: 12px 14px;
  margin: 0;
}
.license-box legend {
  padding: 0 8px;
  color: var(--muted);
  font-size: 0.9rem;
}
.license-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
}
.license-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.86rem;
  color: var(--text, #eee);
  cursor: pointer;
  user-select: none;
}
.license-check input {
  width: 16px;
  height: 16px;
  accent-color: #e67e22;
}
.license-form {
  display: grid;
  gap: 8px;
  min-width: 200px;
}
.license-form button {
  justify-self: start;
}
.hint {
  margin: 8px 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}
.muted { color: var(--muted); }

/* —— Admin console layout —— */
.admin-body .admin-wrap {
  max-width: 1100px;
  padding-top: 28px;
  padding-bottom: 64px;
  display: grid;
  gap: 22px;
}
.admin-hero {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-end;
  padding: 8px 2px 4px;
}
.admin-kicker {
  margin: 0 0 6px;
  color: var(--accent-2);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.admin-hero h1 {
  margin: 0;
  font-size: clamp(1.55rem, 3vw, 2rem);
  font-weight: 800;
  line-height: 1.25;
}
.admin-lead {
  margin: 8px 0 0;
  color: var(--muted);
  max-width: 42rem;
  line-height: 1.6;
}
.admin-stats {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}
.admin-stat {
  min-width: 88px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.22);
  text-align: center;
}
.admin-stat strong {
  display: block;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--accent-2);
  font-variant-numeric: tabular-nums;
}
.admin-stat span {
  color: var(--muted);
  font-size: 0.78rem;
}
.admin-flash { margin: 0; }
.admin-panel {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,0.035), rgba(0,0,0,0.16));
  padding: 20px 20px 18px;
}
.admin-panel-head {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.admin-panel-head h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
}
.admin-panel-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}
.admin-create-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.admin-create label,
.admin-mini-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.86rem;
}
.admin-create input,
.admin-create select,
.admin-name-form input,
.admin-mini-form input,
.admin-filter select {
  border: 1px solid var(--line);
  background: rgba(0,0,0,.28);
  color: var(--ink);
  padding: 10px 12px;
  font: inherit;
  width: 100%;
  box-sizing: border-box;
}
.admin-btn-danger {
  border: 1px solid rgba(239, 68, 68, 0.45);
  background: rgba(239, 68, 68, 0.12);
  color: #fecaca;
  padding: 6px 12px;
  font: inherit;
  cursor: pointer;
}
.admin-btn-danger:hover {
  background: rgba(239, 68, 68, 0.22);
}
.admin-block {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(0,0,0,0.18);
}
.admin-block-title {
  margin-bottom: 10px;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--accent-2);
  letter-spacing: 0.03em;
}
.admin-create-actions {
  margin-top: 14px;
  display: flex;
  justify-content: flex-start;
}
.admin-customer-search {
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.admin-search-label {
  display: block;
  font-weight: 700;
  margin-bottom: 6px;
}
.admin-search-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.admin-search-row input[type="search"] {
  flex: 1;
  min-width: 200px;
}
.admin-search-meta {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}
.admin-customer-layout {
  display: grid;
  grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.admin-customer-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: min(70vh, 720px);
  overflow: auto;
  padding: 2px;
  border: 1px solid var(--line);
  background: rgba(0,0,0,0.18);
}
.admin-customer-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  text-decoration: none;
  color: inherit;
  border: 1px solid transparent;
  border-bottom: 1px solid var(--line);
  background: transparent;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.admin-customer-row:last-child {
  border-bottom: none;
}
.admin-customer-row:hover {
  background: rgba(230, 126, 34, 0.08);
}
.admin-customer-row.is-selected {
  border-color: rgba(230, 126, 34, 0.55);
  background: rgba(230, 126, 34, 0.14);
}
.admin-customer-row.is-disabled {
  opacity: 0.65;
}
.admin-customer-row-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.admin-customer-name {
  font-size: 0.95rem;
}
.admin-customer-user {
  color: var(--muted);
  font-size: 0.8rem;
  font-family: Oswald, Cairo, sans-serif;
  letter-spacing: 0.03em;
}
.admin-customer-row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.admin-customer-sub {
  color: var(--muted);
  font-size: 0.78rem;
}
.admin-customer-detail {
  min-width: 0;
}
.admin-customer-placeholder {
  border: 1px dashed var(--line);
  background: rgba(0,0,0,0.15);
  padding: 28px 20px;
  text-align: center;
}
.admin-customer-placeholder strong {
  display: block;
  margin-bottom: 8px;
  font-size: 1.05rem;
}
.admin-customer-placeholder p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}
.admin-user-list {
  display: grid;
  gap: 14px;
}
@media (max-width: 960px) {
  .admin-customer-layout {
    grid-template-columns: 1fr;
  }
  .admin-customer-list {
    max-height: 280px;
  }
}
.admin-user-card {
  border: 1px solid var(--line);
  background: rgba(0,0,0,0.2);
  padding: 16px;
}
.admin-user-card.is-disabled {
  opacity: 0.72;
}
.admin-user-top {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.admin-user-handle {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.86rem;
  font-family: Oswald, Cairo, sans-serif;
  letter-spacing: 0.04em;
}
.admin-name-form,
.admin-mini-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.admin-name-form input {
  min-width: 180px;
  flex: 1;
}
.admin-user-badges {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}
.admin-badge {
  display: inline-block;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 700;
  border: 1px solid var(--line);
}
.admin-badge.is-ok {
  color: #a7f3d0;
  border-color: rgba(52, 211, 153, 0.35);
  background: rgba(52, 211, 153, 0.12);
}
.admin-badge.is-off {
  color: #fecaca;
  border-color: rgba(248, 113, 113, 0.35);
  background: rgba(248, 113, 113, 0.12);
}
.admin-badge.is-muted {
  color: var(--muted);
  background: rgba(255,255,255,0.04);
}
.btn-ghost,
.admin-user-badges .btn-ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  padding: 8px 12px;
  font: inherit;
  cursor: pointer;
}
.btn-ghost:hover { color: var(--ink); border-color: rgba(255,255,255,0.25); }
.admin-user-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 12px;
}
.admin-user-grid .admin-block { margin-top: 0; }
.admin-sub-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}
.admin-meta-label {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  margin-bottom: 2px;
}
.admin-sub-meta strong {
  font-size: 1rem;
}
.admin-sub-tools {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.admin-mini-form input[type="number"] { width: 72px; flex: 0 0 auto; }
.admin-mini-form input[type="date"] { min-width: 0; flex: 1; }
.admin-mini-form button,
.admin-name-form button,
.admin-license-form button,
.admin-create-actions button,
.admin-filter button {
  white-space: nowrap;
}
.admin-danger-label {
  display: grid;
  gap: 6px;
}
.admin-danger-label .btn-danger,
button.btn-danger {
  background: #8b2e2e;
  border: 1px solid #a33;
  color: #fff;
  padding: 10px 12px;
  font: inherit;
  cursor: pointer;
  width: 100%;
}
.admin-license-form {
  display: grid;
  gap: 12px;
}
.admin-license-form button {
  justify-self: start;
}
.admin-empty {
  margin: 0;
  padding: 28px 12px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line);
}
.admin-filter-actions {
  display: flex;
  gap: 8px;
  align-items: end;
  padding-bottom: 2px;
}
.admin-table-wrap {
  border: 1px solid rgba(255,255,255,0.06);
}
.admin-table-wrap table {
  margin: 0;
}
@media (max-width: 900px) {
  .admin-hero { flex-direction: column; align-items: stretch; }
  .admin-create-grid { grid-template-columns: 1fr 1fr; }
  .admin-user-grid { grid-template-columns: 1fr; }
  .admin-user-top { flex-direction: column; }
  .admin-user-badges { align-items: flex-start; flex-direction: row; flex-wrap: wrap; }
}
@media (max-width: 640px) {
  .admin-create-grid,
  .admin-sub-tools,
  .admin-sub-meta { grid-template-columns: 1fr; }
  .admin-name-form { flex-direction: column; align-items: stretch; }
  .admin-stats { width: 100%; }
  .admin-stat { flex: 1; }
}
.admin-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
  margin-bottom: 16px;
}
.admin-filter label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.9rem;
  min-width: 140px;
}
.admin-filter select {
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.28);
  color: var(--ink);
  padding: 10px 12px;
  font: inherit;
  min-width: 160px;
}
.admin-filter .btn.ghost,
a.btn.ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  padding: 10px 14px;
  font-weight: 700;
  text-decoration: none;
}
.admin-filter .btn.ghost:hover,
a.btn.ghost:hover {
  color: var(--ink);
  border-color: rgba(245, 158, 11, 0.45);
  text-decoration: none;
}
.log-table td { vertical-align: top; }
.log-time { white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--muted); font-size: 0.84rem; }
.log-sub { display: block; color: var(--muted); font-size: 0.78rem; font-weight: 500; }
.log-summary { max-width: 28rem; }
.log-error {
  display: block;
  margin-top: 4px;
  color: #fecaca;
  font-size: 0.8rem;
}
.log-file { color: var(--muted); font-size: 0.82rem; max-width: 12rem; overflow: hidden; text-overflow: ellipsis; }
.log-badge {
  display: inline-block;
  padding: 3px 10px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}
.log-badge.ok { background: rgba(52, 211, 153, 0.16); color: #6ee7b7; }
.log-badge.bad { background: rgba(248, 113, 113, 0.16); color: #fecaca; }
.log-empty { text-align: center; color: var(--muted); padding: 24px 8px !important; }
tr.log-bad td { background: rgba(248, 113, 113, 0.04); }

.tool-wrap { width: min(1280px, 100%); }
.tool-page .tool-welcome {
  margin-bottom: 0;
  padding-bottom: 0;
}
.tool-page .tool-welcome h1 {
  margin: 0 0 4px;
  font-size: clamp(1.6rem, 3vw, 2.1rem);
}
.tool-page .tool-welcome .hint {
  margin: 0;
  font-size: 0.9rem;
}
.tool-panel { margin-top: 12px; display: grid; gap: 12px; }
.upload-box {
  border: 1px dashed var(--line);
  background: rgba(18, 24, 34, 0.65);
  padding: 22px 18px;
  text-align: center;
  transition: border-color .15s ease, background .15s ease, max-height .2s ease, padding .2s ease, opacity .2s ease;
}
.upload-box.drag {
  border-color: var(--accent-2);
  background: rgba(217, 119, 6, 0.12);
}
.upload-box.is-collapsed {
  display: none;
}
.upload-title { margin: 0 0 12px; font-size: 1.08rem; font-weight: 700; }
.workspace {
  border: 1px solid var(--line);
  background: rgba(18, 24, 34, 0.75);
  padding: 14px;
  display: grid;
  gap: 12px;
}
.workspace-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 14px;
  padding: 10px 12px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(8, 12, 18, 0.45);
  border-radius: 12px;
  position: sticky;
  top: 8px;
  z-index: 5;
  backdrop-filter: blur(8px);
}
.workspace-toolbar .meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 22px;
  flex: 1 1 auto;
  min-width: 0;
}
.workspace-toolbar .meta-row > div {
  min-width: 0;
}
.workspace-toolbar .actions {
  margin: 0;
  flex: 0 0 auto;
}
.workspace-toolbar .actions .btn,
.workspace-toolbar .actions .btn-ghost {
  padding: 10px 14px;
  font-size: 0.92rem;
}
.meta-k {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  margin-bottom: 2px;
}
.gauge-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: stretch;
}
.gauge-grid.dual {
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
}
.temp-gauges-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.temp-note {
  margin: 0;
  padding: 8px 10px;
  border: 1px solid rgba(245, 158, 11, 0.45);
  background: rgba(245, 158, 11, 0.1);
  color: #fde68a;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
  border-radius: 8px;
}
.temp-cal-note {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid rgba(56, 189, 248, 0.45);
  background: rgba(14, 116, 144, 0.22);
  color: #e0f2fe;
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.55;
  text-align: right;
  border-radius: 8px;
}
.temp-cal-note strong {
  color: #7dd3fc;
  display: block;
  margin-bottom: 4px;
}
.temp-gauges-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  align-items: stretch;
}
.gauge-grid.dual .temp-gauges-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.gauge-badge.temp-on { background: #22c55e; color: #052e16; }
.gauge-badge.temp-off { background: #38bdf8; color: #082f49; }
.gauge-card {
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 14px;
  padding: 12px 12px 14px;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(56, 189, 248, 0.10), transparent 48%),
    linear-gradient(180deg, rgba(24, 32, 44, 0.92), rgba(8, 12, 18, 0.88));
  box-shadow:
    0 12px 28px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-height: 0;
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.gauge-card:not(.disabled):hover {
  border-color: rgba(56, 189, 248, 0.35);
  box-shadow:
    0 22px 48px rgba(0, 0, 0, 0.34),
    0 0 0 1px rgba(56, 189, 248, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.gauge-card.disabled { opacity: 0.55; }
.gauge-head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-start;
  min-height: 28px;
  flex: 0 0 auto;
}
.gauge-badge {
  background: linear-gradient(180deg, #7dd3fc, #38bdf8);
  color: #082f49;
  font-weight: 800;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  padding: 5px 10px;
  border-radius: 999px;
}
.gauge-badge.temp { background: linear-gradient(180deg, #6ee7b7, #22c55e); color: #052e16; }
.gauge-badge.temp-on { background: linear-gradient(180deg, #6ee7b7, #22c55e); color: #052e16; }
.gauge-badge.temp-off { background: linear-gradient(180deg, #7dd3fc, #38bdf8); color: #082f49; }
.gauge-card h3 {
  margin: 0;
  font-family: var(--font-display);
  letter-spacing: 0.06em;
  font-size: 1.08rem;
  font-weight: 600;
}
.gauge-stage {
  width: 100%;
  max-width: 100%;
  aspect-ratio: 300 / 225;
  height: auto;
  flex: 0 0 auto;
  position: relative;
  overflow: hidden;
}
.gauge-canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.gauge-canvas:active { cursor: grabbing; }
.gauge-card.disabled .gauge-canvas { cursor: not-allowed; }
.gauge-readout {
  margin: 2px 0 0;
  font-family: var(--font-display);
  font-size: 1.95rem;
  letter-spacing: 0.04em;
  min-height: 38px;
  line-height: 38px;
  flex: 0 0 auto;
  color: #f8fafc;
  text-shadow: 0 0 18px rgba(56, 189, 248, 0.25);
}
.gauge-readout span { color: var(--muted); font-size: 0.88rem; letter-spacing: 0.08em; }
.gauge-current {
  color: var(--muted);
  margin: 0;
  font-size: 0.9rem;
  min-height: 22px;
  flex: 0 0 auto;
}
.gauge-controls {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 4px;
  flex: 0 0 auto;
}
.gauge-controls input[type="number"] {
  width: 88px;
  text-align: center;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(8, 12, 18, 0.75);
  color: var(--ink);
  padding: 8px 6px;
}
.gauge-step {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: linear-gradient(180deg, rgba(36, 48, 64, 0.95), rgba(15, 20, 28, 0.95));
  color: var(--ink);
  font-size: 1.25rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.gauge-step:hover:not(:disabled) {
  border-color: rgba(56, 189, 248, 0.55);
  color: #7dd3fc;
  transform: translateY(-1px);
}
.gauge-step:disabled { opacity: 0.4; cursor: not-allowed; }
.gauge-card .hint {
  display: none;
}
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.btn-ghost {
  background: transparent !important;
  border: 1px solid var(--line) !important;
  color: var(--ink) !important;
}

/* Breaker switches — compact row above gauges */
.breaker-row {
  margin-top: 0;
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
/* VCM: many switches — denser / narrower cards */
.vcm-portal .breaker-row {
  gap: 6px;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
}
/* Admin-only VCM DTC OFF — standalone panel above switch grid */
.vcm-portal .vcm-dtc-panel {
  margin: 12px 0 10px;
  padding: 14px 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  border-radius: 14px;
  border: 1px solid rgba(230, 126, 34, 0.45);
  background:
    linear-gradient(135deg, rgba(230, 126, 34, 0.16), rgba(15, 23, 42, 0.55) 55%),
    rgba(15, 23, 42, 0.72);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}
.vcm-portal .vcm-dtc-panel.is-unavailable {
  opacity: 0.55;
  filter: grayscale(0.35);
}
.vcm-portal .vcm-dtc-panel-copy {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: min(100%, 280px);
  flex: 1 1 auto;
}
.vcm-portal .vcm-dtc-panel-copy h3 {
  margin: 0 0 4px;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.vcm-portal .vcm-dtc-panel .scr-file-state {
  margin: 0;
  font-size: 0.82rem;
}
.vcm-portal .vcm-dtc-panel .breaker-hint {
  display: block;
  margin: 6px 0 0;
  font-size: 0.78rem;
  opacity: 0.9;
  max-width: 36rem;
}
.vcm-portal .vcm-dtc-panel .vcm-toggle-wrap {
  flex: 0 0 auto;
  width: auto;
  min-width: 168px;
  justify-content: flex-end;
  gap: 8px;
}
.vcm-portal .vcm-dtc-panel .vcm-toggle-cap {
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}
.vcm-portal .vcm-dtc-modules {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
}
.vcm-portal .vcm-dtc-mod {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.18);
  font-size: 0.78rem;
}
.vcm-portal .vcm-dtc-mod strong {
  font-size: 0.82rem;
}
.vcm-portal .vcm-dtc-mod span {
  opacity: 0.8;
}
.vcm-portal .scr-breaker-card {
  padding: 7px 8px;
  gap: 4px 6px;
  border-radius: 10px;
  grid-template-columns: 1fr;
  justify-items: stretch;
}
.vcm-portal .scr-breaker-copy h3 {
  font-size: 0.78rem;
  line-height: 1.2;
}
.vcm-portal .scr-file-state {
  font-size: 0.68rem;
}
.vcm-portal .scr-breaker-card .breaker-hint {
  display: none;
}
.vcm-portal .vcm-toggle-wrap {
  gap: 4px;
  justify-self: stretch;
  justify-content: space-between;
  width: 100%;
}
.vcm-portal .vcm-toggle-cap {
  font-size: 0.58rem;
  min-width: 0;
  letter-spacing: 0.03em;
}
.vcm-portal .md1-feat-switch {
  width: 44px;
  height: 24px;
}
.vcm-portal .md1-feat-switch .md1-row-slider::before {
  width: 16px;
  height: 16px;
  left: 4px;
  top: 4px;
}
.vcm-portal .md1-feat-switch input:checked + .md1-row-slider::before,
.vcm-portal .md1-feat-switch.is-on .md1-row-slider::before {
  transform: translateX(20px);
}
@media (max-width: 1100px) {
  .breaker-row {
    grid-template-columns: 1fr 1fr;
  }
  .vcm-portal .breaker-row {
    grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  }
}
@media (max-width: 640px) {
  .breaker-row {
    grid-template-columns: 1fr;
  }
  .vcm-portal .breaker-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.scr-breaker-wrap {
  margin-top: 12px;
}
.scr-breaker-card {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 6px 10px;
  padding: 10px 12px;
  border: 1px solid rgba(245, 158, 11, 0.28);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(245, 158, 11, 0.08), transparent 55%),
    rgba(14, 20, 28, 0.72);
}
.scr-breaker-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.scr-breaker-copy h3 {
  margin: 0;
  font-size: 0.98rem;
}
.scr-file-state {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
}
.scr-breaker {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: grab;
  flex: 0 0 auto;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.scr-breaker:active,
.scr-breaker.is-dragging {
  cursor: grabbing;
}
.scr-breaker:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}
.scr-breaker-card.is-unavailable {
  border-color: rgba(148, 163, 184, 0.25);
  background: rgba(14, 20, 28, 0.45);
}
.md1-fault-card {
  grid-column: 1 / -1;
  grid-template-columns: 1fr;
  align-items: start;
}
.md1-fault-panel {
  grid-column: 1 / -1;
  display: grid;
  gap: 10px;
  margin-top: 4px;
  min-width: 0;
}
.md1-fault-table-wrap {
  max-height: 360px;
}
.md1-fault-table-wrap td,
.md1-fault-table-wrap th {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  white-space: nowrap;
}
.md1-fault-table-wrap th.md1-fault-desc,
.md1-fault-table-wrap td.md1-fault-desc {
  font-family: inherit;
  white-space: normal;
  min-width: 220px;
  max-width: 520px;
  line-height: 1.35;
  font-size: 0.82rem;
}
.md1-fault-table-wrap td.md1-fault-desc.is-empty {
  color: var(--muted);
  font-style: italic;
}
.breaker-hint {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.3;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.brk-housing {
  display: grid;
  justify-items: center;
  gap: 3px;
  width: 62px;
  padding: 6px 5px 8px;
  border-radius: 10px;
  border: 2px solid #4a5563;
  background:
    linear-gradient(180deg, #2a3340 0%, #151b24 55%, #0c1016 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 -2px 6px rgba(0, 0, 0, 0.45),
    0 8px 18px rgba(0, 0, 0, 0.35);
}
.brk-label {
  font-family: var(--font-display);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  font-weight: 700;
  opacity: 0.4;
  transition: opacity 0.2s ease, color 0.2s ease, text-shadow 0.2s ease;
}
.brk-label.on { color: #86efac; }
.brk-label.off { color: #fda4af; }
.scr-breaker.is-on .brk-label.on {
  opacity: 1;
  text-shadow: 0 0 10px rgba(52, 211, 153, 0.55);
}
.scr-breaker.is-off .brk-label.off {
  opacity: 1;
  text-shadow: 0 0 10px rgba(248, 113, 113, 0.45);
}
.brk-well {
  position: relative;
  width: 42px;
  height: 64px;
  border-radius: 7px;
  border: 1px solid rgba(0, 0, 0, 0.55);
  background:
    radial-gradient(ellipse at 50% 40%, #3a4554 0%, #1a222c 70%, #0d1218 100%);
  box-shadow:
    inset 0 8px 14px rgba(0, 0, 0, 0.55),
    inset 0 -4px 8px rgba(255, 255, 255, 0.04);
  overflow: hidden;
}
.brk-paddle {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 32px;
  height: 52px;
  margin-top: -26px;
  transform: translateX(-50%) rotate(-28deg);
  transform-origin: 50% 100%;
  border-radius: 6px 6px 4px 4px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background:
    linear-gradient(180deg, #f1f5f9 0%, #cbd5e1 38%, #64748b 100%);
  box-shadow:
    0 6px 12px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    inset 0 -2px 4px rgba(15, 23, 42, 0.25);
  will-change: transform;
}
.brk-grip {
  position: absolute;
  left: 18%;
  right: 18%;
  top: 14%;
  height: 42%;
  border-radius: 4px;
  background:
    repeating-linear-gradient(
      180deg,
      rgba(15, 23, 42, 0.18) 0 3px,
      rgba(255, 255, 255, 0.22) 3px 6px
    );
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.12);
}
.scr-breaker.is-on .brk-paddle {
  transform: translateX(-50%) rotate(-28deg);
  background:
    linear-gradient(180deg, #d1fae5 0%, #6ee7b7 40%, #059669 100%);
}
.scr-breaker.is-off .brk-paddle {
  transform: translateX(-50%) rotate(28deg);
  background:
    linear-gradient(180deg, #fecdd3 0%, #fb7185 40%, #e11d48 100%);
}
.scr-breaker.is-on .brk-housing {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 -2px 6px rgba(0, 0, 0, 0.45),
    0 0 14px rgba(52, 211, 153, 0.2),
    0 8px 18px rgba(0, 0, 0, 0.35);
}
.scr-breaker.is-off .brk-housing {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 -2px 6px rgba(0, 0, 0, 0.45),
    0 0 14px rgba(248, 113, 113, 0.16),
    0 8px 18px rgba(0, 0, 0, 0.35);
}
.scr-breaker.is-mixed .brk-housing {
  outline: 1px dashed rgba(251, 191, 36, 0.55);
}
.scr-breaker.is-mixed .brk-paddle {
  transform: translateX(-50%) rotate(0deg);
  background:
    linear-gradient(180deg, #fde68a 0%, #fbbf24 40%, #d97706 100%);
}
.scr-breaker.is-dragging .brk-paddle {
  filter: brightness(1.08);
}

@media (max-width: 900px) {
  .scr-breaker-card {
    text-align: start;
  }
}
.tool-alert {
  padding: 10px 12px;
  border: 1px solid var(--line);
}
.tool-alert.ok {
  border-color: rgba(52, 211, 153, 0.35);
  background: rgba(52, 211, 153, 0.12);
  color: #a7f3d0;
}
.tool-alert.bad {
  border-color: rgba(248, 113, 113, 0.4);
  background: rgba(248, 113, 113, 0.15);
  color: #fecaca;
}
.search-bar {
  display: grid;
  grid-template-columns: 1.6fr 0.7fr auto;
  gap: 12px;
  align-items: end;
}
.search-field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.9rem;
}
.search-field.narrow { max-width: 180px; }
.search-field input,
.search-field select {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.28);
  color: var(--ink);
  padding: 11px 12px;
  font: inherit;
}
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--line);
  padding: 6px 10px;
  display: inline-flex;
  gap: 6px;
  align-items: center;
  color: var(--muted);
  font-size: 0.86rem;
}
.dtc-table-wrap { max-height: 480px; overflow: auto; border: 1px solid var(--line); }
.dtc-table-wrap tr.off td { color: #94a3b8; }
.dtc-table-wrap td.dtc-desc {
  max-width: 28rem;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}
.dtc-table-wrap td.dtc-desc.is-empty { opacity: 0.55; }
.dtc-table-wrap .dtc-desc-main {
  display: block;
  color: var(--text, #e2e8f0);
  font-weight: 600;
  font-size: 0.92rem;
}
.dtc-table-wrap .dtc-desc-dfc {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.75rem;
  opacity: 0.65;
  font-family: ui-monospace, Consolas, monospace;
  direction: ltr;
  text-align: right;
}
.dtc-table-wrap tr.off .md1-row-slider {
  background: #475569;
}

/* DTC system OFF control strip */
.dtc-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  justify-content: space-between;
  gap: 12px;
  margin: 14px 0 4px;
}
.dtc-sys-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  flex: 1 1 280px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid rgba(245, 158, 11, 0.22);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 55%),
    rgba(10, 14, 20, 0.72);
}
.dtc-sys-caption {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--accent-2);
  line-height: 1;
  flex: 0 0 auto;
}
.dtc-sys-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}
.dtc-sys-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 9px 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(8, 12, 18, 0.88);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    background 0.15s ease,
    transform 0.15s ease,
    box-shadow 0.15s ease;
}
.dtc-sys-btn[hidden] {
  display: none !important;
}
.dtc-sys-btn:hover {
  border-color: rgba(245, 158, 11, 0.55);
  background: rgba(217, 119, 6, 0.12);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.28);
}
.dtc-sys-btn:active {
  transform: translateY(0);
}
.dtc-sys-code {
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1;
}
.dtc-sys-action {
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1;
  padding: 4px 6px;
  color: #fecaca;
  background: rgba(248, 113, 113, 0.14);
  border: 1px solid rgba(248, 113, 113, 0.35);
}
.dtc-sys-btn--all {
  border-color: rgba(245, 158, 11, 0.38);
  background:
    linear-gradient(180deg, rgba(245, 158, 11, 0.16), rgba(8, 12, 18, 0.9));
}
.dtc-sys-btn--all .dtc-sys-action {
  color: #1a1208;
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  border-color: transparent;
}
.dtc-sys-btn--all:hover {
  border-color: rgba(245, 158, 11, 0.7);
  background:
    linear-gradient(180deg, rgba(245, 158, 11, 0.24), rgba(8, 12, 18, 0.92));
}
/* Libya flag: red / black / green + crescent & star */
.dtc-sys-btn--lipya {
  border-color: rgba(255, 255, 255, 0.35);
  color: #fff;
  background:
    linear-gradient(
      180deg,
      #e70013 0%,
      #e70013 33.34%,
      #000000 33.34%,
      #000000 66.66%,
      #239e46 66.66%,
      #239e46 100%
    );
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.35);
}
.dtc-sys-btn--lipya:hover {
  border-color: rgba(255, 255, 255, 0.6);
  background:
    linear-gradient(
      180deg,
      #ff1a2b 0%,
      #ff1a2b 33.34%,
      #111111 33.34%,
      #111111 66.66%,
      #2bb855 66.66%,
      #2bb855 100%
    );
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.35),
    0 8px 18px rgba(0, 0, 0, 0.35);
}
.dtc-sys-btn--lipya .dtc-sys-code {
  color: #fffef8;
  padding: 5px 8px;
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.22);
  text-shadow: none;
  letter-spacing: 0.06em;
}
.dtc-sys-btn--lipya .dtc-sys-action {
  color: #111;
  background: #fffef8;
  border-color: transparent;
  font-weight: 800;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25);
}
.dtc-lipya-flag {
  display: inline-flex;
  flex: 0 0 auto;
  width: 28px;
  height: 18px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}
.dtc-lipya-flag svg {
  display: block;
  width: 100%;
  height: 100%;
}
.dtc-download-btn {
  margin-top: 0 !important;
  align-self: center;
  flex: 0 0 auto;
  padding: 12px 18px;
  white-space: nowrap;
}
@media (max-width: 720px) {
  .dtc-actions {
    flex-direction: column;
  }
  .dtc-download-btn {
    width: 100%;
    text-align: center;
  }
}

.mini {
  border: 0;
  background: var(--accent);
  color: #1a1208;
  font-weight: 800;
  padding: 6px 10px;
  cursor: pointer;
}
.md1-row-switch {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 24px;
  vertical-align: middle;
  cursor: pointer;
}
.md1-feat-switch {
  position: relative;
  display: inline-block;
  width: 72px;
  height: 40px;
  flex: 0 0 auto;
  cursor: pointer;
}
.md1-row-switch input,
.md1-feat-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
.md1-row-slider {
  position: absolute;
  inset: 0;
  background: #64748b;
  border-radius: 999px;
  transition: background 0.18s ease;
}
.md1-row-slider::before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.18s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}
.md1-feat-switch .md1-row-slider::before {
  width: 32px;
  height: 32px;
  left: 4px;
  top: 4px;
}
.md1-row-switch input:checked + .md1-row-slider,
.md1-feat-switch input:checked + .md1-row-slider,
.md1-feat-switch.is-on .md1-row-slider {
  background: #22c55e;
}
.md1-row-switch input:checked + .md1-row-slider::before {
  transform: translateX(18px);
}
.md1-feat-switch input:checked + .md1-row-slider::before,
.md1-feat-switch.is-on .md1-row-slider::before {
  transform: translateX(32px);
}
.md1-feat-switch.is-off .md1-row-slider {
  background: #64748b;
}
.md1-feat-switch.is-mixed .md1-row-slider {
  background: #f59e0b;
}
.md1-feat-switch.is-mixed .md1-row-slider::before {
  transform: translateX(16px);
}
.md1-row-switch input:disabled + .md1-row-slider,
.md1-feat-switch input:disabled + .md1-row-slider {
  opacity: 0.5;
  cursor: not-allowed;
}
.md1-fault-table-wrap tr.off .md1-row-slider {
  background: #475569;
}
.scr-breaker-card.is-mixed {
  border-color: rgba(245, 158, 11, 0.45);
}

/* Center orange circular loader */
.set-loader {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  background: rgba(8, 12, 18, 0.62);
  backdrop-filter: blur(3px);
}
.set-loader[hidden] { display: none !important; }
body.set-loading { overflow: hidden; }
.set-loader-panel {
  display: grid;
  justify-items: center;
  gap: 16px;
}
.set-spinner {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 4px solid rgba(245, 158, 11, 0.22);
  border-top-color: #f59e0b;
  border-right-color: #d97706;
  animation: set-spin 0.75s linear infinite;
  box-shadow: 0 0 24px rgba(245, 158, 11, 0.2);
}
.set-loader-msg {
  margin: 0;
  font-weight: 700;
  font-size: 1rem;
  color: var(--ink);
  text-align: center;
}
@keyframes set-spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 900px) {
  .login-hero {
    background:
      linear-gradient(180deg, rgba(8, 12, 18, 0.35) 0%, rgba(8, 12, 18, 0.78) 55%, rgba(8, 12, 18, 0.92) 100%),
      var(--truck) 20% center / cover no-repeat;
  }
  .login-frame {
    align-items: end;
    padding-top: 36px;
  }
  .login-side { width: 100%; }
  .program-grid { grid-template-columns: 1fr; }
  .admin-form { grid-template-columns: 1fr; }
  .gauge-grid, .gauge-grid.dual, .gauge-grid.dual .temp-gauges-row, .meta-row, .search-bar { grid-template-columns: 1fr; }
  .search-field.narrow { max-width: none; }
}

/* —— MD1 portal stage (S-Way / T-Way) —— */
.md1-portal {
  position: relative;
  isolation: isolate;
  background: #070a0f;
}
.md1-stage {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.md1-stage-photo {
  position: absolute;
  inset: 0;
  background:
    url("/static/img/md1-bg-sway-tway.jpg") center 32% / cover no-repeat;
  transform: scale(1.03);
  filter: saturate(1.12) contrast(1.12) brightness(1.08);
  animation: md1-stage-drift 28s ease-in-out infinite alternate;
}
.md1-stage-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at 50% 30%, rgba(0, 0, 0, 0.35), transparent 70%);
  opacity: 0.18;
}
.md1-stage-scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(7, 10, 15, 0.22) 0%, rgba(7, 10, 15, 0.38) 48%, rgba(7, 10, 15, 0.62) 100%),
    radial-gradient(ellipse at 78% 18%, rgba(217, 119, 6, 0.14), transparent 46%),
    linear-gradient(90deg, rgba(7, 10, 15, 0.35) 0%, rgba(7, 10, 15, 0.12) 50%, rgba(7, 10, 15, 0.32) 100%);
  transition: opacity 0.9s ease, background 0.9s ease;
}
.md1-intro-banner {
  position: fixed;
  inset: 0;
  z-index: 2;
  display: grid;
  place-content: end center;
  justify-items: center;
  gap: 6px;
  padding: 0 24px 12vh;
  text-align: center;
  pointer-events: none;
  opacity: 0;
}
.md1-intro-logo {
  width: min(160px, 38vw);
  height: auto;
  margin: 0 0 4px;
  filter: drop-shadow(0 10px 28px rgba(0, 0, 0, 0.55));
}
.md1-intro-kicker {
  margin: 0 0 8px;
  color: var(--accent-2);
  font-weight: 800;
  letter-spacing: 0.28em;
  font-size: 0.78rem;
  text-transform: uppercase;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.65);
}
.md1-intro-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2rem, 6vw, 3.6rem);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1;
  text-shadow: 0 4px 28px rgba(0, 0, 0, 0.75);
}
.md1-intro-sub {
  margin: 10px 0 0;
  color: rgba(243, 240, 234, 0.85);
  letter-spacing: 0.14em;
  font-size: 0.9rem;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.7);
}

/* Intro: full clear background showcase */
.md1-portal.md1-intro .md1-stage-scrim {
  opacity: 0.18;
  background:
    linear-gradient(180deg, rgba(7, 10, 15, 0.08) 0%, rgba(7, 10, 15, 0.12) 55%, rgba(7, 10, 15, 0.42) 100%);
}
.md1-portal.md1-intro .md1-stage-grid {
  opacity: 0;
}
.md1-portal.md1-intro .md1-stage-photo {
  filter: saturate(1.18) contrast(1.14) brightness(1.12);
}
.md1-portal.md1-intro .md1-intro-banner {
  opacity: 1;
  animation: md1-intro-in 0.9s ease both;
}
.md1-portal.md1-intro > .topbar,
.md1-portal.md1-intro > .wrap {
  opacity: 0;
  transform: translateY(28px);
  pointer-events: none;
}
.md1-portal.md1-ready .md1-intro-banner {
  opacity: 0;
  transition: opacity 0.7s ease;
}
.md1-portal.md1-ready > .topbar,
.md1-portal.md1-ready > .wrap {
  opacity: 1;
  transform: none;
  transition: opacity 0.9s ease, transform 0.9s ease;
}
.md1-portal.md1-ready .tool-panel,
.md1-portal.md1-ready .md1-feat-card,
.md1-portal.md1-ready .md1-fault-card,
.md1-portal.md1-ready .upload-box {
  animation: md1-card-rise 0.85s ease both;
}
.md1-portal.md1-ready .md1-feat-card:nth-child(1) { animation-delay: 0.08s; }
.md1-portal.md1-ready .md1-feat-card:nth-child(2) { animation-delay: 0.18s; }
.md1-portal.md1-ready .md1-feat-card:nth-child(3) { animation-delay: 0.28s; }
.md1-portal.md1-ready .md1-fault-card { animation-delay: 0.38s; }
@keyframes md1-intro-in {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}
@keyframes md1-card-rise {
  from { opacity: 0; transform: translateY(22px); }
  to { opacity: 1; transform: none; }
}
@keyframes md1-stage-drift {
  from { transform: scale(1.04) translate3d(0, 0, 0); }
  to { transform: scale(1.08) translate3d(-1.2%, -0.8%, 0); }
}
.md1-portal > .topbar,
.md1-portal > .wrap {
  position: relative;
  z-index: 1;
}
.md1-portal .topbar {
  background: rgba(8, 12, 18, 0.55);
  backdrop-filter: blur(10px);
  border-bottom-color: rgba(245, 158, 11, 0.18);
}
.md1-hero {
  padding: 18px 4px 8px;
}
.md1-eyebrow {
  margin: 0 0 8px;
  color: var(--accent-2);
  font-weight: 800;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
  text-transform: uppercase;
}
.md1-portal .tool-welcome h1 {
  font-family: var(--font-display);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.75), 0 0 28px rgba(0, 0, 0, 0.45);
}
.md1-portal .tool-welcome .hint,
.md1-eyebrow {
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.7);
}
.md1-portal .tool-panel,
.md1-portal .upload-box,
.md1-portal .workspace {
  background: rgba(10, 14, 20, 0.82);
  backdrop-filter: blur(14px);
  border-color: rgba(245, 158, 11, 0.24);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.35);
}
.md1-feat-card {
  position: relative;
  overflow: hidden;
  display: block;
  min-height: 220px;
  padding: 0;
  border-radius: 16px;
  border: 1px solid rgba(245, 158, 11, 0.36);
  background: #0a0e14;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.md1-feat-card:hover {
  transform: translateY(-2px);
  border-color: rgba(245, 158, 11, 0.55);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.5);
}
.md1-feat-media {
  position: absolute;
  inset: 0;
  width: auto;
  height: auto;
  border-radius: 0;
  border: 0;
  box-shadow: none;
  background:
    var(--feat) center / cover no-repeat;
  transform: scale(1.02);
  transition: transform 0.45s ease;
}
.md1-feat-card:hover .md1-feat-media {
  transform: scale(1.07);
}
.md1-feat-overlay {
  position: absolute;
  inset: auto 0 0 0;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 12px;
  padding: 56px 16px 14px;
  background:
    linear-gradient(180deg, rgba(7, 10, 15, 0) 0%, rgba(7, 10, 15, 0.55) 38%, rgba(7, 10, 15, 0.92) 100%);
}
.md1-feat-card .scr-breaker-copy {
  z-index: 1;
  gap: 4px;
}
.md1-feat-card .scr-breaker-copy h3 {
  font-family: var(--font-display);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.65);
}
.md1-feat-card .scr-file-state,
.md1-feat-card .hint {
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.7);
}
.md1-feat-card .md1-feat-switch {
  z-index: 1;
  margin-bottom: 2px;
}
.md1-feat-card.is-mixed {
  border-color: rgba(245, 158, 11, 0.6);
}
@media (max-width: 1100px) {
  .md1-feat-card {
    min-height: 200px;
  }
}
@media (max-width: 720px) {
  .md1-feat-card {
    min-height: 190px;
    grid-template-columns: unset;
  }
  .md1-feat-media {
    width: auto;
    height: auto;
  }
  .md1-feat-card .md1-feat-switch {
    grid-column: auto;
    justify-self: auto;
  }
  .md1-stage-photo {
    background-position: 62% center;
  }
}
.md1-portal .md1-fault-card {
  background:
    linear-gradient(180deg, rgba(12, 16, 22, 0.78), rgba(10, 14, 20, 0.88));
  border-color: rgba(245, 158, 11, 0.28);
}
.md1-portal .md1-fault-table-wrap {
  background: rgba(6, 9, 14, 0.55);
  border-radius: 10px;
}

/* —— VCM portal stage (IVECO T-Way) —— */
.vcm-portal {
  position: relative;
  isolation: isolate;
  background: #070a0f;
}
.vcm-stage {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.vcm-stage-photo {
  position: absolute;
  inset: 0;
  background:
    url("/static/img/vcm-bg-tway.jpg") center 42% / cover no-repeat;
  transform: scale(1.03);
  filter: saturate(1.1) contrast(1.08) brightness(1.02);
}
.vcm-stage-scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(7, 10, 15, 0.28) 0%, rgba(7, 10, 15, 0.42) 48%, rgba(7, 10, 15, 0.72) 100%),
    radial-gradient(ellipse at 78% 18%, rgba(217, 119, 6, 0.14), transparent 46%),
    linear-gradient(90deg, rgba(7, 10, 15, 0.42) 0%, rgba(7, 10, 15, 0.14) 50%, rgba(7, 10, 15, 0.4) 100%);
}
.vcm-portal > .topbar,
.vcm-portal > .wrap {
  position: relative;
  z-index: 1;
}
.vcm-portal .topbar {
  background: rgba(9, 13, 19, 0.55);
  backdrop-filter: blur(10px);
  border-bottom-color: rgba(245, 158, 11, 0.2);
}
.vcm-portal .tool-welcome h1 {
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.65);
}
.vcm-portal .tool-welcome .hint {
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.7);
}
.vcm-portal .tool-panel,
.vcm-portal .upload-box,
.vcm-portal .workspace {
  background: rgba(10, 14, 20, 0.82);
  backdrop-filter: blur(14px);
  border-color: rgba(245, 158, 11, 0.24);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.35);
}

/* —— VCM toggle switches —— */
.vcm-toggle-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-self: end;
  direction: ltr;
}
.vcm-toggle-cap {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: rgba(148, 163, 184, 0.55);
  min-width: 2.6rem;
  text-align: center;
  transition: color 0.18s ease;
}
.vcm-toggle-wrap.is-on .vcm-toggle-cap.on,
.vcm-toggle-wrap.is-off .vcm-toggle-cap.off {
  color: #f8fafc;
}
.vcm-portal .scr-breaker-card {
  background: rgba(10, 14, 20, 0.78);
  backdrop-filter: blur(12px);
}
.vcm-portal .scr-breaker-card .breaker-hint {
  grid-column: 1 / -1;
}

/* —— Support / WhatsApp FAB —— */
.support-fab {
  position: fixed;
  z-index: 80;
  bottom: 22px;
  inset-inline-start: 22px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  font-family: var(--font-body);
}
.support-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 0;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(180deg, #25d366, #128c7e);
  padding: 12px 18px 12px 14px;
  border-radius: 999px;
  font: inherit;
  font-weight: 800;
  box-shadow: 0 10px 28px rgba(18, 140, 126, 0.45);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.support-toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(18, 140, 126, 0.55);
}
.support-toggle-icon { display: block; flex-shrink: 0; }
.support-toggle-label { letter-spacing: 0.02em; }
.support-fab.is-open .support-toggle {
  background: linear-gradient(180deg, #334155, #1e293b);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}
.support-panel {
  display: none;
  width: min(300px, calc(100vw - 40px));
  background: rgba(10, 14, 20, 0.94);
  border: 1px solid rgba(37, 211, 102, 0.28);
  backdrop-filter: blur(14px);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
  padding: 14px 12px 12px;
  gap: 8px;
  animation: support-pop 0.22s ease both;
}
.support-fab.is-open .support-panel {
  display: grid;
}
.support-panel-head {
  display: grid;
  gap: 2px;
  padding: 2px 6px 8px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 2px;
}
.support-panel-head strong {
  font-family: var(--font-display);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.95rem;
}
.support-panel-head span {
  color: var(--muted);
  font-size: 0.82rem;
}
.support-contact {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 10px;
  color: inherit;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.support-contact:hover {
  text-decoration: none;
  background: rgba(37, 211, 102, 0.1);
  border-color: rgba(37, 211, 102, 0.28);
}
.support-wa {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: #fff;
  background: #25d366;
}
.support-meta {
  display: grid;
  gap: 1px;
  min-width: 0;
}
.support-meta strong {
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.3;
}
.support-meta em {
  font-style: normal;
  color: var(--accent-2);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.support-meta span {
  color: var(--muted);
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
}
@keyframes support-pop {
  from { opacity: 0; transform: translateY(10px) scale(0.96); }
  to { opacity: 1; transform: none; }
}
@media (max-width: 640px) {
  .support-fab { bottom: 16px; inset-inline-start: 14px; }
  .support-toggle { padding: 12px 14px; }
  .support-toggle-label { display: none; }
}

/* —— Login About CTA —— */
.login-about-btn {
  display: block;
  text-align: center;
  text-decoration: none !important;
  background: transparent !important;
  border: 1px solid rgba(245, 158, 11, 0.45);
  color: var(--accent-2) !important;
  padding: 11px 14px;
  font: inherit;
  font-weight: 700;
}
.login-about-btn:hover {
  border-color: var(--accent-2);
  background: rgba(245, 158, 11, 0.1) !important;
  filter: none;
}

/* —— Public About page (calibration lab) —— */
.about-body { position: relative; background: #070a0f; }
.about-atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(7, 10, 15, 0.55) 0%, rgba(7, 10, 15, 0.72) 50%, rgba(7, 10, 15, 0.92) 100%),
    radial-gradient(ellipse 50% 40% at 18% 8%, rgba(217, 119, 6, 0.16), transparent 58%),
    url("/static/img/md1-bg-sway-tway.jpg") center 30% / cover no-repeat;
  filter: saturate(1.05) contrast(1.08);
}
.about-atmosphere::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.05;
  background-image:
    linear-gradient(rgba(255,255,255,0.55) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.55) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: radial-gradient(ellipse at 50% 20%, rgba(0,0,0,0.5), transparent 72%);
}
.about-topbar {
  position: relative;
  z-index: 2;
  background: rgba(8, 12, 18, 0.55);
  backdrop-filter: blur(10px);
  border-bottom-color: rgba(245, 158, 11, 0.18);
}
.about-wrap {
  position: relative;
  z-index: 1;
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
  padding: 40px 0 88px;
  display: grid;
  gap: 42px;
}
.about-hero {
  text-align: center;
  padding: 36px 12px 12px;
}
.about-hero-kicker {
  margin: 0 0 14px;
  color: var(--accent-2);
  font-weight: 800;
  letter-spacing: 0.22em;
  font-size: 0.74rem;
  text-transform: uppercase;
  text-shadow: 0 2px 14px rgba(0,0,0,0.65);
}
.about-hero-logo {
  width: min(200px, 48vw);
  height: auto;
  margin-bottom: 20px;
  filter: drop-shadow(0 14px 32px rgba(0,0,0,0.55));
}
.about-hero h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 5.2vw, 3.25rem);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  line-height: 1.08;
  text-shadow: 0 4px 24px rgba(0,0,0,0.7);
}
.about-hero-text {
  margin: 16px auto 0;
  max-width: 34rem;
  color: rgba(231, 236, 243, 0.9);
  line-height: 1.75;
  font-size: 1.04rem;
  text-shadow: 0 1px 10px rgba(0,0,0,0.55);
}
.about-hero-actions {
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}
.about-hero-actions .btn,
.about-cta .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 150px;
  text-decoration: none !important;
}
.about-hero-actions .btn-ghost,
.about-cta .btn-ghost {
  background: rgba(8, 12, 18, 0.45);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: var(--ink);
  backdrop-filter: blur(8px);
}
.about-section-head {
  margin-bottom: 18px;
}
.about-section-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.about-section-head p {
  margin: 8px 0 0;
  color: var(--muted);
}
.about-workflow {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.about-workflow li {
  border: 1px solid rgba(245, 158, 11, 0.22);
  background: rgba(10, 14, 20, 0.78);
  backdrop-filter: blur(12px);
  padding: 18px 16px;
  box-shadow: 0 12px 28px rgba(0,0,0,0.28);
}
.about-step-n {
  display: inline-flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  border: 1px solid rgba(245, 158, 11, 0.45);
  color: var(--accent-2);
  font-weight: 800;
  font-size: 0.85rem;
}
.about-workflow strong {
  display: block;
  margin-bottom: 6px;
}
.about-workflow p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}
.about-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 26px;
}
.about-toc a {
  border: 1px solid rgba(245, 158, 11, 0.22);
  padding: 8px 14px;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-decoration: none !important;
  background: rgba(10, 14, 20, 0.72);
  backdrop-filter: blur(8px);
}
.about-toc a:hover {
  border-color: var(--accent-2);
  color: var(--accent-2);
}
.about-lab {
  display: grid;
  grid-template-columns: minmax(220px, 320px) 1fr;
  gap: 22px 28px;
  padding: 0;
  margin-bottom: 28px;
  border: 1px solid rgba(245, 158, 11, 0.24);
  background: rgba(10, 14, 20, 0.82);
  backdrop-filter: blur(14px);
  box-shadow: 0 18px 44px rgba(0,0,0,0.38);
  overflow: hidden;
}
.about-lab.is-flip {
  grid-template-columns: 1fr minmax(220px, 320px);
}
.about-lab.is-flip .about-lab-media { order: 2; }
.about-lab.is-flip .about-lab-copy { order: 1; }
.about-lab.is-flip .about-lab-shots { order: 3; }
.about-lab-media {
  position: relative;
  min-height: 280px;
  background:
    radial-gradient(circle at 50% 40%, rgba(245,158,11,0.14), transparent 62%),
    linear-gradient(160deg, rgba(18, 24, 34, 0.9), rgba(8, 11, 16, 0.95));
}
.about-lab.is-md1 .about-lab-media {
  background:
    linear-gradient(180deg, rgba(7,10,15,0.15), rgba(7,10,15,0.55)),
    url("/static/img/md1-bg-sway-tway.jpg") center / cover no-repeat;
}
.about-lab.is-edc .about-lab-media {
  background:
    linear-gradient(180deg, rgba(7,10,15,0.2), rgba(7,10,15,0.62)),
    url("/static/img/iveco-truck-login.jpg") center 40% / cover no-repeat;
}
.about-lab.is-chassis .about-lab-media {
  background:
    linear-gradient(180deg, rgba(7,10,15,0.25), rgba(7,10,15,0.65)),
    url("/static/img/vcm-bg-tway.jpg") center / cover no-repeat;
}
.about-lab-frame {
  position: absolute;
  inset: 18px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(7, 10, 15, 0.35);
  backdrop-filter: blur(4px);
}
.about-lab-frame img {
  width: min(88%, 240px);
  max-height: 220px;
  object-fit: contain;
  filter: drop-shadow(0 16px 28px rgba(0,0,0,0.55));
}
.about-lab-frame img[src*=".jpg"] {
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: cover;
  filter: none;
}
.about-lab-family {
  position: absolute;
  bottom: 14px;
  inset-inline-start: 14px;
  z-index: 2;
  padding: 5px 10px;
  border: 1px solid rgba(245, 158, 11, 0.4);
  background: rgba(7, 10, 15, 0.78);
  color: var(--accent-2);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}
.about-soon {
  position: absolute;
  top: 14px;
  inset-inline-start: 14px;
  z-index: 2;
  background: rgba(217, 119, 6, 0.95);
  color: #111;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 5px 10px;
  letter-spacing: 0.06em;
}
.about-lab-copy {
  padding: 26px 26px 22px 8px;
}
.about-lab.is-flip .about-lab-copy {
  padding: 26px 8px 22px 26px;
}
.about-tool-badge {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--accent-2);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.14em;
}
.about-lab-copy h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2.4vw, 1.8rem);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.about-tool-tag {
  margin: 8px 0 18px;
  color: var(--muted);
}
.about-lab-block { margin-top: 6px; }
.about-lab-block h4 {
  margin: 0 0 10px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-2);
}
.about-capability {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.about-capability li {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  align-items: start;
  color: #e4e9f0;
  line-height: 1.55;
}
.about-capability li span {
  display: inline-flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: var(--accent-2);
  font-size: 0.75rem;
  font-weight: 800;
}
.about-flow {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.about-flow li {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 10px;
  align-items: start;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(0,0,0,0.22);
}
.about-flow em {
  font-style: normal;
  color: var(--accent-2);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}
.about-flow span {
  color: #d7dde6;
  line-height: 1.55;
  font-size: 0.94rem;
}
.about-save-tip {
  margin: 16px 0 0;
  padding: 12px 14px;
  border-inline-start: 3px solid var(--accent-2);
  background: rgba(245, 158, 11, 0.09);
  color: #e8ecf2;
  font-size: 0.9rem;
  line-height: 1.55;
}
.about-lab-shots {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.about-lab-shots figure {
  margin: 0;
  border-inline-end: 1px solid rgba(255,255,255,0.06);
  background: rgba(0,0,0,0.28);
  overflow: hidden;
}
.about-lab-shots figure:last-child { border-inline-end: 0; }
.about-lab-shots img {
  display: block;
  width: 100%;
  height: 148px;
  object-fit: cover;
  object-position: center;
  transition: transform 0.45s ease;
}
.about-lab-shots figure:hover img { transform: scale(1.04); }
.about-lab-shots figcaption {
  padding: 9px 12px;
  color: var(--muted);
  font-size: 0.78rem;
}
.about-cta {
  text-align: center;
  padding: 36px 20px;
  border: 1px solid rgba(245, 158, 11, 0.24);
  background: rgba(10, 14, 20, 0.8);
  backdrop-filter: blur(12px);
  box-shadow: 0 16px 40px rgba(0,0,0,0.35);
}
.about-cta h2 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.about-cta p { margin: 0; color: var(--muted); }
@media (max-width: 900px) {
  .about-workflow { grid-template-columns: 1fr 1fr; }
  .about-lab,
  .about-lab.is-flip {
    grid-template-columns: 1fr;
  }
  .about-lab.is-flip .about-lab-media,
  .about-lab.is-flip .about-lab-copy { order: unset; }
  .about-lab-media { min-height: 240px; }
  .about-lab-copy,
  .about-lab.is-flip .about-lab-copy { padding: 22px; }
  .about-lab-shots { grid-template-columns: 1fr; }
  .about-lab-shots figure { border-inline-end: 0; border-bottom: 1px solid rgba(255,255,255,0.06); }
  .about-lab-shots figure:last-child { border-bottom: 0; }
}
@media (max-width: 520px) {
  .about-workflow { grid-template-columns: 1fr; }
}

/* —— Shared EDC / lab portal stage —— */
.lab-portal,
.edc-portal {
  position: relative;
  isolation: isolate;
  background: #070a0f;
}
.lab-stage {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.lab-stage-photo {
  position: absolute;
  inset: 0;
  background:
    var(--lab-bg, url("/static/img/iveco-truck-login.jpg")) center 36% / cover no-repeat;
  transform: scale(1.03);
  filter: saturate(1.1) contrast(1.1) brightness(0.95);
  animation: md1-stage-drift 28s ease-in-out infinite alternate;
}
.lab-stage-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at 50% 30%, rgba(0, 0, 0, 0.35), transparent 70%);
  opacity: 0.16;
}
.lab-stage-scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(7, 10, 15, 0.42) 0%, rgba(7, 10, 15, 0.55) 48%, rgba(7, 10, 15, 0.78) 100%),
    radial-gradient(ellipse at 78% 18%, rgba(217, 119, 6, 0.12), transparent 46%),
    linear-gradient(90deg, rgba(7, 10, 15, 0.4) 0%, rgba(7, 10, 15, 0.15) 50%, rgba(7, 10, 15, 0.38) 100%);
}
.edc-portal.is-dtc { --lab-bg: url("/static/img/iveco-truck-login.jpg"); }
.edc-portal.is-daily { --lab-bg: url("/static/img/vcm-bg-tway.jpg"); }
.edc-portal.is-immo { --lab-bg: url("/static/img/md1-bg-sway-tway.jpg"); }
.lab-portal > .topbar,
.lab-portal > .wrap,
.edc-portal > .topbar,
.edc-portal > .wrap {
  position: relative;
  z-index: 1;
}
.edc-portal .topbar {
  background: rgba(8, 12, 18, 0.55);
  backdrop-filter: blur(10px);
  border-bottom-color: rgba(245, 158, 11, 0.18);
}
.edc-hero {
  padding: 18px 4px 8px;
}
.edc-eyebrow {
  margin: 0 0 8px;
  color: var(--accent-2);
  font-weight: 800;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
  text-transform: uppercase;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.7);
}
.edc-portal .welcome h1,
.edc-portal .tool-welcome h1 {
  font-family: var(--font-display);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.75), 0 0 28px rgba(0, 0, 0, 0.45);
}
.edc-portal .welcome .hint,
.edc-portal .tool-welcome .hint {
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.7);
}
.edc-portal .tool-panel,
.edc-portal .upload-box,
.edc-portal .workspace {
  background: rgba(10, 14, 20, 0.82);
  backdrop-filter: blur(14px);
  border-color: rgba(245, 158, 11, 0.24);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.35);
}
.edc-portal .scr-breaker-card,
.edc-portal .meta-row,
.edc-portal .dtc-sys-bar,
.edc-portal .search-bar {
  border-color: rgba(245, 158, 11, 0.2);
  background: rgba(8, 12, 18, 0.55);
}
.edc-portal .scr-breaker-card {
  backdrop-filter: blur(8px);
  box-shadow: 0 14px 32px rgba(0,0,0,0.28);
}
@media (max-width: 720px) {
  .edc-portal.is-dtc .lab-stage-photo,
  .edc-portal.is-immo .lab-stage-photo {
    background-position: 62% center;
  }
}

.admin-creds code {
  display: inline-block;
  padding: 2px 8px;
  background: rgba(0,0,0,0.35);
  border: 1px solid var(--line);
  direction: ltr;
  font-weight: 700;
}
.admin-device-block { margin-bottom: 12px; }
.admin-css-bump { }

.device-status {
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
}
.device-status.is-bound {
  border-color: rgba(52, 211, 153, 0.4);
  background: rgba(52, 211, 153, 0.1);
}
.device-status.is-free {
  border-color: rgba(245, 158, 11, 0.4);
  background: rgba(245, 158, 11, 0.1);
}
.device-status-main {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.device-status-dot {
  width: 10px;
  height: 10px;
  margin-top: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.device-status.is-bound .device-status-dot { background: #34d399; }
.device-status.is-free .device-status-dot { background: #f59e0b; }
.device-status-main strong {
  display: block;
  font-size: 1.02rem;
}
.device-status-main p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}
.device-status-time {
  margin-top: 6px !important;
  color: var(--ink) !important;
  font-variant-numeric: tabular-nums;
  font-size: 0.82rem !important;
}
.admin-mini-form button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.pass-grid {
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}
.pass-card {
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(0,0,0,0.18);
  padding: 12px;
  display: grid;
  gap: 8px;
}
.pass-row {
  display: grid;
  gap: 4px;
}
.pass-value {
  display: inline-block;
  padding: 6px 10px;
  background: rgba(52, 211, 153, 0.12);
  border: 1px solid rgba(52, 211, 153, 0.35);
  color: #a7f3d0;
  font-weight: 700;
  font-size: 0.95rem;
  word-break: break-all;
}
.pass-missing {
  color: #fbbf24;
  font-size: 0.86rem;
}
.pass-form input[type="text"] {
  flex: 1;
  min-width: 0;
  width: auto;
}
@media (max-width: 800px) {
  .pass-grid { grid-template-columns: 1fr; }
}

/* —— Shared premium polish for all lab tools —— */
@keyframes premium-pulse {
  0%, 100% { opacity: 0.7; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.06); }
}
@keyframes premium-float {
  0%, 100% { transform: translateY(8px); }
  50% { transform: translateY(-6px); }
}
@keyframes premium-rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
.edc-portal.is-maps { --lab-bg: url("/static/img/iveco-truck-login.jpg"); }
.edc-portal.is-astara { --lab-bg: url("/static/img/astara-truck.png"); }
.lab-stage-glow,
.vcm-stage-glow {
  position: absolute;
  width: min(520px, 70vw);
  height: min(520px, 70vw);
  right: -8%;
  top: 8%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(230, 126, 34, 0.16), transparent 68%);
  filter: blur(8px);
  animation: premium-pulse 7s ease-in-out infinite;
  z-index: 1;
  pointer-events: none;
}
.lab-stage-mascot,
.vcm-stage-mascot {
  position: absolute;
  left: max(2%, calc(50% - 560px));
  bottom: 3%;
  width: min(250px, 30vw);
  opacity: 0.2;
  filter: drop-shadow(0 18px 40px rgba(0, 0, 0, 0.55));
  animation: premium-float 6.5s ease-in-out infinite;
  z-index: 1;
  pointer-events: none;
}
.edc-portal .tool-welcome,
.vcm-portal .tool-welcome,
.premium-lab .tool-welcome {
  animation: premium-rise 0.55s ease both;
}
.edc-portal .edc-eyebrow,
.vcm-portal .vcm-eyebrow,
.premium-lab .premium-eyebrow {
  margin: 0 0 8px;
  color: #f59e0b;
  font-weight: 800;
  letter-spacing: 0.22em;
  font-size: 0.78rem;
  text-transform: uppercase;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.7);
}
.edc-portal .tool-panel,
.vcm-portal .tool-panel,
.premium-lab .tool-panel {
  gap: 16px;
  padding: 18px;
  border-radius: 16px;
  animation: premium-rise 0.65s ease 0.08s both;
}
.edc-portal .upload-box,
.vcm-portal .upload-box,
.premium-lab .upload-box {
  text-align: center;
  padding: 26px 18px;
  border-radius: 16px;
  border-style: dashed;
  border-width: 1.5px;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}
.edc-portal .upload-box:hover,
.edc-portal .upload-box.drag,
.edc-portal .upload-box.is-drag,
.vcm-portal .upload-box:hover,
.vcm-portal .upload-box.drag,
.vcm-portal .upload-box.is-drag,
.premium-lab .upload-box:hover,
.premium-lab .upload-box.drag,
.premium-lab .upload-box.is-drag {
  border-color: rgba(245, 158, 11, 0.65);
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.18), 0 18px 44px rgba(0, 0, 0, 0.4);
  transform: translateY(-1px);
}
.edc-portal .upload-title,
.vcm-portal .upload-title,
.premium-lab .upload-title {
  font-family: "Oswald", "Cairo", sans-serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 1.02rem;
  margin: 0 0 12px;
}
.premium-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: 0 0 14px;
}
.premium-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid rgba(245, 158, 11, 0.32);
  background: rgba(245, 158, 11, 0.08);
  color: rgba(243, 240, 234, 0.88);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.edc-portal .workspace,
.vcm-portal .workspace,
.premium-lab .workspace {
  border-radius: 16px;
  padding: 16px;
  animation: premium-rise 0.45s ease both;
}
.edc-portal .meta-row,
.vcm-portal .meta-row,
.premium-lab .meta-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  background: transparent !important;
  border: 0 !important;
  padding: 0 !important;
}
.edc-portal .meta-row > div,
.vcm-portal .meta-row > div,
.premium-lab .meta-row > div {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(243, 240, 234, 0.08);
  border-radius: 12px;
  padding: 10px 12px;
  min-width: 0;
}
.edc-portal .meta-k,
.vcm-portal .meta-k,
.premium-lab .meta-k {
  display: block;
  margin-bottom: 4px;
  color: rgba(245, 158, 11, 0.9);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.edc-portal .meta-row strong,
.vcm-portal .meta-row strong,
.premium-lab .meta-row strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: "Oswald", "Cairo", sans-serif;
  letter-spacing: 0.03em;
  font-weight: 600;
  color: #f3f0ea;
}
.edc-portal .search-bar,
.vcm-portal .search-bar,
.premium-lab .search-bar,
.edc-portal .dtc-filters,
.vcm-portal .dtc-filters {
  margin-top: 12px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(243, 240, 234, 0.1);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.015));
}
.edc-portal .dtc-table-wrap,
.vcm-portal .dtc-table-wrap,
.premium-lab .dtc-table-wrap,
.edc-portal .table-wrap,
.vcm-portal .table-wrap {
  margin-top: 12px;
  border-radius: 14px;
  border: 1px solid rgba(245, 158, 11, 0.22);
  background: rgba(7, 10, 15, 0.55);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}
.edc-portal .tool-alert,
.vcm-portal .tool-alert,
.premium-lab .tool-alert {
  border-radius: 12px;
  animation: premium-rise 0.35s ease both;
}
.premium-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 16px 0 10px;
}
.premium-section-head h2 {
  margin: 0;
  font-family: "Oswald", "Cairo", sans-serif;
  font-size: 1rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(243, 240, 234, 0.92);
}
.premium-section-head span {
  color: rgba(243, 240, 234, 0.45);
  font-size: 0.78rem;
  font-weight: 700;
}
@media (max-width: 720px) {
  .lab-stage-mascot,
  .vcm-stage-mascot {
    opacity: 0.1;
    width: min(150px, 38vw);
  }
}

/* —— Premium client dashboard —— */
.premium-dash .dash-atmosphere {
  background:
    linear-gradient(180deg, rgba(7, 10, 15, 0.34) 0%, rgba(7, 10, 15, 0.48) 42%, rgba(7, 10, 15, 0.88) 100%),
    linear-gradient(105deg, rgba(7, 10, 15, 0.58) 0%, rgba(7, 10, 15, 0.2) 52%, rgba(7, 10, 15, 0.52) 100%),
    radial-gradient(ellipse 50% 38% at 78% 10%, rgba(230, 126, 34, 0.2), transparent 60%);
}
.premium-dash .dash-bg-slides {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}
.premium-dash .dash-bg-slide {
  position: absolute;
  inset: -2%;
  background-position: center 36%;
  background-size: cover;
  background-repeat: no-repeat;
  opacity: 0;
  transform: scale(1.04);
  filter: saturate(1.05) contrast(1.04) brightness(0.92);
  transition: opacity 1.4s ease, transform 10s ease;
}
.premium-dash .dash-bg-slide.is-logo {
  background-position: center center;
  background-size: cover;
  filter: none;
  transform: scale(1.02);
}
.premium-dash .dash-bg-slide.is-active {
  opacity: 1;
  transform: scale(1.01);
}
.premium-dash .dash-bg-slide.is-logo.is-active {
  transform: scale(1);
}
.premium-dash .dash-stage-glow,
.premium-dash .dash-stage-grid {
  z-index: 1;
}
.premium-dash .dash-stage-glow {
  position: absolute;
  width: min(560px, 75vw);
  height: min(560px, 75vw);
  right: -10%;
  top: -4%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(230, 126, 34, 0.2), transparent 68%);
  filter: blur(10px);
  animation: premium-pulse 7s ease-in-out infinite;
}
.premium-dash .dash-stage-grid {
  position: absolute;
  inset: 0;
  opacity: 0.18;
  background-image:
    linear-gradient(rgba(243, 240, 234, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(243, 240, 234, 0.045) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at 50% 18%, #000 18%, transparent 72%);
}
.premium-dash .dash-topbar {
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(8, 12, 18, 0.62);
  border-bottom: 1px solid rgba(245, 158, 11, 0.16);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
}
.premium-dash .dash-wrap {
  width: min(1120px, 100%);
  padding-top: 28px;
}
.premium-dash .dash-hero {
  max-width: 40rem;
  animation: premium-rise 0.55s ease both;
}
.premium-dash .dash-eyebrow {
  margin: 0 0 10px;
  color: #f59e0b;
  font-weight: 800;
  letter-spacing: 0.22em;
  font-size: 0.78rem;
  text-transform: uppercase;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.7);
}
.premium-dash .dash-logo {
  width: min(196px, 48vw);
  margin: 0 0 10px;
  filter: drop-shadow(0 14px 32px rgba(0, 0, 0, 0.55));
}
.premium-dash .dash-brand {
  margin: 0;
  font-family: "Oswald", "Cairo", sans-serif;
  font-size: clamp(2.6rem, 7vw, 4.2rem);
  letter-spacing: 0.06em;
  line-height: 0.92;
  text-transform: uppercase;
  color: #f3f0ea;
  text-shadow: 0 2px 22px rgba(0, 0, 0, 0.55);
}
.premium-dash .dash-welcome {
  margin: 14px 0 0;
  max-width: 28rem;
  color: rgba(232, 237, 244, 0.82);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.55;
}
.premium-dash .dash-status {
  margin-top: 20px;
  border-radius: 14px;
  border-color: rgba(245, 158, 11, 0.22);
  background: rgba(10, 14, 20, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.28);
}
.premium-dash .dash-tools {
  animation: premium-rise 0.65s ease 0.1s both;
}
.premium-dash .dash-tools-head h2 {
  font-family: "Oswald", "Cairo", sans-serif;
  letter-spacing: 0.14em;
  font-size: 1.08rem;
  color: rgba(245, 158, 11, 0.95);
}
.premium-dash .dash-tools-head p {
  color: rgba(243, 240, 234, 0.55);
}
.premium-dash .dash-tool-grid {
  gap: 18px;
}
.premium-dash .dash-tool {
  border-radius: 16px;
  border-color: rgba(245, 158, 11, 0.22);
  background:
    linear-gradient(165deg, rgba(245, 158, 11, 0.1), transparent 46%),
    rgba(10, 14, 20, 0.78);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.34);
  transition: border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}
.premium-dash .dash-tool:hover {
  border-color: rgba(245, 158, 11, 0.55);
  transform: translateY(-4px);
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.42), 0 0 0 4px rgba(245, 158, 11, 0.12);
  background:
    linear-gradient(165deg, rgba(245, 158, 11, 0.16), transparent 50%),
    rgba(12, 18, 26, 0.9);
}
.premium-dash .dash-tool.is-locked:hover {
  transform: none;
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.34);
  border-color: rgba(245, 158, 11, 0.22);
}
.premium-dash .dash-tool-visual {
  background:
    radial-gradient(ellipse at 45% 55%, rgba(245, 158, 11, 0.26), transparent 58%),
    linear-gradient(160deg, rgba(28, 36, 48, 0.45), rgba(8, 12, 18, 0.92));
}
.premium-dash .dash-tool-badge {
  border-radius: 999px;
  letter-spacing: 0.12em;
  box-shadow: 0 6px 16px rgba(217, 119, 6, 0.28);
}
.premium-dash .dash-tool-lock {
  border-radius: 999px;
  letter-spacing: 0.14em;
}
.premium-dash .dash-tool-lock.is-admin {
  background: #e67e22;
  color: #111;
  border-color: rgba(230, 126, 34, 0.55);
}
.premium-dash .dash-tool h3 {
  font-family: "Oswald", "Cairo", sans-serif;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-size: 1.42rem;
  color: #f3f0ea;
}
.premium-dash .dash-tool-sub {
  color: rgba(245, 158, 11, 0.92);
}
.premium-dash .dash-tool-desc {
  color: rgba(243, 240, 234, 0.58);
}
.premium-dash .dash-tool-btn {
  border-radius: 12px;
  min-width: 10rem;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.28);
}
.premium-dash .dash-tool-btn:not(.disabled):hover {
  filter: brightness(1.06);
}
@media (max-width: 700px) {
  .premium-dash .dash-brand {
    font-size: clamp(2.2rem, 11vw, 3rem);
  }
  .premium-dash .dash-welcome {
    font-size: 0.98rem;
  }
}
