@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;700&family=IBM+Plex+Mono:wght@400;500&display=swap");

:root {
    --bg: #f7f2e7;
    --bg-soft: #edf3f5;
    --panel: #ffffff;
    --line: #d4dde3;
    --ink: #16232f;
    --muted: #5b6f81;
    --brand: #0f766e;
    --brand-dark: #0b4f57;
    --accent: #d97706;
    --ok: #157f3b;
    --warn: #b45309;
    --err: #b42318;
    --radius: 16px;
    --shadow: 0 14px 34px rgba(12, 30, 49, 0.09);
    --shadow-soft: 0 8px 20px rgba(12, 30, 49, 0.06);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

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

body {
    margin: 0;
    color: var(--ink);
    font-family: "Space Grotesk", "Avenir Next", "Trebuchet MS", sans-serif;
    line-height: 1.5;
    background:
        radial-gradient(900px 420px at 0% -10%, #f2e4c6 0%, transparent 68%),
        radial-gradient(820px 440px at 100% 0%, #dbeef1 0%, transparent 62%),
        linear-gradient(160deg, var(--bg) 0%, var(--bg-soft) 100%);
    position: relative;
    overflow-x: hidden;
}

body::before,
body::after {
    content: "";
    position: fixed;
    border-radius: 999px;
    z-index: 0;
    pointer-events: none;
    filter: blur(40px);
    opacity: 0.5;
}

body::before {
    width: 340px;
    height: 340px;
    right: -120px;
    top: 84px;
    background: #f5d6a6;
}

body::after {
    width: 320px;
    height: 320px;
    left: -120px;
    bottom: 52px;
    background: #b5dfe3;
}

.topbar,
main.container {
    position: relative;
    z-index: 1;
}

.container {
    width: min(1320px, 95vw);
    margin: 0 auto;
}

.topbar {
    margin: 18px auto 22px;
    width: min(1320px, 95vw);
    border: 1px solid rgba(22, 35, 47, 0.1);
    border-radius: calc(var(--radius) + 2px);
    box-shadow: var(--shadow-soft);
    background: linear-gradient(130deg, rgba(255, 255, 255, 0.9), rgba(240, 248, 250, 0.92));
    backdrop-filter: blur(8px);
}

.topbar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
}

.brand {
    color: var(--brand-dark);
    text-decoration: none;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.25px;
}

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

.nav a {
    text-decoration: none;
    color: #164462;
    border: 1px solid rgba(22, 68, 98, 0.16);
    background: rgba(255, 255, 255, 0.84);
    border-radius: 999px;
    padding: 7px 12px;
    font-size: 13px;
    transition: all 0.2s ease;
}

.nav a:hover {
    transform: translateY(-1px);
    border-color: rgba(22, 68, 98, 0.32);
    box-shadow: 0 8px 14px rgba(22, 68, 98, 0.12);
}

h1,
h2,
h3 {
    margin: 0 0 10px;
    color: #112230;
    letter-spacing: -0.15px;
}

h1 {
    font-size: clamp(24px, 2.8vw, 32px);
}

h2 {
    font-size: clamp(18px, 2.2vw, 24px);
}

h1 small {
    font-size: 0.52em;
    color: var(--muted);
    font-weight: 500;
}

a {
    color: #0f5580;
}

a:hover {
    color: #0a3f60;
}

.panel {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.9));
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
    overflow-x: auto;
    box-shadow: var(--shadow);
    animation: panel-rise 0.45s ease both;
}

.panel.narrow {
    max-width: 440px;
    margin-inline: auto;
}

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

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
}

.stat {
    border: 1px solid var(--line);
    border-left: 5px solid var(--brand);
    border-radius: 12px;
    padding: 12px 14px;
    background: linear-gradient(180deg, #ffffff, #f9fcfd);
}

.stat span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat strong {
    font-size: 25px;
    font-weight: 700;
}

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

label {
    color: #2b4458;
    font-size: 14px;
    display: grid;
    gap: 6px;
}

.filters,
.queue-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
    align-items: center;
}

.filters input,
.filters select,
.queue-controls input,
.queue-controls select {
    min-width: 170px;
}

input,
select,
button {
    border: 1px solid #c3d2db;
    border-radius: 10px;
    padding: 9px 11px;
    font-size: 14px;
    font-family: inherit;
    background: #fff;
    color: var(--ink);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.12s ease;
}

input:focus,
select:focus {
    outline: none;
    border-color: #5aa8b2;
    box-shadow: 0 0 0 3px rgba(90, 168, 178, 0.2);
}

button:active {
    transform: translateY(1px);
}

input[type="checkbox"] {
    accent-color: var(--brand);
}

.btn {
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 14px;
    border-radius: 10px;
    text-decoration: none;
    color: #fff;
    background: linear-gradient(140deg, var(--brand) 0%, var(--brand-dark) 100%);
    box-shadow: 0 8px 16px rgba(15, 118, 110, 0.22);
    transition: transform 0.18s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 18px rgba(15, 118, 110, 0.28);
    filter: brightness(1.03);
}

.btn-secondary {
    background: linear-gradient(140deg, #35566f 0%, #2c4559 100%);
    box-shadow: 0 8px 16px rgba(44, 69, 89, 0.2);
}

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

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 840px;
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}

thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: linear-gradient(180deg, #f4f8fa, #eaf2f5);
    color: #2e4a5f;
    font-size: 12px;
    letter-spacing: 0.35px;
    text-transform: uppercase;
}

th,
td {
    border-bottom: 1px solid #e1e8ed;
    text-align: left;
    padding: 10px 10px;
    vertical-align: top;
    font-size: 13px;
}

tbody tr:nth-child(even) {
    background: #fbfdfe;
}

tbody tr:hover {
    background: #f1f8fb;
}

tbody tr:last-child td {
    border-bottom: none;
}

code {
    font-family: "IBM Plex Mono", "Cascadia Code", monospace;
    font-size: 12px;
    background: #f2f7fa;
    border: 1px solid #deebf1;
    border-radius: 7px;
    padding: 2px 6px;
    color: #294052;
}

.status {
    display: inline-block;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 11px;
    border: 1px solid transparent;
    background: #e2e8f0;
    color: #1e293b;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    font-weight: 600;
}

.status-queued,
.status-retry {
    background: #fff7ed;
    border-color: #fed7aa;
    color: var(--warn);
}

.status-dispatching,
.status-processing,
.status-downloading,
.status-uploading {
    background: #e0f2fe;
    border-color: #bae6fd;
    color: #0369a1;
}

.status-completed {
    background: #dcfce7;
    border-color: #bbf7d0;
    color: #166534;
}

.status-failed {
    background: #fee2e2;
    border-color: #fecaca;
    color: #991b1b;
}

.alert {
    padding: 11px 13px;
    border-radius: 10px;
    margin-bottom: 14px;
    border: 1px solid transparent;
    box-shadow: var(--shadow-soft);
}

.alert-success {
    background: #dcfce7;
    color: #14532d;
    border-color: #bbf7d0;
}

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

.muted {
    color: var(--muted);
}

pre {
    white-space: pre-wrap;
    background: linear-gradient(180deg, #152838, #101c2a);
    color: #dce8f3;
    border-radius: 12px;
    padding: 13px;
    font-size: 12px;
    line-height: 1.55;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

@keyframes panel-rise {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 1024px) {
    .container,
    .topbar {
        width: 96vw;
    }

    .topbar-inner {
        padding: 12px 14px;
    }

    .panel {
        padding: 16px;
    }

    .filters input,
    .filters select,
    .queue-controls input,
    .queue-controls select {
        min-width: 150px;
    }

    table {
        min-width: 700px;
    }
}

@media (max-width: 760px) {
    .topbar-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .brand {
        font-size: 17px;
    }

    .nav {
        width: 100%;
    }

    .nav a {
        flex: 1 1 auto;
        text-align: center;
    }

    .panel {
        border-radius: 13px;
        padding: 14px;
    }

    .panel-header {
        align-items: flex-start;
    }

    .filters,
    .queue-controls {
        width: 100%;
    }

    .filters input,
    .filters select,
    .queue-controls input,
    .queue-controls select,
    .btn,
    button {
        width: 100%;
    }

    table {
        min-width: 620px;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}
