/*
  Hive owner console
  A page-specific dark operational treatment. This file loads after the
  shared site theme so the dashboard remains stable as public styles evolve.
*/

html[data-theme="dark"] {
  color-scheme: dark;
  --hvt-bg: #070a0f;
  --hvt-surface: #0d121a;
  --hvt-surface-2: #121925;
  --hvt-text: #eef3f8;
  --hvt-muted: #91a0b2;
  --hvt-line: rgba(145, 160, 178, 0.18);
  --hvt-accent: #2f80ff;
  --hvt-accent-quiet: #69a7ff;
  --hvt-live: #34d399;
  --hvt-warn: #f4b431;
  --hvt-scrim: rgba(1, 4, 8, 0.62);
  --hvt-scrim-strong: rgba(1, 4, 8, 0.82);
}

html,
body {
  background:
    radial-gradient(900px 420px at 82% -12%, rgba(47, 128, 255, 0.14), transparent 68%),
    linear-gradient(180deg, #080c12 0%, #05070b 100%) !important;
  color: #eef3f8 !important;
}

body {
  min-width: 320px;
  letter-spacing: 0;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.28;
  background-image:
    linear-gradient(rgba(105, 167, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(105, 167, 255, 0.035) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, #000, transparent 72%);
}

header.bar {
  top: 0;
  min-height: 64px;
  padding: 10px clamp(16px, 2.4vw, 36px);
  background: rgba(7, 10, 15, 0.9) !important;
  border-bottom: 1px solid rgba(105, 167, 255, 0.22) !important;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.28);
}

.brand {
  color: #eef3f8 !important;
  letter-spacing: 0.13em;
}

.brand .dot {
  background: #34d399 !important;
  box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.08), 0 0 18px rgba(52, 211, 153, 0.42) !important;
}

.bar .meta,
.bar .controls {
  color: #91a0b2;
}

.bar label.tog,
.bar a.back {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border: 1px solid rgba(145, 160, 178, 0.2);
  border-radius: 8px;
  background: rgba(18, 25, 37, 0.8);
  color: #c8d2de;
  text-decoration: none;
}

#intel,
.pub,
#ops,
.opnote {
  width: min(1520px, calc(100% - 32px));
  margin-inline: auto;
}

#intel {
  margin-top: 24px;
  margin-bottom: 16px;
  padding: clamp(20px, 2.4vw, 34px) !important;
  background:
    linear-gradient(135deg, rgba(47, 128, 255, 0.08), transparent 38%),
    #0b1018 !important;
  border: 1px solid rgba(105, 167, 255, 0.2) !important;
  border-radius: 18px;
  box-shadow: 0 22px 80px rgba(0, 0, 0, 0.28);
  overflow: hidden;
}

#intel .iv-head {
  gap: 20px;
  margin-bottom: 18px;
  align-items: flex-start;
}

#intel .iv-title {
  color: #f5f8fb !important;
  font-size: clamp(20px, 2vw, 30px) !important;
  letter-spacing: -0.02em !important;
  text-transform: none !important;
}

#intel .iv-title .q {
  display: block;
  margin-top: 8px;
  color: #91a0b2 !important;
  font-family: var(--font);
  font-size: 14px !important;
  font-weight: 400;
  letter-spacing: 0 !important;
  text-transform: none;
}

#intel .iv-ctrls {
  gap: 8px;
}

#intel button,
#intel input,
#intel select,
#iv_drawer button {
  min-height: 44px;
  border-radius: 8px !important;
  border-color: rgba(145, 160, 178, 0.24) !important;
  background: #111925 !important;
  color: #eef3f8 !important;
}

#intel button {
  padding: 9px 14px !important;
  cursor: pointer;
}

#intel button.pri {
  background: #2f80ff !important;
  border-color: #2f80ff !important;
  color: #fff !important;
  box-shadow: 0 8px 24px rgba(47, 128, 255, 0.22);
}

#intel button:hover,
#intel button:focus-visible,
#iv_drawer button:hover,
#iv_drawer button:focus-visible {
  border-color: #69a7ff !important;
  outline: none;
}

#intel .iv-src {
  min-height: 48px;
  padding: 10px 14px !important;
  border: 1px solid rgba(145, 160, 178, 0.16) !important;
  border-radius: 10px !important;
  background: rgba(5, 8, 13, 0.62) !important;
}

#intel .iv-src .sd {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
}

#intel .iv-banner {
  border-radius: 10px !important;
  background: rgba(18, 25, 37, 0.88) !important;
}

#intel .iv-brief {
  gap: 1px !important;
  overflow: hidden;
  border: 1px solid rgba(145, 160, 178, 0.16);
  border-radius: 12px;
  background: rgba(145, 160, 178, 0.16);
}

#intel .iv-bcol {
  background: #0d131d !important;
  border: 0 !important;
  border-radius: 0 !important;
}

#intel .iv-bcol h3,
#intel .iv-card h3 {
  color: #a9caff !important;
}

#intel .iv-kpi,
#intel .iv-card {
  background: #0d131d !important;
  border-color: rgba(145, 160, 178, 0.16) !important;
  box-shadow: none !important;
}

#intel .iv-kpi {
  min-height: 136px;
}

#intel .iv-kpi .kn {
  color: #f5f8fb !important;
}

#intel .iv-filters {
  padding: 14px !important;
  border: 1px solid rgba(145, 160, 178, 0.16);
  border-radius: 12px;
  background: rgba(5, 8, 13, 0.58);
}

#intel .iv-card {
  border-radius: 12px !important;
}

#intel .iv-sess {
  min-height: 48px;
  padding-inline: 6px;
  border-radius: 6px;
}

#intel .iv-sess:hover {
  background: rgba(47, 128, 255, 0.09) !important;
}

.pub {
  margin-bottom: 16px;
  padding: clamp(20px, 2.2vw, 30px) !important;
  border: 1px solid rgba(145, 160, 178, 0.16) !important;
  border-radius: 16px;
  background: rgba(11, 16, 24, 0.9);
}

.pub .pub-title {
  color: #a9caff !important;
  font-weight: 700;
}

.pub .pill,
.status .pill,
.chk {
  min-height: 36px;
  background: #111925 !important;
}

.pcards {
  gap: 1px !important;
  overflow: hidden;
  border: 1px solid rgba(145, 160, 178, 0.16);
  border-radius: 12px;
  background: rgba(145, 160, 178, 0.16);
}

.pcard {
  min-height: 132px;
  padding: 18px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: #0d131d !important;
}

.pcard .pn {
  color: #f5f8fb !important;
}

.pcard .pn.green {
  color: #34d399 !important;
}

.pcard .pn.blue {
  color: #69a7ff !important;
}

.opnote {
  margin-block: 16px !important;
  max-width: none !important;
  background: rgba(47, 128, 255, 0.07) !important;
}

#ops {
  margin-bottom: 32px;
  overflow: hidden;
  border: 1px solid rgba(145, 160, 178, 0.16);
  border-radius: 16px;
  background: #0b1018;
}

.status {
  padding: 14px 18px !important;
  background: #0d131d;
}

.stats {
  border-bottom-color: rgba(145, 160, 178, 0.16) !important;
  background: rgba(145, 160, 178, 0.16) !important;
}

.stat {
  min-height: 126px;
  padding: 18px !important;
  background: #090e15 !important;
}

.sf.big .flap {
  width: 36px !important;
  height: 54px !important;
  font-size: 38px !important;
  background: #111925 !important;
  box-shadow: inset 0 0 0 1px rgba(145, 160, 178, 0.18), 0 8px 18px rgba(0, 0, 0, 0.22) !important;
}

.sf .flap .ch {
  color: #f4b431;
}

.wrap {
  background: #080c12 !important;
}

.board-head {
  top: 64px !important;
  background: rgba(9, 14, 21, 0.96) !important;
  color: #a9caff !important;
}

.card {
  min-height: 72px;
  background: #0b1018 !important;
}

.card.human {
  background: linear-gradient(90deg, rgba(52, 211, 153, 0.07), #0b1018 38%) !important;
}

.card.hi {
  background: linear-gradient(90deg, rgba(47, 128, 255, 0.09), #0b1018 42%) !important;
}

.col.side {
  background: #0d131d !important;
}

#iv_drawer .iv-scrim {
  background: rgba(1, 4, 8, 0.78) !important;
}

#iv_drawer .iv-panel-d {
  background: #0b1018 !important;
}

@media (max-width: 920px) {
  header.bar {
    position: relative;
  }

  .board-head {
    top: 0 !important;
  }

  #intel,
  .pub,
  #ops,
  .opnote {
    width: min(100% - 20px, 1520px);
  }

  #intel .iv-head {
    align-items: stretch;
  }

  #intel .iv-ctrls {
    width: 100%;
  }

  #intel .iv-tokin {
    flex: 1 1 240px;
    width: auto !important;
  }
}

@media (max-width: 620px) {
  header.bar {
    padding: 12px;
  }

  .bar .meta {
    order: 3;
    width: 100%;
  }

  .bar .controls {
    width: 100%;
  }

  .bar label.tog,
  .bar a.back {
    flex: 1 1 auto;
    justify-content: center;
  }

  #intel {
    margin-top: 10px;
    padding: 18px 14px !important;
    border-radius: 12px;
  }

  #intel .iv-title {
    font-size: 22px !important;
  }

  #intel .iv-ctrls {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
  }

  #intel .iv-tokin {
    grid-column: 1 / -1;
    width: 100% !important;
  }

  #intel .iv-brief,
  #intel .iv-kpis,
  #intel .iv-grid {
    grid-template-columns: 1fr !important;
  }

  #intel .iv-filters {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
  }

  #intel .iv-filters label,
  #intel .iv-filters select {
    width: 100%;
  }

  .pub {
    padding: 18px 14px !important;
    border-radius: 12px;
  }

  .pcards,
  .stats {
    grid-template-columns: 1fr !important;
  }

  .pcard,
  .stat {
    min-height: 104px;
    padding: 14px !important;
  }

  .stats {
    grid-template-columns: 1fr 1fr !important;
  }

  .stats .stat:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }

  .status .legend {
    margin-left: 0 !important;
    width: 100%;
  }
}

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