:root {
    --bg: #070a13;
    --text: #eef2ff;
    --muted: #9aa6c8;
    --panel: rgba(12, 17, 34, .76);
    --panel-2: rgba(255, 255, 255, .06);
    --border: rgba(255, 255, 255, .13);
    --primary: #7567ff;
    --primary-2: #21d4fd;
    --danger: #ff4d6d;
    --success: #4ade80;
    --warning: #ffbd59;
    --shadow: 0 24px 90px rgba(0, 0, 0, .42);
    --radius: 24px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(117, 103, 255, .34), transparent 34%),
        radial-gradient(circle at top right, rgba(33, 212, 253, .14), transparent 30%),
        radial-gradient(circle at bottom right, rgba(117, 103, 255, .24), transparent 36%),
        var(--bg);
}

a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }

.page {
    width: min(1380px, calc(100% - 32px));
    margin: 0 auto;
    padding: 28px 0 60px;
}

.page.narrow { width: min(1050px, calc(100% - 32px)); }

.login-body {
    display: grid;
    place-items: center;
    padding: 24px;
}

.login-card {
    width: min(480px, 100%);
    border: 1px solid var(--border);
    border-radius: 30px;
    padding: 32px;
    background: var(--panel);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.logo {
    width: 56px;
    height: 56px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    font-weight: 950;
    background: linear-gradient(135deg, var(--primary), #955cff);
    box-shadow: 0 16px 40px rgba(117, 103, 255, .34);
}

.login-card h1,
.brand h1 {
    margin: 18px 0 8px;
    font-size: clamp(28px, 4vw, 44px);
    line-height: 1;
}

.login-card p,
.brand p,
.section-head p,
.info-panel p {
    color: var(--muted);
    line-height: 1.55;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 26px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 16px;
}

.brand h1 { margin: 0 0 6px; }
.brand p { margin: 0; }

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

.panel {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
    padding: 22px;
}

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(300px, .6fr);
    gap: 18px;
    margin-bottom: 18px;
}

.eyebrow {
    display: inline-block;
    color: #c9c6ff;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .16em;
    font-weight: 900;
    margin-bottom: 8px;
}

.section-head h2 {
    margin: 0 0 8px;
    font-size: 26px;
}

.section-head p { margin: 0 0 18px; }
.section-head.compact { margin-bottom: 14px; }

.form-grid {
    display: grid;
    gap: 15px;
}

label {
    display: grid;
    gap: 8px;
    color: #cfd6f5;
    font-weight: 750;
}

small {
    color: var(--muted);
    font-weight: 500;
}

input,
textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 16px;
    color: var(--text);
    background: rgba(255, 255, 255, .08);
    padding: 13px 14px;
    outline: none;
}

input[type="file"] {
    padding: 14px;
}

textarea { resize: vertical; min-height: 150px; }

input:focus,
textarea:focus {
    border-color: rgba(117, 103, 255, .75);
    box-shadow: 0 0 0 4px rgba(117, 103, 255, .16);
}

.btn {
    border: 0;
    cursor: pointer;
    border-radius: 15px;
    padding: 12px 16px;
    color: white;
    font-weight: 900;
    background: linear-gradient(135deg, var(--primary), #8c4fff);
    box-shadow: 0 14px 40px rgba(117, 103, 255, .24);
    transition: transform .15s ease, opacity .15s ease;
    text-align: center;
}

.btn:hover { transform: translateY(-1px); }
.btn.secondary { background: rgba(255,255,255,.08); border: 1px solid var(--border); box-shadow: none; }
.btn.ghost { background: rgba(255,255,255,.04); border: 1px solid var(--border); box-shadow: none; color: var(--muted); }

.tips {
    display: grid;
    gap: 12px;
    margin-top: 18px;
}

.tips div {
    padding: 14px;
    border-radius: 18px;
    background: rgba(255,255,255,.06);
    border: 1px solid var(--border);
}

.tips strong,
.tips span {
    display: block;
}

.tips span { color: var(--muted); margin-top: 5px; line-height: 1.45; }

.jobs-list { display: grid; gap: 10px; }

.job-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 15px;
    border-radius: 18px;
    background: var(--panel-2);
    border: 1px solid var(--border);
}

.job-card strong,
.job-card span { display: block; }
.job-card span { color: var(--muted); margin-top: 5px; }

.status {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-width: 80px;
    padding: 7px 11px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 950;
    text-transform: uppercase;
    letter-spacing: .04em;
    background: rgba(255,255,255,.09);
    color: var(--muted) !important;
}
.status.queued { color: #ffe1ad !important; background: rgba(255,189,89,.13); }
.status.running { color: #b8f4ff !important; background: rgba(33,212,253,.13); }
.status.done { color: #b8ffd0 !important; background: rgba(74,222,128,.13); }
.status.failed { color: #ffc4cf !important; background: rgba(255,77,109,.13); }

.empty {
    padding: 22px;
    text-align: center;
    border-radius: 18px;
    border: 1px dashed var(--border);
    color: var(--muted);
}

.alert {
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 14px 16px;
    margin: 14px 0;
    line-height: 1.5;
}
.alert.error { border-color: rgba(255,77,109,.35); color: #ffc4cf; background: rgba(255,77,109,.08); }
.alert.success { border-color: rgba(74,222,128,.35); color: #b8ffd0; background: rgba(74,222,128,.08); }

.job-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.job-top h2 { margin: 0; }

.loader-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 15px;
    border-radius: 18px;
    background: rgba(255,255,255,.06);
    border: 1px solid var(--border);
    margin: 16px 0;
}

.loader {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 4px solid rgba(255,255,255,.14);
    border-top-color: var(--primary);
    animation: spin 1s linear infinite;
}

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

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

.details-grid div {
    padding: 13px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: rgba(255,255,255,.06);
}

.details-grid strong,
.details-grid span { display: block; }
.details-grid span { color: var(--muted); margin-top: 5px; overflow-wrap: anywhere; }

.prompt-box {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: rgba(0,0,0,.18);
    color: #dce3ff;
    padding: 16px;
}

.change-list {
    display: grid;
    gap: 7px;
    padding-left: 18px;
    color: #dce3ff;
}

@media (max-width: 940px) {
    .hero-grid { grid-template-columns: 1fr; }
    .details-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 650px) {
    .topbar,
    .brand,
    .top-actions,
    .job-top {
        align-items: stretch;
        flex-direction: column;
    }
    .details-grid { grid-template-columns: 1fr; }
    .job-card { align-items: flex-start; flex-direction: column; }
}
