/* SEM-GOV-001D-UI2-VR1 — Dark operational Sports Match Hub dashboard */

:root {
  --smh-bg: #070b12;
  --smh-bg-elevated: #0d1320;
  --smh-panel: #111827;
  --smh-panel-soft: #151f30;
  --smh-panel-hover: #1a2740;
  --smh-border: #2a3a52;
  --smh-border-bright: #3b82f6;
  --smh-text: #f1f5f9;
  --smh-muted: #94a3b8;
  --smh-accent-blue: #3b82f6;
  --smh-accent-teal: #14b8a6;
  --smh-accent-yellow: #eab308;
  --smh-accent-orange: #f97316;
  --smh-accent-purple: #a855f7;
  --smh-accent-green: #22c55e;
  --smh-accent-red: #ef4444;
  --smh-accent-grey: #64748b;
  --smh-radius: 8px;
  --smh-radius-lg: 12px;
  --smh-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
  --smh-glow: 0 0 0 1px rgba(59, 130, 246, 0.25);
  --smh-touch: 44px;
  --smh-dashboard-max: 1560px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body.smh-page {
  margin: 0;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--smh-bg);
  color: var(--smh-text);
  line-height: 1.45;
  min-height: 100vh;
}

.smh-skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 1000;
  padding: 0.75rem 1rem;
  background: var(--smh-accent-blue);
  color: #fff;
}

.smh-skip:focus {
  left: 0.5rem;
  top: 0.5rem;
}

.smh-header {
  background: var(--smh-bg-elevated);
  border-bottom: 1px solid var(--smh-border);
}

.smh-header__inner {
  max-width: var(--smh-dashboard-max);
  margin: 0 auto;
  padding: 0.6rem 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.smh-logo {
  color: var(--smh-text);
  font-weight: 700;
  text-decoration: none;
  font-size: 0.95rem;
}

.smh-nav-toggle,
.smh-filter-toggle {
  display: none;
  min-width: var(--smh-touch);
  min-height: var(--smh-touch);
  border: 1px solid var(--smh-border);
  background: var(--smh-panel);
  color: var(--smh-text);
  border-radius: var(--smh-radius);
  cursor: pointer;
  font-size: 0.9rem;
}

.site-nav {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
  margin-left: auto;
}

.site-nav a {
  color: var(--smh-muted);
  text-decoration: none;
  min-height: var(--smh-touch);
  display: inline-flex;
  align-items: center;
  padding: 0 0.25rem;
  font-size: 0.9rem;
}

.site-nav a:hover {
  color: var(--smh-text);
}

.site-nav a[aria-current='page'] {
  color: var(--smh-accent-blue);
  font-weight: 600;
}

.smh-main {
  padding: 0.75rem 1rem 1.5rem;
}

.smh-dashboard-layout {
  max-width: calc(var(--smh-dashboard-max) + 280px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 1rem;
  align-items: start;
}

.smh-dashboard {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.smh-hub-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 0.85rem 1rem;
  background: var(--smh-panel);
  border: 1px solid var(--smh-border);
  border-radius: var(--smh-radius-lg);
}

.smh-hub-header__brand h1 {
  margin: 0;
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--smh-text);
}

.smh-hub-header__subtitle {
  margin: 0.2rem 0 0;
  color: var(--smh-muted);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.smh-hub-header__brand-icon {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--smh-accent-green);
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.6);
}

.smh-hub-header__actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.smh-system-status {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.75rem;
  background: var(--smh-panel-soft);
  border: 1px solid var(--smh-border);
  border-radius: var(--smh-radius);
  font-size: 0.8rem;
}

.smh-system-status__label {
  color: var(--smh-muted);
  letter-spacing: 0.04em;
}

.smh-system-status__value {
  color: var(--smh-accent-green);
  font-weight: 600;
}

.smh-system-status__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--smh-accent-green);
  animation: smh-pulse 2s ease-in-out infinite;
}

@keyframes smh-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.smh-control-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem;
}

.smh-control-group {
  position: relative;
  background: var(--smh-panel);
  border: 1px solid var(--smh-border);
  border-radius: var(--smh-radius);
  padding: 0.55rem 0.65rem 0.65rem;
  min-width: 0;
}

.smh-control-group--days {
  grid-column: span 1;
}

.smh-control-group__number {
  position: absolute;
  top: 0.35rem;
  right: 0.45rem;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--smh-accent-green);
  color: #04120a;
  font-size: 0.65rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.smh-control-group__label {
  display: block;
  font-size: 0.72rem;
  color: var(--smh-muted);
  margin-bottom: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.smh-control-select,
.smh-control-input {
  width: 100%;
  min-height: 36px;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--smh-border);
  border-radius: 6px;
  background: var(--smh-panel-soft);
  color: var(--smh-text);
  font-size: 0.88rem;
}

.smh-control-select:disabled {
  opacity: 0.85;
  cursor: not-allowed;
}

.smh-controls-secondary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.filter-sheet {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
  width: 100%;
  padding: 0.75rem;
  background: var(--smh-panel);
  border: 1px solid var(--smh-border);
  border-radius: var(--smh-radius);
}

.filter-sheet[hidden] {
  display: none !important;
}

.filter-sheet label {
  font-size: 0.8rem;
  color: var(--smh-muted);
  display: block;
  margin-bottom: 0.25rem;
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.filter-chip {
  background: rgba(59, 130, 246, 0.15);
  color: var(--smh-accent-blue);
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  border: 1px solid rgba(59, 130, 246, 0.35);
}

.day-tabs {
  display: flex;
  gap: 0.35rem;
  overflow-x: auto;
  padding-bottom: 0.15rem;
  scrollbar-width: thin;
}

.day-tab {
  flex: 0 0 auto;
  min-width: 4.5rem;
  min-height: var(--smh-touch);
  border: 1px solid var(--smh-border);
  background: var(--smh-panel-soft);
  border-radius: 6px;
  padding: 0.3rem 0.45rem;
  cursor: pointer;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.05rem;
  color: var(--smh-muted);
}

.day-tab:hover {
  border-color: var(--smh-border-bright);
  color: var(--smh-text);
}

.day-tab--active {
  border-color: var(--smh-accent-blue);
  background: rgba(59, 130, 246, 0.2);
  color: var(--smh-text);
  box-shadow: var(--smh-glow);
}

.day-tab__label {
  font-weight: 600;
  font-size: 0.78rem;
}

.day-tab__date {
  font-size: 0.68rem;
  color: var(--smh-muted);
}

.day-tab--active .day-tab__date {
  color: var(--smh-accent-blue);
}

.smh-funnel-panel,
.smh-fixtures-panel,
.smh-edgemind-panel,
.smh-legend-panel {
  background: var(--smh-panel);
  border: 1px solid var(--smh-border);
  border-radius: var(--smh-radius-lg);
  padding: 0.75rem;
}

.smh-panel-heading {
  margin: 0 0 0.65rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--smh-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.smh-funnel {
  display: flex;
  gap: 0.35rem;
  overflow-x: auto;
  padding-bottom: 0.35rem;
}

.funnel-stage {
  flex: 1 0 120px;
  min-width: 110px;
  background: var(--smh-panel-soft);
  border: 1px solid var(--smh-border);
  border-radius: var(--smh-radius);
  padding: 0.55rem;
  position: relative;
}

.funnel-stage:not(:last-child)::after {
  content: '→';
  position: absolute;
  right: -0.55rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--smh-muted);
  font-size: 0.75rem;
  z-index: 1;
}

.funnel-stage__seq {
  font-size: 0.65rem;
  color: var(--smh-muted);
}

.funnel-stage__icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  margin: 0.25rem 0;
}

.funnel-stage--admitted .funnel-stage__icon { background: rgba(59, 130, 246, 0.2); color: var(--smh-accent-blue); }
.funnel-stage--evidence .funnel-stage__icon { background: rgba(20, 184, 166, 0.2); color: var(--smh-accent-teal); }
.funnel-stage--context .funnel-stage__icon { background: rgba(234, 179, 8, 0.2); color: var(--smh-accent-yellow); }
.funnel-stage--stability .funnel-stage__icon { background: rgba(249, 115, 22, 0.2); color: var(--smh-accent-orange); }
.funnel-stage--publication .funnel-stage__icon { background: rgba(168, 85, 247, 0.2); color: var(--smh-accent-purple); }
.funnel-stage--final .funnel-stage__icon { background: rgba(34, 197, 94, 0.2); color: var(--smh-accent-green); }

.funnel-stage__label {
  font-size: 0.72rem;
  font-weight: 600;
  margin: 0;
  line-height: 1.2;
}

.funnel-stage__count {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0.15rem 0 0;
}

.funnel-stage__percent {
  font-size: 0.7rem;
  color: var(--smh-muted);
  margin: 0;
}

.smh-movement {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.45rem;
  margin-top: 0.65rem;
}

.movement-card {
  background: var(--smh-panel-soft);
  border: 1px solid var(--smh-border);
  border-radius: var(--smh-radius);
  padding: 0.45rem 0.5rem;
  min-height: 56px;
}

.movement-card__label {
  font-size: 0.65rem;
  color: var(--smh-muted);
  margin: 0 0 0.2rem;
  line-height: 1.2;
}

.movement-card__value {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0;
}

.smh-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 26%);
  gap: 0.75rem;
  align-items: start;
}

.smh-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--smh-muted);
  margin-bottom: 0.5rem;
}

.fixture-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.fixture-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.fixture-table th {
  text-align: left;
  padding: 0.5rem 0.45rem;
  color: var(--smh-muted);
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 1px solid var(--smh-border);
}

.fixture-table td {
  padding: 0.55rem 0.45rem;
  border-bottom: 1px solid var(--smh-border);
  vertical-align: middle;
}

.fixture-table tbody tr:hover {
  background: var(--smh-panel-hover);
}

.fixture-teams {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.team-badge {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--smh-panel-hover);
  border: 1px solid var(--smh-border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--smh-muted);
  flex-shrink: 0;
}

.fixture-teams__names {
  font-weight: 600;
}

.fixture-teams__vs {
  color: var(--smh-muted);
  font-weight: 400;
  font-size: 0.78rem;
}

.fixture-competition {
  color: var(--smh-muted);
  font-size: 0.78rem;
}

.fixture-competition__country {
  display: block;
  font-size: 0.68rem;
  opacity: 0.85;
}

.stage-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  white-space: nowrap;
}

.stage-badge--admitted { background: rgba(59, 130, 246, 0.15); color: var(--smh-accent-blue); }
.stage-badge--evidence { background: rgba(20, 184, 166, 0.15); color: var(--smh-accent-teal); }
.stage-badge--context { background: rgba(234, 179, 8, 0.15); color: var(--smh-accent-yellow); }
.stage-badge--stability { background: rgba(249, 115, 22, 0.15); color: var(--smh-accent-orange); }
.stage-badge--publication { background: rgba(168, 85, 247, 0.15); color: var(--smh-accent-purple); }
.stage-badge--final { background: rgba(34, 197, 94, 0.15); color: var(--smh-accent-green); }

.lifecycle-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  border: 1px solid currentColor;
  white-space: nowrap;
}

.lifecycle-badge--visible { color: var(--smh-accent-blue); }
.lifecycle-badge--under-review { color: var(--smh-accent-teal); }
.lifecycle-badge--held { color: var(--smh-accent-orange); }
.lifecycle-badge--eliminated { color: var(--smh-accent-red); }
.lifecycle-badge--final-approved { color: var(--smh-accent-green); }
.lifecycle-badge--cancelled,
.lifecycle-badge--archived { color: var(--smh-accent-grey); }
.lifecycle-badge--postponed { color: var(--smh-accent-grey); }

.fixture-summary {
  color: var(--smh-muted);
  font-size: 0.78rem;
  max-width: 280px;
}

.btn {
  min-height: var(--smh-touch);
  padding: 0.45rem 0.85rem;
  border-radius: var(--smh-radius);
  border: none;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 600;
}

.btn--primary {
  background: var(--smh-accent-blue);
  color: #fff;
}

.btn--primary:hover {
  background: #2563eb;
}

.btn--outline {
  background: transparent;
  border: 1px solid var(--smh-border);
  color: var(--smh-text);
}

.btn--ghost {
  background: transparent;
  border: 1px solid var(--smh-border);
  color: var(--smh-muted);
  min-height: 36px;
  padding: 0.35rem 0.65rem;
  font-size: 0.8rem;
}

.fixture-table .btn--ghost {
  min-height: 36px;
  padding: 0.3rem 0.55rem;
}

.smh-edgemind-panel {
  position: sticky;
  top: 0.75rem;
}

.smh-edgemind-mock-note {
  font-size: 0.72rem;
  color: var(--smh-muted);
  margin: 0 0 0.65rem;
  padding: 0.4rem 0.5rem;
  background: rgba(59, 130, 246, 0.08);
  border: 1px dashed var(--smh-border);
  border-radius: 6px;
}

.smh-edgemind-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.smh-edgemind-list li {
  display: flex;
  gap: 0.45rem;
  margin-bottom: 0.55rem;
  font-size: 0.82rem;
  color: var(--smh-muted);
}

.smh-edgemind-list__icon {
  flex-shrink: 0;
  width: 20px;
  text-align: center;
}

.smh-edgemind-ask {
  margin-top: 0.75rem;
  display: flex;
  gap: 0.35rem;
}

.smh-edgemind-ask input {
  flex: 1;
  min-height: var(--smh-touch);
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--smh-border);
  border-radius: var(--smh-radius);
  background: var(--smh-panel-soft);
  color: var(--smh-muted);
}

.smh-edgemind-ask button {
  min-width: var(--smh-touch);
  min-height: var(--smh-touch);
  border: none;
  border-radius: var(--smh-radius);
  background: var(--smh-accent-blue);
  color: #fff;
  cursor: not-allowed;
  opacity: 0.7;
}

.smh-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.smh-legend__title {
  font-size: 0.78rem;
  color: var(--smh-muted);
  margin-right: 0.25rem;
}

.smh-guide-rail {
  background: var(--smh-panel);
  border: 1px solid var(--smh-border);
  border-radius: var(--smh-radius-lg);
  padding: 0.75rem;
  font-size: 0.78rem;
  position: sticky;
  top: 0.75rem;
}

.smh-guide-list {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--smh-muted);
}

.smh-guide-list li {
  margin-bottom: 0.45rem;
}

.smh-key-principles {
  margin-top: 0.75rem;
  padding: 0.55rem;
  background: var(--smh-panel-soft);
  border: 1px solid var(--smh-border);
  border-radius: var(--smh-radius);
}

.smh-key-principles h3 {
  margin: 0 0 0.35rem;
  font-size: 0.78rem;
  color: var(--smh-text);
}

.smh-key-principles ul {
  margin: 0;
  padding-left: 1rem;
  color: var(--smh-muted);
}

.ui-state-block {
  background: var(--smh-panel-soft);
  border: 1px solid var(--smh-border);
  border-radius: var(--smh-radius);
  padding: 2rem 1rem;
  text-align: center;
}

.ui-state-block__heading {
  margin: 0 0 0.5rem;
  color: var(--smh-text);
}

.stale-banner {
  background: rgba(234, 179, 8, 0.12);
  color: var(--smh-accent-yellow);
  padding: 0.65rem 0.85rem;
  border-radius: var(--smh-radius);
  margin-bottom: 0.65rem;
  border: 1px solid rgba(234, 179, 8, 0.35);
  font-size: 0.85rem;
}

.fixture-detail {
  background: var(--smh-panel-soft);
  border: 1px solid var(--smh-border);
  border-radius: var(--smh-radius-lg);
  padding: 1rem;
}

.fixture-detail__title {
  margin: 0.5rem 0;
  color: var(--smh-text);
}

.stage-stepper {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.stage-stepper__item {
  font-size: 0.72rem;
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  background: var(--smh-panel);
  color: var(--smh-muted);
  border: 1px solid var(--smh-border);
}

.stage-stepper__item--active {
  background: rgba(59, 130, 246, 0.2);
  color: var(--smh-accent-blue);
  border-color: var(--smh-accent-blue);
}

.stage-stepper__item--done {
  background: rgba(34, 197, 94, 0.12);
  color: var(--smh-accent-green);
}

.fixture-detail__timeline {
  margin: 1rem 0 0;
  padding-left: 1.25rem;
  color: var(--smh-muted);
  font-size: 0.85rem;
}

.smh-footer {
  max-width: var(--smh-dashboard-max);
  margin: 1.5rem auto 0.5rem;
  padding: 0 1rem;
  font-size: 0.8rem;
  color: var(--smh-muted);
}

.smh-footer a {
  color: var(--smh-accent-blue);
}

.smh-demo-panel {
  min-width: 180px;
}

.smh-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

:focus-visible {
  outline: 2px solid var(--smh-accent-blue);
  outline-offset: 2px;
}

@media (max-width: 1199px) {
  .smh-dashboard-layout {
    grid-template-columns: 1fr;
  }

  .smh-guide-rail {
    display: none;
  }

  .smh-control-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .smh-control-group--days {
    grid-column: span 2;
  }

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

@media (max-width: 959px) {
  .smh-main-grid {
    grid-template-columns: 1fr;
  }

  .smh-edgemind-panel {
    position: static;
  }

  .smh-filter-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

@media (max-width: 767px) {
  .smh-nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .site-nav {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    margin-left: 0;
  }

  .site-nav.site-nav--open {
    display: flex;
  }

  .smh-control-strip {
    grid-template-columns: 1fr;
  }

  .smh-control-group--days {
    grid-column: span 1;
  }

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

  .fixture-table thead {
    display: none;
  }

  .fixture-table,
  .fixture-table tbody,
  .fixture-table tr,
  .fixture-table td {
    display: block;
    width: 100%;
  }

  .fixture-table tr {
    background: var(--smh-panel-soft);
    border: 1px solid var(--smh-border);
    border-radius: var(--smh-radius);
    margin-bottom: 0.65rem;
    padding: 0.65rem;
  }

  .fixture-table td {
    border: none;
    padding: 0.25rem 0;
  }

  .fixture-table td::before {
    content: attr(data-label);
    display: block;
    font-size: 0.68rem;
    color: var(--smh-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 0.15rem;
  }

  .fixture-table td.fixture-table__action-cell::before {
    display: none;
  }

  .fixture-summary {
    max-width: none;
  }

  .day-tabs {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--smh-panel);
    padding: 0.25rem 0;
  }
}

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

  .smh-system-status__dot {
    animation: none;
  }
}
