:root {
  --bg: #f5f8f5;
  --bg-soft: #eef5ef;
  --panel: rgba(255, 255, 255, 0.9);
  --panel-strong: #ffffff;
  --text: #1f2d24;
  --muted: #65756b;
  --line: rgba(34, 63, 44, 0.1);
  --line-strong: rgba(34, 63, 44, 0.16);
  --primary: #2d6a4f;
  --primary-strong: #1f4c39;
  --accent: #dcae64;
  --accent-soft: rgba(220, 174, 100, 0.15);
  --success: #1f7a55;
  --danger: #b14343;
  --shadow: 0 20px 48px rgba(36, 61, 45, 0.08);
  --radius-xl: 32px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(220, 174, 100, 0.18), transparent 24%),
    radial-gradient(circle at top right, rgba(45, 106, 79, 0.12), transparent 22%),
    linear-gradient(180deg, #f8fbf8 0%, var(--bg) 100%);
}

.page-shell {
  width: min(1380px, calc(100% - 40px));
  margin: 0 auto;
  padding: 34px 0 56px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.85fr);
  gap: 24px;
  margin-bottom: 28px;
}

.hero-copy,
.hero-card,
.panel,
.subpanel,
.fold-card {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.hero-copy {
  border-radius: var(--radius-xl);
  padding: 42px;
}

.hero-card {
  border-radius: var(--radius-xl);
  padding: 30px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: #fbfdfb;
  background:
    linear-gradient(160deg, rgba(45, 106, 79, 0.96), rgba(21, 54, 39, 0.96)),
    var(--panel);
}

.eyebrow {
  margin: 0 0 12px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--accent);
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
}

h1 {
  max-width: 11ch;
  font-size: clamp(2.3rem, 5vw, 4.4rem);
  line-height: 0.97;
}

.hero-text,
.panel-heading p,
.subpanel-head p,
.status-text,
#jiraStatusText,
#jiraJqlPreview,
.results-meta {
  color: var(--muted);
}

.hero-text {
  max-width: 62ch;
  margin: 18px 0 0;
  font-size: 1.04rem;
  line-height: 1.78;
}

.hero-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.hero-steps span {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(45, 106, 79, 0.08);
  border: 1px solid rgba(45, 106, 79, 0.12);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--primary-strong);
}

.hero-stat-label {
  font-size: 0.79rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  opacity: 0.72;
}

.hero-stat-value {
  margin: 6px 0 18px;
  font-size: 1.82rem;
}

.hero-card-note {
  margin: 6px 0 0;
  font-size: 0.98rem;
  line-height: 1.7;
  color: rgba(251, 253, 251, 0.78);
}

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

.panel {
  border-radius: var(--radius-xl);
  padding: 28px;
}

.controls-grid {
  display: grid;
  gap: 18px;
}

.panel-heading {
  margin-bottom: 18px;
}

.panel-heading p {
  margin: 8px 0 0;
  max-width: 62ch;
  line-height: 1.65;
}

.inline-panel {
  display: grid;
  gap: 16px;
  padding: 18px;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(245, 249, 245, 0.86));
  border: 1px solid var(--line);
}

.status-block {
  display: grid;
  gap: 4px;
}

.section-kicker {
  font-size: 0.76rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary);
  font-weight: 800;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
}

.section-head h3 {
  font-size: 1.15rem;
}

.jira-status-row,
.jira-helper-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  flex-wrap: wrap;
}

.jira-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.field-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

.field,
.checkbox-field {
  display: grid;
  gap: 8px;
}

.field span,
.checkbox-field span {
  font-size: 0.9rem;
  font-weight: 700;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid rgba(34, 63, 44, 0.12);
  background: var(--panel-strong);
  border-radius: var(--radius-md);
  padding: 14px 15px;
  font: inherit;
  color: var(--text);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.field textarea {
  resize: vertical;
  min-height: 110px;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: rgba(45, 106, 79, 0.32);
  box-shadow: 0 0 0 4px rgba(45, 106, 79, 0.08);
  background: #fff;
}

.field-wide {
  grid-column: 1 / -1;
}

.checkbox-field {
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
}

.checkbox-field input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.fold-card {
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.fold-card summary {
  display: grid;
  gap: 4px;
  padding: 18px 20px;
  cursor: pointer;
  list-style: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(245, 249, 245, 0.86));
}

.fold-card summary::-webkit-details-marker {
  display: none;
}

.fold-card summary span {
  font-weight: 800;
}

.fold-card summary small {
  color: var(--muted);
  font-size: 0.88rem;
}

.fold-card[open] {
  padding-bottom: 4px;
}

.fold-card[open] summary {
  border-bottom: 1px solid var(--line);
}

.fold-card .field-grid {
  padding: 18px 20px 16px;
}

.actions-panel {
  gap: 14px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.button {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: transform 150ms ease, opacity 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button-primary {
  background: linear-gradient(135deg, var(--accent), var(--primary));
  color: #fdfefc;
  box-shadow: 0 12px 24px rgba(45, 106, 79, 0.16);
}

.button-secondary {
  background: rgba(45, 106, 79, 0.08);
  color: var(--primary-strong);
}

.button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.status-text {
  margin: 16px 2px 0;
  min-height: 24px;
  font-size: 0.94rem;
  line-height: 1.55;
}

.status-text[data-state="error"] {
  color: var(--danger);
}

.status-text[data-state="success"] {
  color: var(--success);
}

.results-meta {
  margin-bottom: 16px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: rgba(45, 106, 79, 0.05);
  border: 1px solid rgba(45, 106, 79, 0.1);
  line-height: 1.6;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.kpi-card {
  padding: 20px;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(245, 249, 245, 0.86));
  border: 1px solid var(--line);
}

.kpi-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.kpi-value {
  font-size: 1.95rem;
  font-family: "Space Grotesk", sans-serif;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.subpanel {
  border-radius: var(--radius-lg);
  padding: 20px;
}

.subpanel-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  margin-bottom: 14px;
}

.table-wrap {
  overflow: auto;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
}

table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  background: transparent;
}

th,
td {
  padding: 13px 14px;
  text-align: left;
  border-bottom: 1px solid rgba(34, 63, 44, 0.08);
  font-size: 0.93rem;
}

th {
  position: sticky;
  top: 0;
  background: rgba(45, 106, 79, 0.06);
  color: var(--muted);
  font-size: 0.77rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

tbody tr:nth-child(even) {
  background: rgba(238, 245, 239, 0.44);
}

tbody tr:hover {
  background: rgba(220, 174, 100, 0.12);
}

.sla-block {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
  color: var(--muted);
}

.detail-panel {
  margin-top: 18px;
}

.detail-panel table {
  min-width: 1040px;
}

@media (max-width: 1180px) {
  .hero,
  .layout,
  .results-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 760px) {
  .page-shell {
    width: min(100% - 20px, 1380px);
    padding-top: 22px;
  }

  .hero-copy,
  .hero-card,
  .panel,
  .subpanel {
    padding: 22px;
  }

  .field-grid,
  .field-grid-primary,
  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .hero-steps {
    flex-direction: column;
  }

  .actions,
  .jira-actions {
    width: 100%;
  }

  .button {
    width: 100%;
    justify-content: center;
  }
}
