:root {
  --navy: #172538;
  --ink: #253246;
  --muted: #6c7889;
  --line: #dfe5eb;
  --panel: #ffffff;
  --canvas: #f4f6f8;
  --green: #13795b;
  --green-soft: #e3f4ed;
  --gold: #8a6500;
  --gold-soft: #fff4cc;
  --red: #a83232;
  --red-soft: #fde9e7;
  --blue: #2264a7;
  --blue-soft: #e8f1fb;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); color: var(--ink); font: 15px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2 { color: var(--navy); line-height: 1.15; margin: 0; }
h1 { font-size: clamp(1.8rem, 3vw, 2.5rem); letter-spacing: -0.035em; }
h2 { font-size: 1.2rem; }
small { display: block; color: var(--muted); margin-top: 3px; }
.muted { color: var(--muted); }
.eyebrow { color: #6f7b8c; font-size: 11px; font-weight: 800; letter-spacing: .13em; margin: 0 0 8px; }

.topbar { min-height: 72px; padding: 0 30px; display: flex; align-items: center; gap: 34px; background: var(--navy); color: white; }
.brand { color: white; display: flex; align-items: center; gap: 11px; min-width: 220px; }
.brand:hover { text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 9px; background: #c7a94b; color: #142236; font-weight: 900; }
.brand strong, .brand small { display: block; color: white; line-height: 1.1; }
.brand small { opacity: .68; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; margin-top: 4px; }
nav { display: flex; align-items: center; gap: 22px; flex: 1; }
nav a { color: #d8e1eb; font-size: 14px; }
.account { display: flex; align-items: center; gap: 14px; font-size: 13px; }
.link-button { border: 0; padding: 0; color: #d8e1eb; background: none; cursor: pointer; }

.container { width: min(1220px, calc(100% - 40px)); margin: 34px auto 70px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 30px; margin-bottom: 26px; }
.page-head .muted { margin: 8px 0 0; max-width: 720px; }
.environment { background: white; color: var(--green); border: 1px solid var(--line); border-radius: 99px; padding: 8px 13px; font-size: 12px; font-weight: 700; }

.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.metric { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 20px; box-shadow: 0 1px 2px rgb(20 30 40 / 4%); }
.metric span { display: block; color: var(--muted); font-size: 13px; }
.metric strong { display: block; color: var(--navy); font-size: 2rem; line-height: 1; margin-top: 12px; }
.grid-two { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 22px; margin-bottom: 20px; box-shadow: 0 1px 2px rgb(20 30 40 / 4%); }
.panel-head, .action-panel { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.panel-head { margin-bottom: 14px; }
.rows { border-top: 1px solid var(--line); }
.row { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 66px; border-bottom: 1px solid var(--line); color: var(--ink); }
.row:hover { text-decoration: none; background: #fafbfc; }
.empty { color: var(--muted); padding: 30px 4px; text-align: center; }

.status { display: inline-flex; align-items: center; border-radius: 99px; padding: 5px 9px; font-size: 11px; font-weight: 800; white-space: nowrap; background: #eef1f4; color: #536070; }
.status-production, .status-approved, .status-succeeded { background: var(--green-soft); color: var(--green); }
.status-qc, .status-submitted, .status-retesting, .status-queued, .status-running, .status-claimed { background: var(--blue-soft); color: var(--blue); }
.status-changes, .status-waiting { background: var(--gold-soft); color: var(--gold); }
.status-disabled, .status-rejected, .status-failed, .status-canceled { background: var(--red-soft); color: var(--red); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { border-bottom: 1px solid var(--line); padding: 13px 12px; text-align: left; vertical-align: middle; }
th { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .07em; }
tbody tr:last-child td { border-bottom: 0; }
.search { display: flex; gap: 10px; max-width: 560px; margin-bottom: 18px; }
input, textarea { width: 100%; border: 1px solid #cbd4dd; border-radius: 8px; padding: 11px 12px; font: inherit; background: white; }
select { width: 100%; border: 1px solid #cbd4dd; border-radius: 8px; padding: 11px 12px; font: inherit; background: white; }
input:focus, textarea:focus, select:focus { outline: 3px solid #dbeaff; border-color: var(--blue); }
textarea { resize: vertical; }
button { font: inherit; }
.primary, .secondary { border: 0; border-radius: 8px; padding: 11px 18px; cursor: pointer; font-weight: 800; }
.primary { color: white; background: var(--blue); }
.secondary { color: var(--navy); background: #e7ebef; }
.button-row { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.button-link { display: inline-flex; align-items: center; text-decoration: none; }
.button-link:hover { text-decoration: none; }
.review-form { display: grid; gap: 12px; }
.review-form label { color: var(--navy); font-weight: 800; }
.review-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.warning-button, .danger-button { border: 0; border-radius: 8px; padding: 11px 18px; cursor: pointer; font-weight: 800; }
.warning-button { background: var(--gold-soft); color: var(--gold); }
.danger-button { background: var(--red-soft); color: var(--red); margin-left: auto; }
.review-note { margin-bottom: 18px; border-left: 4px solid var(--blue); background: var(--blue-soft); padding: 12px 15px; }
.review-note p { margin: 5px 0 0; }
.run-form { width: min(520px, 100%); display: grid; gap: 10px; }
.run-form label { color: var(--navy); font-weight: 800; }
.run-form input[type="file"] { margin-top: 7px; }
.run-form .primary { justify-self: start; margin-top: 4px; }
.notice-panel { border-left: 5px solid var(--gold); background: #fffdf6; }
.notice-panel p { margin-bottom: 0; }
.result-links { display: flex; flex-wrap: wrap; gap: 10px; }
.run-error { display: block; max-width: 420px; color: var(--red); font-size: 13px; }
.nav-badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; margin-left: 5px; padding: 0 6px; border-radius: 99px; background: #c7a94b; color: var(--navy); font-size: 11px; font-weight: 900; }
.workspace-head .muted { font-size: 16px; }
.section-block { margin-bottom: 28px; }
.section-head { margin-bottom: 14px; }
.automation-card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.automation-card { min-height: 220px; display: flex; flex-direction: column; padding: 22px; border: 1px solid var(--line); border-radius: 14px; background: white; color: var(--ink); box-shadow: 0 2px 8px rgb(20 30 40 / 5%); transition: transform .15s ease, box-shadow .15s ease; }
.automation-card:hover { text-decoration: none; transform: translateY(-2px); box-shadow: 0 10px 28px rgb(20 30 40 / 9%); }
.automation-card h2 { margin-top: 20px; font-size: 1.25rem; }
.automation-card p { color: var(--muted); margin: 9px 0 22px; }
.automation-card-top { display: flex; align-items: center; gap: 8px; }
.automation-card-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.automation-card-meta strong { color: var(--blue); }
.health-dot { display: inline-block; width: 10px; height: 10px; border-radius: 99px; flex: 0 0 auto; }
.health-ready { background: var(--green); }
.health-running { background: var(--blue); box-shadow: 0 0 0 5px var(--blue-soft); }
.health-attention { background: var(--red); }
.health-setup { background: var(--gold); }
.health-label { font-size: 12px; font-weight: 850; }
.health-text-ready { color: var(--green); }
.health-text-running { color: var(--blue); }
.health-text-attention { color: var(--red); }
.health-text-setup { color: var(--gold); }
.back-link { margin-bottom: 18px; font-size: 13px; }
.health-pill { display: inline-flex; align-items: center; gap: 9px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 99px; background: white; font-weight: 850; white-space: nowrap; }
.quick-status-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 20px; }
.quick-card { display: flex; flex-direction: column; min-height: 128px; padding: 20px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.quick-card > span { color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.quick-card strong { color: var(--navy); font-size: 1.15rem; margin-top: 10px; }
.quick-card small { margin-top: 7px; }
.attention-banner { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 20px; padding: 17px 20px; border: 1px solid #efc2bd; border-left: 5px solid var(--red); border-radius: 10px; background: var(--red-soft); }
.attention-banner div { display: flex; flex-direction: column; }
.attention-banner span { color: #7e4242; font-size: 13px; }
.run-workspace { display: grid; grid-template-columns: 1fr minmax(340px, .85fr); gap: 34px; align-items: center; padding: 28px; border-top: 5px solid var(--blue); }
.run-copy h2 { font-size: 1.45rem; }
.run-steps { margin: 15px 0 0; padding-left: 22px; }
.run-steps li { margin: 8px 0; }
.run-form-card { padding: 20px; border-radius: 10px; background: #f6f9fc; }
.large-button { min-height: 48px; font-size: 15px; }
.not-ready-box { display: flex; flex-direction: column; padding: 20px; border-radius: 10px; background: var(--gold-soft); color: var(--gold); }
.schedule-form { display: grid; gap: 16px; margin-top: 18px; }
.checkbox-row { display: flex; align-items: center; gap: 9px; font-weight: 800; }
.checkbox-row input { width: auto; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.form-grid label { color: var(--navy); font-size: 13px; font-weight: 750; }
.form-grid select, .form-grid input { margin-top: 5px; }
.help-card p:not(.eyebrow) { color: var(--muted); }
.run-history-cards { display: grid; gap: 12px; }
.run-history-card { padding: 17px; border: 1px solid var(--line); border-radius: 10px; }
.run-history-head { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.run-history-card p { margin: 11px 0; }
.filter-tabs { display: flex; gap: 4px; margin-bottom: 18px; padding: 4px; width: fit-content; border-radius: 9px; background: #e8ecf0; }
.filter-tabs a { padding: 7px 13px; border-radius: 7px; color: var(--ink); font-size: 13px; font-weight: 750; }
.filter-tabs a:hover { text-decoration: none; }
.filter-tabs a.active { background: white; box-shadow: 0 1px 3px rgb(20 30 40 / 12%); }
.issue-list { display: grid; gap: 12px; }
.issue-card { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 12px; background: white; color: var(--ink); }
.issue-card:hover { text-decoration: none; border-color: #b7c6d7; }
.issue-main p { margin: 6px 0; color: var(--muted); }
.issue-title-line { display: flex; align-items: center; gap: 9px; }
.urgent-tag { padding: 3px 7px; border-radius: 99px; background: var(--red-soft); color: var(--red); font-size: 10px; font-weight: 900; text-transform: uppercase; }
.issue-create-layout { grid-template-columns: 1.25fr .75fr; }
.issue-form { margin-top: 0; }
.issue-form select, .issue-form textarea, .issue-form input { margin-top: 6px; }
.field-error { display: block; margin-top: 5px; color: var(--red); font-size: 12px; }
.linked-run { padding: 10px 12px; border-radius: 8px; background: var(--blue-soft); color: var(--blue); font-weight: 800; }
.security-note-box { display: flex; flex-direction: column; margin-top: 22px; padding: 14px; border-radius: 9px; background: var(--red-soft); color: var(--red); }
.security-note-box span { font-size: 13px; margin-top: 4px; }
.issue-detail-grid { grid-template-columns: minmax(0, 1.45fr) minmax(280px, .55fr); align-items: start; }
.issue-description > p:not(.eyebrow) { font-size: 16px; }
.comment-thread { display: grid; gap: 12px; }
.comment { padding: 14px; border-radius: 10px; background: #f5f7f9; }
.comment > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.comment p { margin: 8px 0 0; }
.comment-form { display: grid; gap: 10px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.comment-form label { font-weight: 800; }
.comment-form textarea { margin-top: 6px; }
.comment-form button { justify-self: start; }
.compact-empty { padding: 15px 4px; }
.issue-facts dl { margin: 14px 0 0; }
.issue-facts dl div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.issue-facts dt { color: var(--muted); }
.issue-facts dd { margin: 0; text-align: right; font-weight: 750; }
.resolution-box { margin-top: 16px; padding: 13px; border-radius: 8px; background: var(--green-soft); color: var(--green); }
.resolution-box p { margin-bottom: 0; }
.compact-form { margin-top: 16px; }
.sub-page-head { margin-top: 36px; margin-bottom: 18px; }
.status-open { background: var(--blue-soft); color: var(--blue); }
.status-in_progress { background: var(--gold-soft); color: var(--gold); }
.status-resolved { background: var(--green-soft); color: var(--green); }
.steps-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.three-steps { grid-template-columns: repeat(3, 1fr); }
.step-card { background: white; border: 1px solid var(--line); border-radius: 12px; padding: 22px; }
.step-card > span { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 99px; background: var(--navy); color: white; font-weight: 900; margin-bottom: 18px; }
.step-card p { color: var(--muted); margin-bottom: 0; }
.plain-list { margin: 14px 0 0; padding-left: 20px; }
.plain-list li { margin: 8px 0; }
.status-guide { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.status-guide p { color: var(--muted); font-size: 13px; margin-bottom: 0; }

.login-shell { min-height: calc(100vh - 160px); display: grid; place-items: center; }
.login-card { width: min(470px, 100%); background: white; border: 1px solid var(--line); border-radius: 14px; padding: 36px; box-shadow: 0 16px 50px rgb(20 30 40 / 9%); }
.stacked-form { display: grid; gap: 16px; margin-top: 24px; }
.stacked-form label { font-weight: 700; color: var(--navy); }
.stacked-form input { margin-top: 6px; }
.security-note { color: var(--muted); font-size: 12px; text-align: center; margin: 18px 0 0; }
.messages { margin-bottom: 18px; }
.message { background: var(--blue-soft); color: var(--blue); border-radius: 8px; padding: 12px 14px; }
.message.error { background: var(--red-soft); color: var(--red); }
.message.success { background: var(--green-soft); color: var(--green); }

@media (max-width: 900px) {
  .topbar { align-items: flex-start; flex-wrap: wrap; padding: 18px 20px; gap: 16px; }
  nav { order: 3; width: 100%; overflow-x: auto; padding-bottom: 4px; }
  .account { margin-left: auto; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .grid-two { grid-template-columns: 1fr; }
  .steps-grid { grid-template-columns: 1fr 1fr; }
  .status-guide { grid-template-columns: 1fr 1fr; }
  .automation-card-grid { grid-template-columns: 1fr 1fr; }
  .quick-status-grid { grid-template-columns: 1fr; }
  .run-workspace { grid-template-columns: 1fr; }
  .issue-detail-grid, .issue-create-layout { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .container { width: min(100% - 24px, 1220px); margin-top: 22px; }
  .account span { display: none; }
  .metrics { grid-template-columns: 1fr 1fr; gap: 10px; }
  .metric { padding: 15px; }
  .metric strong { font-size: 1.55rem; }
  .page-head, .action-panel { flex-direction: column; }
  .steps-grid, .status-guide { grid-template-columns: 1fr; }
  .danger-button { margin-left: 0; }
  .login-card { padding: 24px; }
  .automation-card-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .issue-card { align-items: flex-start; flex-direction: column; }
}
