* {
    box-sizing: border-box;
}

:root {
    --bg: #f4f6f8;
    --card: #ffffff;
    --ink: #17202a;
    --muted: #667085;
    --line: #e4e7ec;
    --orange: #f97316;
    --orange-dark: #c2410c;
    --danger: #b42318;
    --danger-bg: #fef3f2;
    --warning: #b54708;
    --warning-bg: #fffaeb;
    --pass: #067647;
    --pass-bg: #ecfdf3;
    --shadow: 0 18px 50px rgba(16, 24, 40, .08);
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
    font: inherit;
}

code {
    display: block;
    margin: 5px 0;
    padding: 7px 9px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafc;
    overflow-wrap: anywhere;
}

.login-shell {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 24px;
}

.login-card {
    width: min(460px, 100%);
    padding: 30px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--card);
    box-shadow: var(--shadow);
}

.brand-mark {
    display: grid;
    width: 54px;
    height: 54px;
    margin-bottom: 18px;
    place-items: center;
    border-radius: 14px;
    background: var(--orange);
    color: white;
    font-weight: 900;
}

.eyebrow {
    color: var(--orange-dark);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

h1,
h2,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 8px;
}

h2 {
    margin: 4px 0 7px;
    font-size: 18px;
}

p {
    color: var(--muted);
    line-height: 1.55;
}

label {
    display: block;
    margin: 14px 0;
}

label > span {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 700;
}

input[type="text"],
input[type="password"],
input:not([type]),
input[type="file"] {
    width: 100%;
    min-height: 42px;
    padding: 9px 11px;
    border: 1px solid #d0d5dd;
    border-radius: 9px;
    background: #fff;
}

input:focus {
    border-color: var(--orange);
    outline: 3px solid rgba(249, 115, 22, .12);
}

.btn {
    display: inline-flex;
    min-height: 38px;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 13px;
    border: 1px solid transparent;
    border-radius: 9px;
    cursor: pointer;
    font-weight: 800;
    text-decoration: none;
}

.btn:disabled {
    opacity: .5;
    cursor: not-allowed;
}

.btn.primary {
    background: var(--orange);
    color: #fff;
}

.btn.secondary {
    border-color: var(--line);
    background: #fff;
    color: var(--ink);
}

.btn.warning {
    border-color: #fedf89;
    background: var(--warning-bg);
    color: var(--warning);
}

.btn.danger {
    background: var(--danger);
    color: #fff;
}

.btn.tiny {
    min-height: 30px;
    padding: 5px 8px;
    font-size: 11px;
}

.security-note,
.muted {
    margin-top: 14px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
}

.alert {
    margin: 12px 0;
    padding: 11px 13px;
    border-radius: 9px;
    line-height: 1.45;
}

.alert.danger {
    border: 1px solid #fecdca;
    background: var(--danger-bg);
    color: var(--danger);
}

.alert.warning {
    border: 1px solid #fedf89;
    background: var(--warning-bg);
    color: var(--warning);
}

.topbar {
    display: flex;
    position: sticky;
    z-index: 10;
    top: 0;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 24px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(8px);
}

.topbar h1 {
    margin: 2px 0 0;
    font-size: 22px;
}

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

.user-chip {
    padding: 7px 10px;
    border-radius: 999px;
    background: #fff7ed;
    color: var(--orange-dark);
    font-size: 12px;
    font-weight: 800;
}

.app-shell {
    width: min(1380px, calc(100% - 32px));
    margin: 22px auto 50px;
}

.warning-banner {
    margin-bottom: 16px;
    padding: 12px 14px;
    border: 1px solid #fecdca;
    border-radius: 11px;
    background: var(--danger-bg);
    color: var(--danger);
}

.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
    gap: 14px;
    margin-bottom: 14px;
}

.panel {
    min-width: 0;
    margin-bottom: 14px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--card);
    box-shadow: 0 5px 24px rgba(16, 24, 40, .04);
}

.section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 12px;
}

.section-heading p {
    margin-bottom: 0;
}

.status-line {
    margin-top: 10px;
    line-height: 1.5;
}

.badge {
    display: inline-block;
    padding: 4px 7px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 900;
}

.badge.pass {
    background: var(--pass-bg);
    color: var(--pass);
}

.badge.warn {
    background: var(--warning-bg);
    color: var(--warning);
}

.badge.fail {
    background: var(--danger-bg);
    color: var(--danger);
}

.mini-list {
    margin-top: 10px;
}

.mini-list > div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 0;
    border-top: 1px solid #f0f2f5;
    font-size: 12px;
}

.mini-list span {
    color: var(--muted);
}

.table-scroll {
    overflow-x: auto;
}

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

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

th {
    color: var(--muted);
    font-size: 10px;
    letter-spacing: .04em;
    text-transform: uppercase;
}

td small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
}

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

.empty {
    padding: 25px;
    color: var(--muted);
    text-align: center;
}

.modal-backdrop {
    display: grid;
    position: fixed;
    z-index: 100;
    inset: 0;
    place-items: center;
    padding: 20px;
    background: rgba(16, 24, 40, .62);
}

.modal-backdrop[hidden] {
    display: none !important;
}

.modal-card {
    display: flex;
    width: min(720px, 100%);
    max-height: 92vh;
    flex-direction: column;
    overflow: hidden;
    border-radius: 15px;
    background: #fff;
    box-shadow: var(--shadow);
}

.modal-header,
.modal-footer {
    flex: 0 0 auto;
    padding: 15px 17px;
    border-bottom: 1px solid var(--line);
}

.modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 9px;
    border-top: 1px solid var(--line);
    border-bottom: 0;
}

.modal-body {
    overflow-y: auto;
    padding: 16px 17px;
}

.close-button {
    border: 0;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-size: 25px;
}

.preflight-box {
    margin: 12px 0;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #f8fafc;
}

.preflight-box > div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 5px 0;
    border-bottom: 1px solid #e9edf2;
    font-size: 12px;
}

.preflight-box > div:last-child {
    border-bottom: 0;
}

.danger-text {
    color: var(--danger);
}

.job-panel {
    border-color: #fdba74;
}

.progress-track {
    height: 12px;
    overflow: hidden;
    border-radius: 999px;
    background: #e9edf2;
}

.progress-track i {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: var(--orange);
    transition: width .3s ease;
}

.job-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 8px;
    margin: 14px 0;
}

.job-stats > div {
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #f8fafc;
}

.job-stats span,
.job-stats strong {
    display: block;
}

.job-stats span {
    color: var(--muted);
    font-size: 10px;
    text-transform: uppercase;
}

.job-stats strong {
    margin-top: 3px;
    font-size: 14px;
}

.job-detail {
    padding: 10px 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
}

@media (max-width: 700px) {
    .topbar {
        align-items: flex-start;
        padding: 13px;
    }

    .topbar-actions {
        align-items: flex-end;
        flex-direction: column;
    }

    .app-shell {
        width: min(100% - 18px, 1380px);
        margin-top: 10px;
    }

    .panel {
        padding: 13px;
    }

    .section-heading {
        flex-direction: column;
    }

    .modal-backdrop {
        padding: 0;
    }

    .modal-card {
        width: 100%;
        height: 100dvh;
        max-height: 100dvh;
        border-radius: 0;
    }
}
