:root {
  color-scheme: dark;
  --bg: #070806;
  --panel: #11140f;
  --panel-2: #181d13;
  --panel-3: #202719;
  --line: #3b422c;
  --line-hot: #ff8b1a;
  --text: #f3f1df;
  --muted: #aeb49a;
  --dim: #717861;
  --orange: #ff8b1a;
  --amber: #ffd166;
  --green: #4ad66d;
  --cyan: #31c3ff;
  --red: #ff5252;
  --violet: #c084fc;
  --radius: 6px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(255, 139, 26, 0.035) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 139, 26, 0.025) 1px, transparent 1px),
    radial-gradient(circle at 70% 0%, rgba(49, 195, 255, 0.08), transparent 34%),
    var(--bg);
  background-size: 34px 34px, 34px 34px, 100% 100%, 100% 100%;
  color: var(--text);
  font-family: var(--sans);
  letter-spacing: 0;
  overflow-x: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.terminal {
  min-height: 100vh;
  padding: 14px;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 18px;
}

.login-card {
  width: min(920px, 100%);
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  border: 1px solid var(--line-hot);
  background: rgba(17, 20, 15, 0.96);
  box-shadow: 0 0 80px rgba(255, 139, 26, 0.08);
}

.login-hero {
  padding: 28px;
  border-right: 1px solid var(--line);
}

.brand-mark {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  color: #080908;
  background: var(--orange);
  border-radius: 4px;
  font-family: var(--mono);
  font-weight: 900;
  font-size: 22px;
}

.eyebrow {
  margin: 18px 0 8px;
  color: var(--orange);
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 12px;
  font-size: 34px;
  line-height: 1.1;
}

.login-hero p,
.muted {
  color: var(--muted);
  line-height: 1.55;
}

.login-form {
  padding: 28px;
  display: grid;
  align-content: center;
  gap: 12px;
}

.field,
.select,
.textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #0b0d0a;
  color: var(--text);
  min-height: 38px;
  padding: 9px 10px;
}

.textarea {
  min-height: 94px;
  resize: vertical;
  line-height: 1.5;
}

.label {
  display: block;
  margin-bottom: 6px;
  color: var(--orange);
  font-family: var(--mono);
  font-size: 12px;
}

.btn {
  border: 1px solid var(--orange);
  background: rgba(255, 139, 26, 0.14);
  color: var(--orange);
  border-radius: 4px;
  min-height: 38px;
  padding: 9px 12px;
  font-family: var(--mono);
  font-size: 12px;
}

.btn:hover {
  background: rgba(255, 139, 26, 0.22);
}

.btn.secondary {
  border-color: var(--line);
  color: var(--muted);
  background: var(--panel-2);
}

.btn.danger {
  border-color: var(--red);
  color: var(--red);
  background: rgba(255, 82, 82, 0.12);
}

.topbar {
  display: grid;
  grid-template-columns: minmax(280px, 1.2fr) minmax(340px, 2fr) minmax(260px, 0.8fr);
  gap: 10px;
  align-items: stretch;
}

.brand,
.ticker,
.user-panel,
.panel {
  border: 1px solid var(--line);
  background: rgba(17, 20, 15, 0.94);
  border-radius: var(--radius);
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px;
}

.brand h1 {
  margin: 0;
  font-size: 25px;
}

.brand p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.ticker {
  overflow: hidden;
  display: flex;
  align-items: center;
  min-height: 74px;
}

.ticker-track {
  display: flex;
  gap: 18px;
  white-space: nowrap;
  animation: ticker 32s linear infinite;
  padding-left: 100%;
  font-family: var(--mono);
  font-size: 12px;
}

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

.ticker strong {
  color: var(--text);
}

.ticker b {
  color: var(--green);
}

@keyframes ticker {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-100%);
  }
}

.user-panel {
  padding: 12px;
  display: grid;
  gap: 8px;
  min-height: 74px;
}

.user-panel strong {
  color: var(--orange);
}

.layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 360px;
  gap: 10px;
  margin-top: 10px;
  align-items: start;
}

.layout > * {
  min-width: 0;
}

.stack {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.squad-banner {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.squad-card {
  border: 1px solid rgba(255, 139, 26, 0.72);
  background:
    linear-gradient(90deg, rgba(255, 139, 26, 0.16), rgba(49, 195, 255, 0.05)),
    rgba(17, 20, 15, 0.96);
  border-radius: var(--radius);
  padding: 12px;
  min-height: 92px;
  display: grid;
  align-content: center;
  gap: 5px;
}

.squad-card span {
  color: var(--orange);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 800;
}

.squad-card strong {
  color: var(--text);
  font-size: 20px;
  line-height: 1.18;
}

.squad-card small {
  color: var(--muted);
  line-height: 1.4;
}

.panel-header {
  min-height: 38px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  background: linear-gradient(90deg, rgba(255, 139, 26, 0.16), rgba(255, 139, 26, 0.02));
}

.panel-title {
  margin: 0;
  color: var(--orange);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 800;
}

.panel-body {
  padding: 10px;
}

.tabs,
.filters,
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tab {
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--muted);
  border-radius: 4px;
  padding: 8px 10px;
  font-family: var(--mono);
  font-size: 12px;
}

.tab.active {
  color: var(--orange);
  border-color: var(--orange);
  background: rgba(255, 139, 26, 0.12);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.metric {
  border: 1px solid var(--line);
  background: var(--panel-2);
  padding: 10px;
  border-radius: 4px;
  min-height: 88px;
}

.metric label {
  display: block;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
  line-height: 1;
}

.metric span {
  display: block;
  margin-top: 8px;
  color: var(--dim);
  font-size: 12px;
}

.task-form {
  display: grid;
  gap: 10px;
}

.task-input-row {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(128px, 160px) minmax(110px, 132px) auto;
  gap: 8px;
  align-items: start;
  border: 1px solid var(--line);
  background: var(--panel-2);
  padding: 8px;
  border-radius: 4px;
  min-width: 0;
}

.task-input-row > * {
  min-width: 0;
}

.task-input-row .removeDraftTask {
  margin-top: 24px;
  white-space: nowrap;
}

.draft-note-field {
  grid-column: 1 / -1;
}

.task-list {
  display: grid;
  gap: 8px;
}

.task-card {
  border: 1px solid var(--line);
  background: var(--panel-2);
  border-radius: 4px;
}

.task-card.hot {
  border-color: rgba(255, 139, 26, 0.7);
}

.task-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
}

.task-body {
  padding: 10px;
  display: grid;
  gap: 8px;
}

.task-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
}

.original,
.adjusted {
  border: 1px solid var(--line);
  background: #0c0f0a;
  border-radius: 4px;
  padding: 10px;
  min-height: 110px;
}

.adjusted {
  border-color: rgba(255, 139, 26, 0.55);
}

.content-text {
  margin: 8px 0;
  line-height: 1.55;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  border: 1px solid var(--line);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.02);
  border-radius: 999px;
  padding: 4px 8px;
  font-family: var(--mono);
  font-size: 11px;
}

.tag.hot {
  color: var(--orange);
  border-color: var(--orange);
}

.tag.s {
  color: #fff;
  border-color: var(--red);
  background: rgba(255, 82, 82, 0.16);
}

.tag.a {
  color: var(--amber);
  border-color: var(--amber);
}

.tag.b {
  color: var(--cyan);
  border-color: var(--cyan);
}

.status-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
}

.status-dot::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--amber);
}

.status-dot.reviewed::before {
  background: var(--green);
}

.review-form {
  display: grid;
  grid-template-columns: 1fr 130px 110px;
  gap: 8px;
}

.review-form .textarea {
  grid-column: 1 / -1;
}

.mini-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.mini-list li {
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
  color: var(--muted);
  line-height: 1.55;
  font-size: 12px;
}

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

.heat-row {
  display: grid;
  grid-template-columns: 58px 1fr 44px;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
  font-size: 12px;
}

.bar {
  height: 12px;
  border: 1px solid var(--line);
  background: #2b3023;
  position: relative;
}

.bar span {
  position: absolute;
  inset: 0 auto 0 0;
  background: linear-gradient(90deg, var(--orange), var(--green));
}

.empty {
  color: var(--dim);
  line-height: 1.6;
  font-size: 13px;
}

.alert {
  border: 1px solid rgba(255, 139, 26, 0.5);
  border-left: 4px solid var(--orange);
  background: rgba(255, 139, 26, 0.08);
  padding: 10px;
  border-radius: 4px;
  color: var(--muted);
  line-height: 1.55;
}

.error {
  color: var(--red);
  min-height: 20px;
}

@media (max-width: 1180px) {
  .topbar,
  .layout,
  .login-card,
  .squad-banner {
    grid-template-columns: 1fr;
  }

  .login-hero {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .metric-grid,
  .task-grid,
  .review-form {
    grid-template-columns: 1fr;
  }

  .task-input-row {
    grid-template-columns: 1fr;
  }

  .task-input-row .removeDraftTask {
    margin-top: 0;
    width: fit-content;
  }
}

@media (max-width: 680px) {
  .terminal {
    padding: 8px;
  }

  h1 {
    font-size: 27px;
  }

  .metric-grid {
    grid-template-columns: 1fr 1fr;
  }
}
