@import url("https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,600;1,9..40,400&display=swap");

:root {
    --bg: #0f1419;
    --surface: #1a2332;
    --surface-hover: #243044;
    --border: #2d3a4d;
    --text: #e8eef5;
    --muted: #8b9cb3;
    --accent: #3d9cf5;
    --accent-dim: #2563a8;
    --success: #34c759;
    --warn: #f5a623;
    --danger: #ff5c5c;
    --radius: 10px;
    --font: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --mono: ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, monospace;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font);
    font-size: 1rem;
    line-height: 1.5;
    color: var(--text);
    background: radial-gradient(1200px 600px at 10% -10%, #1a2a44 0%, transparent 55%),
        radial-gradient(900px 500px at 100% 0%, #152238 0%, transparent 50%), var(--bg);
}

a {
    color: var(--accent);
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    background: rgba(26, 35, 50, 0.85);
    backdrop-filter: blur(8px);
    position: sticky;
    top: 0;
    z-index: 10;
}

.brand {
    font-weight: 600;
    font-size: 1.125rem;
    letter-spacing: -0.02em;
    color: var(--text);
    text-decoration: none;
}
.brand:hover {
    color: var(--accent);
    text-decoration: none;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.site-nav {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
}

.site-nav a {
    color: var(--muted);
    text-decoration: none;
}

.site-nav a:hover {
    color: var(--accent);
}

.main {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 1.5rem 3rem;
}

.page-head {
    margin-bottom: 1.75rem;
}
.page-head h1 {
    margin: 0.25rem 0 0;
    font-size: 1.75rem;
    font-weight: 600;
    letter-spacing: -0.03em;
}

.breadcrumb {
    margin: 0;
    font-size: 0.875rem;
    color: var(--muted);
}

.muted {
    color: var(--muted);
    margin-top: 0.35rem;
}

.grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1.35rem;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
}

.card-accent {
    border-color: var(--accent-dim);
    background: linear-gradient(145deg, #1e2d45 0%, var(--surface) 100%);
}

.card h2,
.section h2 {
    margin: 0 0 0.5rem;
    font-size: 1.05rem;
    font-weight: 600;
}

.stat {
    margin: 1rem 0 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--accent);
}

.section {
    margin-bottom: 2.5rem;
}

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.table-wrap {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--surface);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.data-table th,
.data-table td {
    text-align: left;
    padding: 0.65rem 1rem;
    border-bottom: 1px solid var(--border);
}

.data-table th {
    font-weight: 600;
    color: var(--muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: rgba(0, 0, 0, 0.2);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.data-table tbody tr:hover td {
    background: var(--surface-hover);
}

.badge {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
    background: var(--border);
    color: var(--text);
}

.badge-queued {
    background: #3a4556;
}
.badge-leased,
.badge-running {
    background: #2a4a6e;
    color: #9fd4ff;
}
.badge-success {
    background: #1e4d32;
    color: #a8f0c0;
}
.badge-failed {
    background: #5c2a2a;
    color: #ffb4b4;
}

.runner-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
}

.runner-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.1rem;
}

.runner-card h3 {
    margin: 0 0 0.35rem;
    font-size: 0.95rem;
    font-family: var(--mono);
    font-weight: 600;
}

.runner-card .labels {
    font-size: 0.8rem;
    color: var(--muted);
    word-break: break-word;
}

.dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 0.35rem;
    vertical-align: middle;
}
.dot-on {
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
}
.dot-off {
    background: #555;
}

.auth-panel {
    max-width: 380px;
    margin: 3rem auto;
    padding: 2rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.35);
}

.auth-panel h1 {
    margin: 0 0 0.5rem;
    font-size: 1.5rem;
}

.stack-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.25rem;
}

.stack-form label span {
    display: block;
    font-size: 0.8rem;
    color: var(--muted);
    margin-bottom: 0.35rem;
}

.stack-form input[type="password"],
.stack-form input[type="text"] {
    width: 100%;
    padding: 0.65rem 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font: inherit;
}

.btn {
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    border-radius: 8px;
    border: 1px solid transparent;
    padding: 0.55rem 1rem;
}

.btn-primary {
    background: var(--accent);
    color: #0a0f14;
}
.btn-primary:hover {
    filter: brightness(1.08);
}

.btn-ghost {
    background: transparent;
    color: var(--muted);
    border-color: var(--border);
}
.btn-ghost:hover {
    color: var(--text);
    border-color: var(--muted);
}

.btn-sm {
    font-size: 0.85rem;
    padding: 0.35rem 0.75rem;
}

.inline-form {
    display: inline;
    margin: 0;
}

.error-banner {
    background: rgba(255, 92, 92, 0.12);
    border: 1px solid rgba(255, 92, 92, 0.35);
    color: #ffb4b4;
    padding: 0.65rem 0.85rem;
    border-radius: 8px;
    font-size: 0.9rem;
}

.empty-hint {
    padding: 1rem;
    text-align: center;
}

.job-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
    margin: 1rem 0;
    font-size: 0.9rem;
}

.log-box {
    margin-top: 1rem;
    padding: 1rem;
    background: #0a0e14;
    border: 1px solid var(--border);
    border-radius: 8px;
    max-height: 420px;
    overflow: auto;
    font-family: var(--mono);
    font-size: 0.8rem;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
}

.pipeline-block {
    margin-top: 1.25rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.pipeline-block summary {
    padding: 0.75rem 1rem;
    cursor: pointer;
    font-weight: 600;
    background: rgba(0, 0, 0, 0.2);
}

.pipeline-block .inner {
    padding: 1rem;
    font-size: 0.85rem;
}

.stage {
    margin-bottom: 0.75rem;
    padding-left: 0.75rem;
    border-left: 3px solid var(--accent-dim);
}

.stage pre {
    margin: 0.35rem 0 0;
    font-family: var(--mono);
    font-size: 0.78rem;
    color: var(--muted);
    white-space: pre-wrap;
}

.artifact-filters {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.75rem 1rem;
    margin-bottom: 1.25rem;
    align-items: end;
}

.artifact-filters label {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.8rem;
    color: var(--muted);
}

.artifact-filters select,
.artifact-filters input[type="text"] {
    font: inherit;
    padding: 0.45rem 0.55rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
}

.artifact-filters .filter-actions {
    display: flex;
    gap: 0.5rem;
    align-items: flex-end;
}
