:root {
    --navy: #000351;
    --navy-deep: #00022e;
    --sky: #60b1e7;
    --blue: #215aab;
    --green: #0dc072;
    --green-dark: #099259;
    --orange: #fd5e08;
    --red: #b80000;
    --bg: #f3f2f4;
    --panel: #ffffff;
    --panel-alt: #f8f7f9;
    --panel-strong: #ffffff;
    --line: #e1e2e4;
    --text: #0d0022;
    --muted: #5c5c72;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
}

.loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: grid;
    place-items: center;
    background: rgba(0, 3, 81, 0.55);
    backdrop-filter: blur(6px);
}

.loading-overlay.hidden {
    display: none;
}

.loading-card {
    width: min(92vw, 460px);
    padding: 28px 24px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 24px 50px rgba(0, 3, 81, 0.3);
    text-align: center;
}

.loading-card h2 {
    margin: 12px 0 8px;
}

.loading-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
}

.loading-timer {
    margin-top: 14px !important;
    font-weight: 700;
    color: var(--blue) !important;
}

.loading-spinner {
    width: 52px;
    height: 52px;
    margin: 0 auto;
    border-radius: 50%;
    border: 5px solid rgba(96, 177, 231, 0.25);
    border-top-color: var(--sky);
    animation: spin 0.9s linear infinite;
}

.shell {
    max-width: 1280px;
    margin: 0 auto;
    padding: 32px 20px 48px;
}

.hero {
    background: linear-gradient(135deg, var(--navy-deep) 0%, var(--navy) 55%, var(--blue) 130%);
    color: #f4f8fd;
    border-radius: 20px;
    padding: 32px;
    box-shadow: 0 18px 40px rgba(0, 3, 81, 0.28);
    position: relative;
    overflow: hidden;
}

.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 88% -10%, rgba(96, 177, 231, 0.35), transparent 55%),
                radial-gradient(circle at 8% 120%, rgba(13, 192, 114, 0.22), transparent 50%);
    pointer-events: none;
}

.hero-bar {
    display: flex;
    gap: 20px;
    justify-content: space-between;
    align-items: flex-start;
    position: relative;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 12px;
    font-weight: 700;
    color: var(--sky);
}

.hero h1 {
    margin: 8px 0 10px;
    font-size: 36px;
    letter-spacing: -0.01em;
}

.intro {
    max-width: 760px;
    line-height: 1.55;
    color: #d7e4f5;
}

.logout-form {
    display: flex;
    gap: 10px;
    align-items: center;
}

.session-chip {
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(96, 177, 231, 0.18);
    border: 1px solid rgba(96, 177, 231, 0.35);
    color: #eef6fd;
    font-weight: 600;
    white-space: nowrap;
}

.ghost-button {
    width: auto;
    min-width: 120px;
    background: rgba(255, 255, 255, 0.12);
    color: #f4f8fd;
    border: 1px solid rgba(255, 255, 255, 0.22);
}

.ghost-button:hover {
    background: rgba(255, 255, 255, 0.22);
}

.messages {
    margin: 18px 0;
    display: grid;
    gap: 10px;
}

.message {
    border-radius: 12px;
    padding: 14px 16px;
    font-weight: 600;
    border: 1px solid transparent;
}

.message.success {
    background: #e2f9ee;
    color: #096b40;
    border-color: #b9ecd3;
}

.message.error {
    background: #fdeaea;
    color: #8a1414;
    border-color: #f6c6c6;
}

.grid-layout {
    margin-top: 20px;
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 18px;
}

.login-shell {
    display: grid;
    place-items: center;
    margin-top: 24px;
}

.login-card {
    width: min(100%, 520px);
    background: var(--panel);
    border: 1px solid var(--line);
    border-top: 4px solid var(--navy);
    border-radius: 16px;
    padding: 26px;
    box-shadow: 0 16px 30px rgba(0, 3, 81, 0.08);
}

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

.card {
    grid-column: span 6;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 22px;
    box-shadow: 0 10px 24px rgba(0, 3, 81, 0.06);
}

.actions-card {
    grid-column: span 12;
}

.full-width {
    margin-top: 18px;
}

.section-head h2 {
    margin: 0 0 6px;
    font-size: 20px;
    color: var(--navy);
}

.info-tip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    margin-left: 8px;
    border-radius: 50%;
    background: var(--panel-alt);
    border: 1px solid var(--line);
    color: var(--blue);
    font-size: 12px;
    font-weight: 800;
    cursor: help;
    vertical-align: middle;
}

.info-tip:hover {
    background: var(--blue);
    border-color: var(--blue);
    color: #fff;
}

.section-head p,
.muted {
    color: var(--muted);
}

label {
    display: block;
    margin-top: 14px;
}

label > span {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: var(--text);
}

input,
textarea,
select,
button {
    width: 100%;
    font: inherit;
}

input,
textarea,
select {
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--panel-strong);
    padding: 12px 14px;
    color: var(--text);
    font-size: 15px;
    transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--sky);
    box-shadow: 0 0 0 3px rgba(96, 177, 231, 0.25);
}

textarea {
    resize: vertical;
}

.checkbox {
    display: flex;
    gap: 10px;
    align-items: center;
}

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

.checkbox span {
    margin: 0;
    font-weight: 500;
}

.inline {
    margin-top: 0;
}

.two-col,
.three-col {
    display: grid;
    gap: 12px;
}

.two-col {
    grid-template-columns: repeat(2, 1fr);
}

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

.button-row {
    display: flex;
    gap: 12px;
    margin-top: 18px;
}

.button-row.vertical {
    flex-direction: column;
}

.button-row.compact {
    gap: 8px;
}

button {
    border: none;
    border-radius: 12px;
    padding: 13px 16px;
    background: var(--panel-alt);
    border: 1px solid var(--line);
    color: var(--text);
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.12s ease, background 0.12s ease, box-shadow 0.12s ease;
}

button:hover {
    transform: translateY(-1px);
    background: #eceff3;
    box-shadow: 0 6px 14px rgba(0, 3, 81, 0.08);
}

button.primary {
    background: linear-gradient(135deg, var(--green) 0%, var(--green-dark) 100%);
    color: #fff;
    border-color: transparent;
}

button.primary:hover {
    box-shadow: 0 8px 18px rgba(13, 192, 114, 0.32);
}

button.warning {
    background: #fff0e5;
    color: #b0430a;
    border-color: #ffd8bd;
}

button.warning:hover {
    background: #ffe2cc;
}

button.danger {
    background: #fde6e6;
    color: var(--red);
    border-color: #f6c6c6;
}

button.danger:hover {
    background: #fbd3d3;
}

.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.job-status {
    display: grid;
    gap: 14px;
}

.job-pill {
    width: fit-content;
    padding: 8px 12px;
    border-radius: 999px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 12px;
    background: var(--panel-alt);
    border: 1px solid var(--line);
    color: var(--blue);
}

.job-pill.running {
    background: #eaf4fc;
    border-color: #c9e4f7;
    color: var(--blue);
}

.job-pill.stopping,
.job-pill.stopped {
    background: #fff0e5;
    border-color: #ffd8bd;
    color: #b0430a;
}

.job-pill.completed {
    background: #e2f9ee;
    border-color: #b9ecd3;
    color: #096b40;
}

.job-pill.failed {
    background: #fdeaea;
    border-color: #f6c6c6;
    color: var(--red);
}

.job-message {
    color: var(--text);
    font-weight: 600;
}

.job-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.job-stats div,
.job-stats .stat-link {
    padding: 14px;
    border-radius: 12px;
    background: var(--panel-alt);
    border: 1px solid var(--line);
}

.job-stats .stat-link {
    color: inherit;
    text-decoration: none;
    transition: border-color 0.12s ease;
}

.job-stats .stat-link:hover {
    border-color: var(--blue);
}

.job-stats .stat-link.danger {
    background: #fdf1f1;
    border-color: #f6c6c6;
}

.job-stats strong {
    display: block;
    font-size: 22px;
    color: var(--navy);
}

.status-list {
    margin-top: 14px;
    padding: 14px;
    border-radius: 12px;
    background: var(--panel-alt);
    border: 1px solid var(--line);
}

.status-list p {
    margin: 6px 0;
}

.task-grid {
    display: grid;
    gap: 14px;
    margin-top: 16px;
}

.task-card {
    padding: 16px;
    border-radius: 14px;
    background: var(--panel-alt);
    border: 1px solid var(--line);
}

.task-card h3 {
    margin: 0 0 10px;
    color: var(--navy);
    font-size: 16px;
}

.page-actions {
    margin-top: 18px;
}

.page-actions a,
a.button-link {
    display: inline-block;
    width: auto;
    padding: 12px 14px;
    border-radius: 10px;
    background: var(--panel-alt);
    border: 1px solid var(--line);
    color: var(--text);
    text-decoration: none;
    font-weight: 700;
}

.page-actions a:hover {
    border-color: var(--blue);
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

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

th {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
}

tbody tr:hover {
    background: var(--panel-alt);
}

.log-list {
    display: grid;
    gap: 12px;
}

.log-item {
    border-radius: 12px;
    padding: 14px;
    background: var(--panel-alt);
    border: 1px solid var(--line);
    border-left: 3px solid var(--sky);
}

.log-item.error {
    background: #fdf1f1;
    border-color: #f6c6c6;
    border-left-color: var(--red);
}

.log-meta {
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 6px;
}

.log-message {
    font-weight: 600;
}

pre {
    margin: 10px 0 0;
    white-space: pre-wrap;
    word-break: break-word;
    background: rgba(0, 3, 81, 0.04);
    padding: 10px;
    border-radius: 8px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 920px) {
    .card,
    .actions-card {
        grid-column: span 12;
    }

    .two-col,
    .three-col {
        grid-template-columns: 1fr;
    }

    .hero h1 {
        font-size: 28px;
    }

    .hero-bar,
    .logout-form {
        flex-direction: column;
        align-items: flex-start;
    }

    .job-stats {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 640px) {
    body {
        background: var(--bg);
    }

    .shell {
        padding: 14px 10px 32px;
    }

    .hero {
        border-radius: 16px;
        padding: 22px 18px;
    }

    .eyebrow {
        font-size: 11px;
        letter-spacing: 0.14em;
    }

    .hero h1 {
        font-size: 24px;
        line-height: 1.15;
    }

    .intro {
        font-size: 15px;
    }

    .session-chip,
    .ghost-button {
        width: 100%;
        text-align: center;
    }

    .grid-layout {
        gap: 12px;
        margin-top: 14px;
    }

    .card,
    .login-card {
        border-radius: 14px;
        padding: 16px;
    }

    .section-head h2 {
        font-size: 19px;
        line-height: 1.2;
    }

    .section-head p,
    .muted,
    .status-list p,
    .log-message {
        font-size: 14px;
        line-height: 1.45;
    }

    .info-tip {
        width: 18px;
        height: 18px;
        margin-left: 5px;
        font-size: 11px;
    }

    label {
        margin-top: 12px;
    }

    input,
    textarea,
    select,
    button {
        min-height: 46px;
    }

    textarea {
        min-height: 120px;
    }

    .checkbox {
        align-items: flex-start;
    }

    .checkbox input {
        flex: 0 0 20px;
        width: 20px;
        height: 20px;
        margin-top: 2px;
    }

    .button-row {
        gap: 10px;
    }

    button {
        padding: 13px 14px;
        border-radius: 10px;
    }

    .task-card,
    .status-list,
    .log-item {
        border-radius: 12px;
        padding: 13px;
    }

    .task-card h3 {
        font-size: 17px;
        line-height: 1.2;
    }

    .job-stats {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .job-stats strong {
        font-size: 22px;
    }

    .table-wrap {
        margin: 0 -4px;
        padding-bottom: 8px;
    }

    .table-wrap::after {
        content: "Veeg horizontaal om meer kolommen te zien";
        display: block;
        margin-top: 8px;
        color: var(--muted);
        font-size: 12px;
    }

    th,
    td {
        padding: 10px 8px;
        font-size: 13px;
    }

    .loading-card {
        width: min(94vw, 420px);
        padding: 24px 18px;
        border-radius: 18px;
    }
}
