* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Inter, Arial, sans-serif;
    background: #f3f5f7;
    color: #1f2937;
}

a {
    color: #2563eb;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.topbar {
    padding: 22px 32px;
    background: #111827;
    color: white;
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: center;
}

.topbar h1 {
    margin: 0 0 6px 0;
    font-size: 24px;
}

.topbar p {
    margin: 0;
    color: #cbd5e1;
}

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

.logout-link {
    color: #cbd5e1;
}

.container {
    padding: 28px 32px;
}

.panel {
    background: white;
    border-radius: 18px;
    box-shadow: 0 12px 35px rgba(15, 23, 42, 0.08);
    padding: 22px;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
    margin-bottom: 18px;
}

.panel-header h2 {
    margin: 0;
}

.muted {
    color: #64748b;
}

.empty {
    padding: 36px;
    text-align: center;
    color: #64748b;
    border: 1px dashed #cbd5e1;
    border-radius: 14px;
}

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

.job-card {
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 16px;
    background: #fff;
}

.job-card.status-running {
    border-color: #f59e0b;
}

.job-card.status-done {
    border-color: #22c55e;
}

.job-card.status-error {
    border-color: #ef4444;
}

.job-main {
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

.job-card h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
}

.meta {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    font-size: 13px;
    color: #64748b;
    margin-bottom: 12px;
}

.models-line {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.model-chip {
    display: inline-block;
    padding: 5px 9px;
    border-radius: 999px;
    background: #eef2ff;
    color: #3730a3;
    font-size: 12px;
}

.status-box {
    min-width: 160px;
    text-align: right;
}

.badge {
    display: inline-block;
    padding: 7px 10px;
    border-radius: 999px;
    background: #e5e7eb;
    font-size: 13px;
    font-weight: 600;
}

.badge-ok {
    background: #dcfce7;
    color: #166534;
}

.badge-run {
    background: #fef3c7;
    color: #92400e;
}

.badge-wait {
    background: #e0f2fe;
    color: #075985;
}

.badge-error {
    background: #fee2e2;
    color: #991b1b;
}

.small {
    display: block;
    margin-top: 8px;
    color: #64748b;
    font-size: 12px;
}

.downloads {
    margin-top: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.downloads a {
    padding: 8px 10px;
    border-radius: 10px;
    background: #f1f5f9;
    color: #1e40af;
    font-size: 13px;
}

button {
    border: 0;
    border-radius: 12px;
    padding: 10px 15px;
    background: #2563eb;
    color: white;
    cursor: pointer;
    font-weight: 600;
}

button:hover {
    background: #1d4ed8;
}

button:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}

button.secondary {
    background: #e5e7eb;
    color: #111827;
}

button.secondary:hover {
    background: #d1d5db;
}

.icon-button {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 999px;
    background: #f1f5f9;
    color: #111827;
    font-size: 24px;
    line-height: 1;
}

.icon-button:hover {
    background: #e5e7eb;
}

.alert {
    padding: 12px 14px;
    border-radius: 12px;
    margin: 12px 0;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
}

.modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-backdrop.show {
    display: flex;
}

.modal {
    width: min(720px, 100%);
    max-height: 90vh;
    overflow: auto;
    background: white;
    border-radius: 20px;
    padding: 22px;
    box-shadow: 0 20px 70px rgba(0, 0, 0, 0.25);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

.modal-header h2 {
    margin: 0;
}

.upload-form {
    display: grid;
    gap: 16px;
}

label {
    display: grid;
    gap: 7px;
    font-weight: 600;
}

input[type="file"],
input[type="password"],
textarea {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    padding: 10px 12px;
    font: inherit;
    background: white;
}

textarea {
    resize: vertical;
}

.label-title {
    display: block;
    margin-bottom: 8px;
}

.models-grid {
    display: grid;
    gap: 8px;
}

.checkbox-card {
    display: flex;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 10px;
    border: 1px solid #e5e7eb;
    padding: 10px 12px;
    border-radius: 12px;
    font-weight: 500;
}

.checkbox-card input {
    width: 18px;
    height: 18px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

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

.login-card {
    width: min(420px, 100%);
    background: white;
    padding: 28px;
    border-radius: 22px;
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.12);
}

.login-card h1 {
    margin: 0 0 8px 0;
}

.login-form {
    display: grid;
    gap: 16px;
    margin-top: 20px;
}
