:root {
    --bg: #fbf7f1;
    --bg-accent: #fffdf9;
    --panel: rgba(255, 255, 255, 0.82);
    --text: #221d1a;
    --muted: #7b7267;
    --line: rgba(104, 84, 65, 0.14);
    --shadow: 0 18px 45px rgba(128, 98, 52, 0.12);
    --radius: 24px;
    --radius-sm: 16px;
    --brand: #5a5cf1;
    --coral: linear-gradient(135deg, #ffe0d6 0%, #fff2ec 100%);
    --sky: linear-gradient(135deg, #d9efff 0%, #edf7ff 100%);
    --sand: linear-gradient(135deg, #ffefcc 0%, #fff7e6 100%);
    --mist: linear-gradient(135deg, #e4e7f6 0%, #f5f7fb 100%);
    --accent: linear-gradient(135deg, #fffbef 0%, #fef5dd 100%);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(255, 193, 165, 0.45), transparent 26%),
        radial-gradient(circle at top right, rgba(123, 181, 255, 0.28), transparent 22%),
        linear-gradient(180deg, #fffdf7 0%, #fbf7f1 100%);
    font-family: "Manrope", "Noto Sans SC", sans-serif;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
textarea,
select {
    font: inherit;
}

.app-shell {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
}

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 28px;
    padding: 28px 22px;
    background: rgba(255, 255, 255, 0.55);
    border-right: 1px solid var(--line);
    backdrop-filter: blur(14px);
}

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

.brand-mark {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    background: linear-gradient(135deg, #7266ff 0%, #8472ff 100%);
    color: white;
    font-weight: 800;
    font-size: 24px;
    box-shadow: 0 18px 30px rgba(94, 92, 241, 0.25);
}

.brand-title {
    font-size: 18px;
    font-weight: 800;
}

.brand-subtitle {
    margin-top: 4px;
    color: var(--muted);
    font-size: 13px;
}

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

.nav-link {
    padding: 14px 16px;
    border-radius: 18px;
    color: #564d44;
    transition: 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
    background: linear-gradient(135deg, #7067f6 0%, #8c73f8 100%);
    color: white;
    box-shadow: 0 16px 28px rgba(112, 103, 246, 0.2);
}

.sidebar-card,
.panel,
.login-panel {
    border: 1px solid rgba(255, 255, 255, 0.7);
    background: var(--panel);
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow);
}

.sidebar-card {
    margin-top: auto;
    border-radius: var(--radius);
    padding: 18px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.8), rgba(255, 244, 231, 0.92));
}

.sidebar-card-label {
    color: var(--muted);
    font-size: 13px;
}

.sidebar-card-value {
    margin-top: 8px;
    font-weight: 800;
    font-size: 18px;
}

.sidebar-card-tip {
    margin-top: 12px;
    color: var(--muted);
    line-height: 1.7;
    font-size: 13px;
}

.main-panel {
    padding: 26px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.topbar h1,
.hero-copy h1 {
    margin: 8px 0 0;
    font-size: clamp(30px, 4vw, 42px);
    line-height: 1.05;
}

.eyebrow,
.panel-eyebrow {
    color: #8b5b34;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 12px;
    font-weight: 800;
}

.page-content {
    margin-top: 26px;
    display: grid;
    gap: 24px;
}

.hero-banner,
.panel,
.stat-card {
    border-radius: var(--radius);
}

.hero-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    padding: 24px 28px;
    background: linear-gradient(135deg, rgba(255, 245, 232, 0.95), rgba(255, 255, 255, 0.75));
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.86);
}

.hero-banner h2,
.panel h3 {
    margin: 8px 0 0;
    font-size: 28px;
}

.hero-banner p,
.feature-list,
.number-list,
.panel p {
    color: var(--muted);
    line-height: 1.75;
}

.hero-pill {
    padding: 12px 16px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.8);
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
}

.stat-card {
    padding: 24px;
    border: 1px solid rgba(255, 255, 255, 0.7);
    box-shadow: var(--shadow);
}

.stat-card.coral { background: var(--coral); }
.stat-card.sky { background: var(--sky); }
.stat-card.sand { background: var(--sand); }
.stat-card.mist { background: var(--mist); }

.stat-label {
    color: #85593d;
    font-weight: 700;
    font-size: 14px;
}

.stat-value {
    margin-top: 18px;
    font-size: clamp(28px, 4vw, 40px);
    font-weight: 800;
}

.stat-meta {
    margin-top: 10px;
    color: var(--muted);
}

.panel-grid.two-up {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}

.panel {
    padding: 24px;
}

.accent-panel {
    background: var(--accent);
}

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

.stack-form {
    display: grid;
    gap: 14px;
}

.stack-form label,
.dialog-card label,
.login-form label {
    display: grid;
    gap: 8px;
}

.stack-form span,
.dialog-card span,
.login-form span {
    font-size: 13px;
    font-weight: 700;
    color: #6c645a;
}

input,
textarea,
select {
    width: 100%;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid rgba(111, 90, 70, 0.16);
    background: rgba(255, 255, 255, 0.82);
    outline: none;
    transition: 0.2s ease;
}

input:focus,
textarea:focus,
select:focus {
    border-color: rgba(112, 103, 246, 0.45);
    box-shadow: 0 0 0 4px rgba(112, 103, 246, 0.08);
}

.primary-button,
.ghost-button {
    border: 0;
    border-radius: 16px;
    padding: 13px 18px;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.primary-button {
    background: linear-gradient(135deg, #ff8f72 0%, #ff6d86 100%);
    color: white;
    font-weight: 800;
    box-shadow: 0 18px 28px rgba(255, 122, 122, 0.24);
}

.primary-button:hover,
.ghost-button:hover {
    transform: translateY(-1px);
}

.primary-button.large {
    padding: 15px 18px;
    font-size: 16px;
}

.ghost-button {
    background: rgba(255, 255, 255, 0.7);
    color: #4f463d;
    border: 1px solid rgba(111, 90, 70, 0.14);
}

.ghost-button.small {
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 13px;
}

.table-wrap {
    overflow: auto;
}

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

th,
td {
    padding: 14px 12px;
    text-align: left;
    border-bottom: 1px solid rgba(111, 90, 70, 0.08);
    font-size: 14px;
}

th {
    color: #7b6d60;
    font-weight: 800;
}

td {
    vertical-align: middle;
}

.empty-cell,
.empty-state {
    color: var(--muted);
    text-align: center;
    padding: 24px;
}

.table-actions {
    display: flex;
    gap: 8px;
}

.status-chip {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    background: rgba(116, 111, 255, 0.12);
    color: #5d4ee5;
}

.status-chip.uploaded,
.status-chip.pending,
.status-chip.pulled {
    background: rgba(255, 176, 72, 0.18);
    color: #a66400;
}

.status-chip.published,
.status-chip.cached,
.status-chip.active,
.status-chip.completed {
    background: rgba(88, 193, 117, 0.16);
    color: #23703a;
}

.status-chip.failed {
    background: rgba(255, 111, 111, 0.16);
    color: #bf3d3d;
}

.feature-list,
.number-list {
    margin: 0;
    padding-left: 18px;
}

.feature-list li,
.number-list li {
    margin: 10px 0;
}

.login-body {
    min-height: 100vh;
}

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

.login-panel {
    width: min(760px, 100%);
    padding: 36px;
    border-radius: 34px;
}

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

.hero-copy {
    margin: 26px 0 18px;
}

.hero-copy p {
    margin-top: 14px;
    color: var(--muted);
    line-height: 1.8;
}

.login-form {
    display: grid;
    gap: 14px;
}

.login-tip {
    margin-top: 18px;
    color: var(--muted);
    font-size: 13px;
}

.alert {
    margin-bottom: 18px;
    padding: 13px 16px;
    border-radius: 16px;
}

.alert.error {
    background: rgba(255, 111, 111, 0.12);
    color: #bf3d3d;
}

.toast-root {
    position: fixed;
    right: 22px;
    bottom: 22px;
    display: grid;
    gap: 10px;
    z-index: 50;
}

.toast {
    min-width: 220px;
    max-width: 320px;
    padding: 14px 16px;
    border-radius: 16px;
    color: white;
    box-shadow: 0 18px 30px rgba(59, 48, 27, 0.2);
    animation: slideIn 0.22s ease;
}

.toast.info {
    background: linear-gradient(135deg, #746fff 0%, #8b8afc 100%);
}

.toast.error {
    background: linear-gradient(135deg, #ff7f7f 0%, #f25f78 100%);
}

.inline-link {
    color: #5a5cf1;
    font-weight: 700;
}

.dispatch-dialog {
    border: 0;
    padding: 0;
    background: transparent;
}

.dispatch-dialog::backdrop {
    background: rgba(34, 29, 26, 0.28);
    backdrop-filter: blur(4px);
}

.dialog-card {
    width: min(720px, calc(100vw - 24px));
    padding: 24px;
    border-radius: 28px;
    background: #fffefb;
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.8);
}

.checkbox-grid {
    display: grid;
    gap: 12px;
    margin-bottom: 16px;
}

.checkbox-card {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(255, 246, 238, 0.8);
    border: 1px solid rgba(111, 90, 70, 0.08);
}

.checkbox-card span {
    display: block;
    color: var(--muted);
    font-size: 13px;
    margin-top: 6px;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 1100px) {
    .app-shell,
    .panel-grid.two-up,
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .sidebar {
        gap: 18px;
    }

    .topbar,
    .hero-banner {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 768px) {
    .main-panel {
        padding: 18px;
    }

    .sidebar {
        padding: 18px;
    }

    .panel,
    .stat-card,
    .hero-banner {
        padding: 18px;
    }

    .login-panel {
        padding: 26px;
    }
}
