:root {
  --ink: #20242b;
  --muted: #66717f;
  --line: #d9dde2;
  --paper: #f7f8f5;
  --panel: #ffffff;
  --steel: #3e5866;
  --green: #2f6b4f;
  --amber: #8c621f;
  --red: #9a3d34;
  --blue: #315f89;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

button,
input,
select {
  font: inherit;
}

.topbar {
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: #fbfbf8;
}

.topbar h1,
.deployment-header h2,
.section-head h2 {
  margin: 0;
}

.eyebrow {
  display: block;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--steel);
  text-transform: uppercase;
}

.ghost-button,
.login-form button,
.link-form button {
  border: 1px solid var(--ink);
  background: var(--ink);
  color: #fff;
  padding: 10px 14px;
  cursor: pointer;
}

.ghost-button {
  background: transparent;
  color: var(--ink);
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(260px, 340px) 1fr;
  min-height: calc(100vh - 76px);
}

.app-shell.single {
  display: block;
  padding: 28px;
}

.deployment-list {
  border-right: 1px solid var(--line);
  background: #eef1ee;
  overflow: auto;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 18px 12px;
}

.section-head span {
  color: var(--muted);
  font-weight: 700;
}

.deployment-link {
  display: block;
  color: inherit;
  text-decoration: none;
  padding: 14px 18px;
  border-top: 1px solid rgba(32, 36, 43, 0.09);
}

.deployment-link strong,
.deployment-link span {
  display: block;
}

.deployment-link strong {
  line-height: 1.25;
}

.deployment-link span {
  color: var(--muted);
  font-size: 0.88rem;
  margin-top: 5px;
}

.deployment-link.active {
  background: var(--panel);
  border-left: 5px solid var(--green);
  padding-left: 13px;
}

.detail-pane {
  padding: 24px;
  overflow: auto;
}

.deployment-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
}

.deployment-header h2 {
  font-size: 1.7rem;
  line-height: 1.15;
}

.status-pill,
.status-tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  background: #e6eee8;
  color: var(--green);
  border: 1px solid rgba(47, 107, 79, 0.25);
  white-space: nowrap;
}

.header-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(110px, 1fr));
  gap: 0;
  margin: 22px 0 0;
  border: 1px solid var(--line);
  background: var(--panel);
}

.header-grid div {
  padding: 12px;
  border-right: 1px solid var(--line);
}

.header-grid div:last-child {
  border-right: 0;
}

dt {
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  font-weight: 700;
}

dd {
  margin: 4px 0 0;
  min-height: 1.3em;
}

.notes-band {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.notes-band p {
  margin: 0;
  padding: 14px;
  border-left: 4px solid var(--amber);
  background: #fff8eb;
  line-height: 1.45;
}

.notes-band b {
  display: block;
  margin-bottom: 6px;
}

.summary-strip {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(3, 140px);
  gap: 12px;
}

.summary-strip div {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 12px;
}

.summary-strip span,
.summary-strip small {
  display: block;
}

.summary-strip span {
  font-size: 1.6rem;
  font-weight: 800;
}

.summary-strip small {
  color: var(--muted);
  text-transform: uppercase;
  font-size: 0.72rem;
  font-weight: 700;
}

.toolbar {
  margin-top: 20px;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(170px, 240px) minmax(170px, 260px);
  gap: 12px;
}

.toolbar label,
.login-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.toolbar input,
.toolbar select,
.login-form input {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 8px 10px;
}

.task-table-wrap {
  margin-top: 16px;
  border: 1px solid var(--line);
  background: var(--panel);
  overflow: auto;
}

.task-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
}

.task-table th,
.task-table td {
  text-align: left;
  vertical-align: top;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.task-table th {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--muted);
  background: #f1f3f0;
}

.task-table td:first-child {
  width: 42%;
}

.task-table strong {
  display: block;
  line-height: 1.3;
}

.task-table p {
  margin: 7px 0 0;
  color: var(--muted);
  line-height: 1.35;
}

.task-id {
  color: var(--blue);
  font-weight: 800;
}

.file-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.file-tags span {
  border: 1px solid #c9d1d6;
  color: var(--steel);
  background: #f3f7f8;
  padding: 3px 7px;
  font-size: 0.82rem;
}

.notice {
  margin-bottom: 14px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  background: #fff;
}

.notice-error {
  border-color: rgba(154, 61, 52, 0.4);
  color: var(--red);
  background: #fff4f1;
}

.notice-success {
  border-color: rgba(47, 107, 79, 0.35);
  color: var(--green);
  background: #f0f7f2;
}

.empty-state {
  padding: 30px;
  background: var(--panel);
  border: 1px solid var(--line);
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(90deg, rgba(32, 36, 43, 0.04) 1px, transparent 1px),
    linear-gradient(180deg, rgba(32, 36, 43, 0.04) 1px, transparent 1px),
    #f4f5f1;
  background-size: 28px 28px;
}

.login-panel {
  width: min(430px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 28px;
  box-shadow: 0 18px 50px rgba(32, 36, 43, 0.12);
}

.login-brand {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 22px;
}

.mark {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  background: var(--green);
  color: #fff;
  font-weight: 800;
}

.login-brand h1,
.login-brand p {
  margin: 0;
}

.login-brand p {
  color: var(--muted);
  margin-top: 2px;
}

.login-form {
  display: grid;
  gap: 14px;
}

.link-form {
  margin-top: 12px;
}

.link-form button {
  background: transparent;
  color: var(--ink);
}

@media (max-width: 940px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .deployment-list {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    max-height: 280px;
  }

  .header-grid,
  .notes-band,
  .toolbar {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 560px) {
  .topbar {
    height: auto;
    padding: 14px;
    gap: 12px;
  }

  .detail-pane {
    padding: 14px;
  }

  .deployment-header {
    display: grid;
  }

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