:root {
  --bg: #070b12;
  --panel: #0f1622;
  --panel-2: #152033;
  --ink: #eef3f8;
  --muted: #8fa0b5;
  --line: rgba(238, 243, 248, 0.12);
  --accent: #3ecfff;
  --accent-2: #7b6cff;
  --danger: #ff4d6d;
  --warn: #fbbf24;
  --ok: #34d399;
  --font: "IBM Plex Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

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

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
}

button,
select {
  font: inherit;
}

a {
  color: inherit;
}

.banner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 1rem;
  background: linear-gradient(90deg, rgba(62, 207, 255, 0.18), rgba(123, 108, 255, 0.12));
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}

.banner strong {
  color: var(--accent);
  font-weight: 500;
}

.banner a {
  color: var(--accent);
  text-decoration: none;
}

.banner a:hover {
  text-decoration: underline;
}

.gate {
  min-height: calc(100vh - 2.5rem);
  display: grid;
  place-items: center;
  padding: 2rem 1rem;
}

.gate__card {
  width: min(100%, 26rem);
  padding: 2rem 1.75rem;
  background: var(--panel);
  border: 1px solid var(--line);
}

.gate__eyebrow {
  margin: 0 0 0.75rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

.gate__card h1 {
  margin: 0;
  font-size: 1.85rem;
  letter-spacing: -0.03em;
}

.gate__card p {
  margin: 0.85rem 0 1.5rem;
  color: var(--muted);
}

.app {
  display: none;
  min-height: calc(100vh - 2.5rem);
  grid-template-columns: 13.5rem 1fr;
}

.app.is-on {
  display: grid;
}

@media (max-width: 820px) {
  .app.is-on {
    grid-template-columns: 1fr;
  }
}

.side {
  background: var(--panel);
  border-right: 1px solid var(--line);
  padding: 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.side__brand {
  font-weight: 700;
  letter-spacing: -0.02em;
}

.side__brand span {
  display: block;
  margin-top: 0.25rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--muted);
}

.side__nav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.side__nav button {
  appearance: none;
  border: 0;
  text-align: left;
  padding: 0.65rem 0.75rem;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  border-radius: 0.25rem;
}

.side__nav button:hover,
.side__nav button:focus-visible {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.04);
}

.side__nav button.is-active {
  color: #061018;
  background: linear-gradient(120deg, var(--accent), #7dd3fc);
}

.main {
  padding: 1.25rem 1.35rem 2rem;
  min-width: 0;
}

.main__head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.main__head h2 {
  margin: 0;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}

.main__head p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

@media (max-width: 900px) {
  .kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.kpi {
  padding: 1rem;
  background: var(--panel);
  border: 1px solid var(--line);
}

.kpi__label {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.kpi__value {
  margin: 0.4rem 0 0;
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.grid-2 {
  display: grid;
  gap: 1rem;
}

@media (min-width: 960px) {
  .grid-2 {
    grid-template-columns: 1.1fr 0.9fr;
  }
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  overflow: hidden;
}

.panel__title {
  margin: 0;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.95rem;
}

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

.row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem;
  align-items: center;
  width: 100%;
  padding: 0.9rem 1rem;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.row:last-child {
  border-bottom: 0;
}

.row:hover,
.row:focus-visible {
  background: rgba(255, 255, 255, 0.03);
}

.row__title {
  margin: 0;
  font-weight: 600;
}

.row__meta {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.badge {
  display: inline-flex;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  color: var(--muted);
}

.badge--high {
  color: var(--danger);
  border-color: rgba(255, 77, 109, 0.4);
}

.badge--medium {
  color: var(--warn);
  border-color: rgba(251, 191, 36, 0.4);
}

.badge--low,
.badge--closed {
  color: var(--ok);
  border-color: rgba(52, 211, 153, 0.35);
}

.badge--new {
  color: var(--accent);
  border-color: rgba(62, 207, 255, 0.4);
}

.badge--in_progress {
  color: var(--accent-2);
  border-color: rgba(123, 108, 255, 0.4);
}

.view {
  display: none;
}

.view.is-on {
  display: block;
}

.view[hidden] {
  display: none !important;
}

.detail {
  display: none;
  margin-top: 1rem;
  padding: 1rem;
  background: var(--panel-2);
  border: 1px solid var(--line);
}

.detail.is-on {
  display: block;
}

.detail h3 {
  margin: 0 0 0.5rem;
}

.detail p {
  margin: 0 0 0.65rem;
  color: var(--muted);
}

.field {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}

.field label {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.field select {
  appearance: none;
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 0.5rem 0.65rem;
  max-width: 16rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.btn {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--ink);
  padding: 0.55rem 0.9rem;
  cursor: pointer;
}

.btn:hover,
.btn:focus-visible {
  border-color: rgba(62, 207, 255, 0.45);
}

.btn--primary {
  border-color: transparent;
  background: linear-gradient(120deg, var(--accent), #7dd3fc);
  color: #061018;
  font-weight: 600;
}

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

.feed li {
  display: grid;
  grid-template-columns: 3.5rem 1fr;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}

.feed li:last-child {
  border-bottom: 0;
}

.feed time {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--accent);
}

.hint {
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-bottom: 0.85rem;
}

.toolbar input,
.toolbar select,
.field textarea {
  appearance: none;
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 0.5rem 0.65rem;
  min-width: 0;
}

.toolbar input {
  flex: 1 1 12rem;
}

.toolbar select {
  flex: 0 1 10rem;
}

.field textarea {
  width: 100%;
  resize: vertical;
  font: inherit;
}

.detail__label {
  margin: 0.75rem 0 0.35rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}

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

.muted {
  color: var(--muted);
}

.mono {
  font-family: var(--mono);
  font-size: 0.9rem;
}

.badge--ok {
  color: var(--ok);
  border-color: rgba(52, 211, 153, 0.35);
}

.badge--warn {
  color: var(--warn);
  border-color: rgba(251, 191, 36, 0.4);
}

.badge--alert {
  color: var(--danger);
  border-color: rgba(255, 77, 109, 0.4);
}

.btn--ghost {
  margin-top: auto;
  width: 100%;
  font-size: 0.85rem;
  opacity: 0.85;
}

.side__reset {
  margin-top: auto;
}

.toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 40;
  padding: 0.7rem 1rem;
  background: var(--panel-2);
  border: 1px solid var(--line);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  font-size: 0.9rem;
}
