:root {
    --sora-primary: #4f46e5;
    --sora-primary-dark: #3730a3;
    --sora-accent: #22d3ee;
    --sora-surface: #ffffff;
    --sora-muted: #6b7280;
    --sora-border: rgba(15, 23, 42, 0.08);
    --sora-sidebar-bg: linear-gradient(180deg, #111827 0%, #1f2937 100%);
    --sora-sidebar-highlight: rgba(79, 70, 229, 0.35);
    --sora-table-bg: #f8fafc;
    --sora-radius-lg: 24px;
    --sora-radius-md: 16px;
    --sora-shadow-lg: 0 24px 45px rgba(15, 23, 42, 0.12);
    --sora-shadow-md: 0 18px 36px rgba(15, 23, 42, 0.1);
    --sora-shadow-sm: 0 8px 20px rgba(15, 23, 42, 0.08);
}

html, body {
    background-color: #eef2ff;
    color: #0f172a;
    font-family: "Segoe UI", "Inter", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
    height: 100%;
}

a {
    color: var(--sora-primary);
}

a:hover {
    color: var(--sora-primary-dark);
}

.app-body {
    margin: 0;
}

.app-shell {
    display: flex;
    min-height: 100vh;
    background: radial-gradient(circle at top left, rgba(79, 70, 229, 0.15), transparent 35%),
                radial-gradient(circle at bottom right, rgba(34, 211, 238, 0.12), transparent 40%);
}

.app-sidebar {
    width: 265px;
    background: var(--sora-sidebar-bg);
    color: #e5e7eb;
    display: flex;
    flex-direction: column;
    padding: 32px 28px;
    gap: 32px;
    position: sticky;
    top: 0;
    height: 100vh;
}

.app-sidebar .brand {
    font-size: 1.3rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.app-sidebar .brand span {
    padding: 8px 12px;
    background: rgba(79, 70, 229, 0.18);
    border-radius: 12px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.app-sidebar nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.app-sidebar nav a {
    color: inherit;
    text-decoration: none;
    padding: 12px 14px;
    border-radius: 12px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.2s ease, transform 0.2s ease;
}

.app-sidebar nav a:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateX(4px);
}

.app-sidebar nav a.active {
    background: var(--sora-sidebar-highlight);
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.15);
}

.app-sidebar .sidebar-footer {
    margin-top: auto;
    border-top: 1px solid rgba(148, 163, 184, 0.15);
    padding-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-user .avatar {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: rgba(79, 70, 229, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: #fff;
}

.sidebar-user .dots {
    font-size: 0.85rem;
    color: rgba(229, 231, 235, 0.7);
}

.app-main {
    flex: 1;
    padding: 38px 56px;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.app-hero {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.92), rgba(34, 211, 238, 0.85));
    color: #fff;
    padding: 42px 48px;
    border-radius: var(--sora-radius-lg);
    box-shadow: var(--sora-shadow-lg);
    position: relative;
    overflow: hidden;
}

.app-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top right, rgba(255, 255, 255, 0.3), transparent 45%);
    opacity: 0.8;
    pointer-events: none;
}

.app-hero-content {
    position: relative;
    z-index: 1;
}

.app-hero h1 {
    font-weight: 600;
    font-size: 2rem;
}

.app-hero p {
    opacity: 0.85;
    max-width: 620px;
}

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

.hero-actions .btn-outline-light {
    border-radius: 999px;
    padding-inline: 22px;
}

.grid {
    display: grid;
    gap: 24px;
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.span-2 {
    grid-column: span 2;
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.stat-card {
    background: var(--sora-surface);
    border-radius: var(--sora-radius-md);
    padding: 24px;
    box-shadow: var(--sora-shadow-md);
    border: 1px solid var(--sora-border);
    position: relative;
    overflow: hidden;
}

.stat-card h6 {
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.75rem;
    margin-bottom: 6px;
    color: var(--sora-muted);
}

.stat-card strong {
    font-size: 1.8rem;
    font-weight: 600;
}

.card {
    border-radius: var(--sora-radius-md);
    border: 1px solid rgba(15, 23, 42, 0.05);
    box-shadow: var(--sora-shadow-sm);
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.05);
    background: var(--sora-surface);
}

.card-body {
    padding: 24px;
}

.section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.form-card {
    background: var(--sora-surface);
    border-radius: var(--sora-radius-md);
    padding: 24px;
    box-shadow: var(--sora-shadow-sm);
}

.form-card h5 {
    font-weight: 600;
}

.toast-stack {
    position: fixed;
    top: 30px;
    right: 30px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 1080;
}

.toast.sora-toast {
    border-radius: 16px;
    border: none;
    padding: 16px 18px;
    background: rgba(15, 23, 42, 0.9);
    color: #f8fafc;
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.2);
}

.toast.sora-toast .btn-close {
    filter: invert(1) grayscale(1);
}

.job-collection {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.job-card {
    padding: 22px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.92));
    border-radius: var(--sora-radius-md);
    border: 1px solid rgba(148, 163, 184, 0.15);
    box-shadow: var(--sora-shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 18px;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.job-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--sora-shadow-md);
}

.job-card.job-focus {
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.35), var(--sora-shadow-lg);
    animation: jobFocusPulse 1s ease-out;
}

@keyframes jobFocusPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.55), var(--sora-shadow-lg);
    }
    70% {
        box-shadow: 0 0 0 8px rgba(79, 70, 229, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(79, 70, 229, 0);
    }
}

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

.job-card-id {
    font-weight: 600;
    font-size: 0.95rem;
    color: #0f172a;
    word-break: break-all;
}

.status-tag {
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 999px;
    letter-spacing: 0.1em;
}

.status-pending {
    background: rgba(250, 204, 21, 0.15);
    color: #92400e;
}

.status-active {
    background: rgba(14, 165, 233, 0.18);
    color: #0c4a6e;
}

.status-success {
    background: rgba(34, 197, 94, 0.18);
    color: #166534;
}

.status-failed {
    background: rgba(248, 113, 113, 0.16);
    color: #991b1b;
}

.job-card-body {
    display: grid;
    gap: 12px;
}

.job-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    font-size: 0.85rem;
    color: var(--sora-muted);
}

.job-card-meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.job-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.job-card-actions form,
.job-card-actions a {
    flex: 1 1 auto;
}

.job-card-actions .btn {
    width: 100%;
}

.job-card-prompt {
    font-size: 0.9rem;
    line-height: 1.5;
    color: #1f2937;
    max-height: 8.5rem;
    overflow-y: auto;
}

.job-card-assets {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.job-card-assets .btn {
    border-radius: 12px;
}

.progress {
    background-color: rgba(148, 163, 184, 0.25);
    border-radius: 999px;
    overflow: hidden;
}

.progress-bar {
    background: linear-gradient(90deg, var(--sora-primary), #8b5cf6);
}

.table-modern {
    background: var(--sora-surface);
    border-radius: var(--sora-radius-md);
    overflow: hidden;
    box-shadow: var(--sora-shadow-sm);
}

.table-modern thead th {
    background: var(--sora-table-bg);
    font-size: 0.78rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--sora-muted);
    border-bottom: 1px solid rgba(148, 163, 184, 0.4);
}

.api-response {
    background: #0f172a;
    color: #e2e8f0;
    padding: 20px;
    border-radius: var(--sora-radius-md);
    font-size: 0.85rem;
    overflow-x: auto;
}

.badge-status {
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 0.75rem;
    text-transform: capitalize;
}

.floating-actions {
    position: fixed;
    bottom: 24px;
    right: 28px;
    display: flex;
    gap: 14px;
    z-index: 1040;
}

.floating-actions .btn {
    border-radius: 999px;
    box-shadow: 0 18px 34px rgba(79, 70, 229, 0.25);
}

.form-section-title {
    font-size: 0.9rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--sora-muted);
    margin-bottom: 6px;
}

.input-with-hint .form-text {
    margin-top: 6px;
    font-size: 0.8rem;
    color: var(--sora-muted);
}

.avatar-fallback {
    background: rgba(79, 70, 229, 0.15);
    color: var(--sora-primary);
    border-radius: 10px;
    padding: 6px 10px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.admin-header h1 {
    margin: 0;
}

.sticky-toolbar {
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    z-index: 10;
    border-bottom: 1px solid rgba(15, 23, 42, 0.05);
    padding: 16px 24px;
    border-radius: var(--sora-radius-md) var(--sora-radius-md) 0 0;
}

.auth-body {
    min-height: 100vh;
    background: radial-gradient(circle at top, rgba(79, 70, 229, 0.22), transparent 55%), radial-gradient(circle at bottom, rgba(34, 211, 238, 0.18), transparent 60%), #eef2ff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 16px;
}

.auth-shell {
    width: 100%;
    max-width: 420px;
}

.auth-card {
    background: linear-gradient(165deg, rgba(255, 255, 255, 0.92), rgba(248, 250, 252, 0.88));
    border-radius: var(--sora-radius-lg);
    box-shadow: var(--sora-shadow-lg);
    border: 1px solid rgba(148, 163, 184, 0.18);
    padding: 40px 36px;
}

.auth-card h2 {
    font-weight: 600;
}

.auth-card .form-control {
    border-radius: 12px;
    padding: 12px;
}

.auth-footer {
    font-size: 0.8rem;
    color: var(--sora-muted);
}

.auth-logo {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    background: rgba(79, 70, 229, 0.35);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #1d1b7e;
    font-weight: 700;
    margin-bottom: 16px;
}

@media (max-width: 992px) {
    .app-shell {
        flex-direction: column;
    }

    .app-sidebar {
        width: 100%;
        height: auto;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding: 20px 24px;
        position: static;
        border-radius: 0 0 var(--sora-radius-lg) var(--sora-radius-lg);
    }

    .app-sidebar nav {
        flex-direction: row;
        gap: 10px;
    }

    .app-sidebar nav a {
        padding-inline: 18px;
    }

    .app-sidebar .sidebar-footer {
        border: none;
        padding-top: 0;
        margin-top: 0;
    }

    .sidebar-user {
        display: none;
    }

    .app-main {
        padding: 28px 22px 48px;
    }

    .app-hero {
        padding: 32px;
    }

    .job-card-actions form,
    .job-card-actions a {
        flex: 1 1 45%;
    }
}

@media (max-width: 576px) {
    .app-hero h1 {
        font-size: 1.6rem;
    }

    .app-hero {
        padding: 26px;
    }

    .job-card {
        padding: 18px;
    }

    .grid-3 {
        grid-template-columns: 1fr;
    }

    .app-sidebar nav {
        flex-wrap: wrap;
        justify-content: center;
    }
}
    .span-2 {
        grid-column: span 1;
    }
