:root {
    --ink: #102331;
    --muted: #60717d;
    --line: #dce5e9;
    --surface: #ffffff;
    --canvas: #f4f7f8;
    --navy: #263f4d;
    --teal: #08aeb5;
    --teal-dark: #07878d;
    --green: #198754;
    --red: #c63b4a;
    --amber: #a46500;
    --shadow: 0 18px 45px rgba(16, 35, 49, .08);
}

* { box-sizing: border-box; }
html { font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--ink); background: var(--canvas); }
body { margin: 0; min-height: 100vh; }
a { color: var(--teal-dark); }

.topbar { min-height: 76px; padding: 0 5vw; display: flex; align-items: center; justify-content: space-between; background: var(--navy); color: white; }
.brand { display: flex; align-items: baseline; gap: 3px; color: white; text-decoration: none; letter-spacing: -.03em; }
.brand span { font-size: .68rem; align-self: flex-start; margin-top: 9px; }
.brand strong { font-size: 1.35rem; }
.brand em { margin-left: 10px; padding: 4px 8px; border-radius: 999px; background: var(--teal); font-size: .7rem; font-style: normal; letter-spacing: .08em; text-transform: uppercase; }
nav { display: flex; align-items: center; gap: 24px; }
nav a, .link-button { color: #eef8fa; text-decoration: none; font: inherit; }
.inline-form { display: inline; margin: 0; }
.link-button { padding: 0; border: 0; background: transparent; cursor: pointer; }

.container { width: min(1180px, 92vw); margin: 0 auto; padding: 38px 0 70px; }
.page-heading h1 { margin: 0 0 26px; font-size: clamp(1.9rem, 3vw, 2.7rem); letter-spacing: -.04em; }
.hero-card, .section-card, .auth-card, .result-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.hero-card { display: grid; grid-template-columns: .85fr 1.15fr; gap: 32px; padding: clamp(26px, 4vw, 48px); border-top: 5px solid var(--teal); }
.hero-card h2, .section-card h2 { margin: 4px 0 10px; font-size: clamp(1.45rem, 2vw, 2rem); letter-spacing: -.025em; }
.section-card { margin-top: 28px; padding: 28px; }
.section-card.narrow, .auth-card { max-width: 680px; }
.auth-card { margin: 20px auto; padding: 34px; }
.eyebrow { margin: 0; color: var(--teal-dark); font-size: .77rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.muted { color: var(--muted); line-height: 1.65; }

label { display: grid; gap: 7px; color: var(--ink); font-size: .9rem; font-weight: 700; }
input, textarea, select { width: 100%; border: 1px solid #bdcbd1; border-radius: 9px; padding: 11px 12px; background: white; color: var(--ink); font: inherit; }
textarea { resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 3px solid rgba(8, 174, 181, .18); border-color: var(--teal); }
.search-form, .stack-form, .result-form { display: grid; gap: 16px; }
.form-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.form-row.thirds { grid-template-columns: repeat(3, 1fr); }
.check-row { display: grid; grid-template-columns: auto 1fr; align-items: start; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; }
.check-row input { width: auto; margin-top: 4px; }
.check-row small { display: block; margin-top: 4px; color: var(--muted); font-weight: 400; line-height: 1.45; }

.button { display: inline-flex; align-items: center; justify-content: center; width: fit-content; min-height: 42px; padding: 10px 17px; border: 0; border-radius: 8px; font: inherit; font-weight: 750; text-decoration: none; cursor: pointer; }
.button:disabled { opacity: .45; cursor: not-allowed; }
.button-primary { background: var(--teal); color: #062f32; }
.button-primary:hover { background: #10c4cc; }
.button-secondary { background: #e9f1f3; color: var(--ink); }
.button-approve { background: #e2f4e9; color: #12633f; }
.button-reject { background: #fae7e9; color: #9f2633; }
.button-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.text-link { font-weight: 700; }

.alert { margin: 0 0 20px; padding: 14px 16px; border-radius: 10px; border: 1px solid; line-height: 1.45; }
.alert.compact { margin-top: 14px; }
.alert-success { background: #e6f5ec; border-color: #99d1b0; color: #145a38; }
.alert-error { background: #fdebed; border-color: #efadb5; color: #942735; }
.alert-warning { background: #fff4dc; border-color: #e8c77e; color: #744800; }
.alert-info { background: #e4f5f7; border-color: #9bd7da; color: #125b5f; }

.section-heading, .result-topline, .summary-row { display: flex; justify-content: space-between; gap: 16px; align-items: center; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 14px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--muted); font-size: .77rem; letter-spacing: .05em; text-transform: uppercase; }
.empty-state { padding: 26px; border: 1px dashed #b9c8ce; border-radius: 12px; color: var(--muted); text-align: center; }
.status { display: inline-flex; width: fit-content; padding: 5px 9px; border-radius: 999px; background: #edf1f2; color: #4f626c; font-size: .74rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.status-completed, .status-approved { background: #e2f4e9; color: #12633f; }
.status-running { background: #e4f5f7; color: #12656a; }
.status-failed, .status-rejected { background: #fae7e9; color: #9f2633; }
.search-summary h2 { max-width: 850px; }
.summary-row { justify-content: flex-start; color: var(--muted); }
.result-list { display: grid; gap: 20px; margin-top: 24px; }
.result-card { padding: 24px; }
.result-topline { margin-bottom: 18px; }
.description { color: var(--muted); line-height: 1.55; }
details { padding: 12px 14px; background: #f7f9fa; border-radius: 9px; }
summary { cursor: pointer; font-weight: 700; }
footer { padding: 24px; color: var(--muted); text-align: center; font-size: .82rem; }

@media (max-width: 780px) {
    .topbar { align-items: flex-start; gap: 18px; padding-top: 18px; padding-bottom: 18px; }
    nav { gap: 12px; font-size: .88rem; }
    .hero-card { grid-template-columns: 1fr; }
    .form-row, .form-row.thirds { grid-template-columns: 1fr; }
    .container { width: min(94vw, 720px); padding-top: 24px; }
}

@media (max-width: 520px) {
    .topbar { flex-direction: column; }
    .brand em { display: none; }
    .hero-card, .section-card, .auth-card, .result-card { padding: 20px; border-radius: 13px; }
}
