:root {
  --bg-main: #05070d;
  --bg-radial-blue: rgba(0, 91, 234, 0.18);
  --bg-radial-orange: rgba(244, 123, 38, 0.14);

  --panel: rgba(18, 24, 38, 0.76);
  --panel-strong: rgba(22, 29, 47, 0.94);
  --panel-soft: rgba(255, 255, 255, 0.055);

  --border-soft: rgba(255, 255, 255, 0.1);
  --border-hot: rgba(244, 123, 38, 0.46);
  --border-blue: rgba(0, 91, 234, 0.52);

  --text-main: #f6f8ff;
  --text-muted: rgba(246, 248, 255, 0.68);
  --text-dim: rgba(246, 248, 255, 0.42);

  --mems-blue: #005bea;
  --mems-orange: #f47b26;

  --green: #5cff9d;
  --yellow: #ffd45a;
  --red: #ff4f5e;
  --cyan: #58efff;
  --purple: #b45cff;

  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;

  --shadow-panel: 0 24px 70px rgba(0, 0, 0, 0.48);
  --shadow-glow-blue: 0 0 35px rgba(0, 91, 234, 0.28);
  --shadow-glow-orange: 0 0 35px rgba(244, 123, 38, 0.22);

  --tab-height: 92px;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  background: var(--bg-main);
  color: var(--text-main);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  overflow: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 20% 12%, rgba(0, 91, 234, 0.26), transparent 34%),
    radial-gradient(circle at 85% 18%, rgba(244, 123, 38, 0.18), transparent 32%),
    radial-gradient(circle at 50% 90%, rgba(88, 239, 255, 0.1), transparent 42%),
    linear-gradient(135deg, #05070d 0%, #080d17 44%, #05070d 100%);
  z-index: -3;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: radial-gradient(circle at center, black, transparent 78%);
  opacity: 0.26;
  z-index: -2;
}

button,
input {
  font: inherit;
}

.mems-board-shell {
  width: 100vw;
  height: 100vh;
  padding: 22px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) var(--tab-height);
  gap: 18px;
}

.board-header {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}

.brand-mark {
  width: 58px;
  height: 58px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  font-weight: 950;
  font-size: 1.35rem;
  color: white;
  background:
    linear-gradient(135deg, var(--mems-blue), var(--mems-orange));
  box-shadow:
    var(--shadow-glow-blue),
    var(--shadow-glow-orange);
}

.board-kicker {
  color: var(--mems-orange);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.78rem;
  font-weight: 900;
}

.board-header h1 {
  margin: 4px 0 0;
  font-size: clamp(2rem, 4vw, 4.7rem);
  line-height: 0.95;
  letter-spacing: -0.055em;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.system-pill {
  height: 44px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.065);
  border: 1px solid var(--border-soft);
  color: var(--text-muted);
  font-weight: 800;
  white-space: nowrap;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  display: inline-block;
  background: var(--text-dim);
  box-shadow: 0 0 18px currentColor;
}

.status-dot.good {
  background: var(--green);
  color: var(--green);
}

.status-dot.warn {
  background: var(--yellow);
  color: var(--yellow);
}

.status-dot.bad {
  background: var(--red);
  color: var(--red);
}

.board-clock {
  min-width: 172px;
  text-align: right;
}

#clockTime {
  font-size: clamp(2rem, 4vw, 4rem);
  line-height: 0.95;
  font-weight: 950;
  letter-spacing: -0.06em;
}

#clockDate {
  margin-top: 8px;
  color: var(--text-muted);
  font-weight: 700;
}

.board-main {
  min-height: 0;
  overflow: hidden;
}

.app-screen {
  height: 100%;
  min-height: 0;
}

.dashboard-grid {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-rows: minmax(120px, auto);
  gap: 16px;
}

.card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-xl);
  background:
    linear-gradient(145deg, rgba(255,255,255,0.075), rgba(255,255,255,0.025)),
    var(--panel);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-panel);
  padding: 22px;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 18% 0%, rgba(0, 91, 234, 0.18), transparent 32%),
    radial-gradient(circle at 100% 100%, rgba(244, 123, 38, 0.12), transparent 38%);
  opacity: 0.8;
}

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

.card-title {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.11em;
}

.card-big-number {
  margin-top: 14px;
  font-size: clamp(2.3rem, 4.1vw, 5.4rem);
  line-height: 0.92;
  font-weight: 950;
  letter-spacing: -0.065em;
}

.card-subtext {
  margin-top: 10px;
  color: var(--text-muted);
  font-size: 0.98rem;
  line-height: 1.4;
}

.hero-card {
  grid-column: span 6;
  grid-row: span 2;
  min-height: 360px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.hero-card::after {
  content: "";
  position: absolute;
  width: 440px;
  height: 440px;
  right: -170px;
  top: -150px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.08);
  background:
    radial-gradient(circle, rgba(0,91,234,0.28), transparent 62%);
  box-shadow: 0 0 90px rgba(0, 91, 234, 0.22);
}

.hero-status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(92, 255, 157, 0.09);
  border: 1px solid rgba(92, 255, 157, 0.25);
  color: var(--green);
  font-weight: 900;
}

.hero-message {
  max-width: 760px;
}

.hero-message h2 {
  margin: 0;
  font-size: clamp(3rem, 6vw, 7.3rem);
  line-height: 0.92;
  letter-spacing: -0.075em;
}

.hero-message p {
  max-width: 620px;
  margin: 18px 0 0;
  color: var(--text-muted);
  font-size: clamp(1.05rem, 1.35vw, 1.5rem);
  line-height: 1.4;
}

.mini-card {
  grid-column: span 3;
}

.wide-card {
  grid-column: span 6;
}

.full-card {
  grid-column: span 12;
}

.card-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.list-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 16px;
  background: rgba(255,255,255,0.045);
  border: 1px solid rgba(255,255,255,0.07);
}

.row-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(0, 91, 234, 0.22);
  color: var(--cyan);
}

.row-title {
  font-weight: 900;
}

.row-detail {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-top: 2px;
}

.row-tag {
  color: var(--text-main);
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.08);
  padding: 7px 10px;
  border-radius: 999px;
  font-weight: 900;
  font-size: 0.8rem;
}

.metric-line {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding-top: 16px;
  margin-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.metric-line span:first-child {
  color: var(--text-muted);
}

.metric-line span:last-child {
  font-weight: 950;
}

.placeholder-panel {
  height: 100%;
  min-height: 0;
  display: grid;
  place-items: center;
  text-align: center;
  border-radius: var(--radius-xl);
  background:
    linear-gradient(145deg, rgba(255,255,255,0.075), rgba(255,255,255,0.025)),
    rgba(18, 24, 38, 0.72);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-panel);
  padding: 40px;
}

.placeholder-panel h2 {
  margin: 0;
  font-size: clamp(2.6rem, 6vw, 7rem);
  line-height: 0.95;
  letter-spacing: -0.07em;
}

.placeholder-panel p {
  max-width: 760px;
  margin: 18px auto 0;
  color: var(--text-muted);
  font-size: clamp(1rem, 1.4vw, 1.45rem);
  line-height: 1.45;
}

.board-tabs {
  height: var(--tab-height);
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  padding: 10px;
  border-radius: 28px;
  background: rgba(10, 14, 24, 0.76);
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow:
    0 18px 55px rgba(0,0,0,0.45),
    inset 0 1px 0 rgba(255,255,255,0.06);
  backdrop-filter: blur(20px);
}

.tab-btn {
  position: relative;
  overflow: hidden;
  border: 0;
  border-radius: 20px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.045);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-weight: 950;
  letter-spacing: -0.02em;
  touch-action: manipulation;
  transition:
    transform 180ms ease,
    background 180ms ease,
    color 180ms ease,
    box-shadow 180ms ease;
}

.tab-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  background:
    linear-gradient(135deg, rgba(0, 91, 234, 0.95), rgba(244, 123, 38, 0.95));
  transition: opacity 180ms ease;
}

.tab-btn span {
  position: relative;
  z-index: 1;
}

.tab-btn:hover {
  color: var(--text-main);
  transform: translateY(-1px);
}

.tab-btn.active {
  color: white;
  box-shadow:
    0 0 34px rgba(0, 91, 234, 0.24),
    0 0 34px rgba(244, 123, 38, 0.18);
}

.tab-btn.active::before {
  opacity: 1;
}

.tab-icon {
  font-size: 1rem;
  opacity: 0.9;
}

@media (max-width: 1100px) {
  :root {
    --tab-height: 156px;
  }

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

  .hero-card,
  .wide-card,
  .full-card {
    grid-column: span 6;
  }

  .mini-card {
    grid-column: span 3;
  }

  .board-tabs {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 760px) {
  .mems-board-shell {
    padding: 12px;
    gap: 12px;
  }

  .board-header {
    align-items: flex-start;
  }

  .brand-mark {
    width: 48px;
    height: 48px;
    border-radius: 16px;
  }

  .system-pill {
    display: none;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
    overflow-y: auto;
    padding-bottom: 4px;
  }

  .hero-card,
  .mini-card,
  .wide-card,
  .full-card {
    grid-column: span 1;
  }

  .hero-card {
    min-height: 320px;
  }

  .board-tabs {
    grid-template-columns: repeat(2, 1fr);
  }
}
