:root {
    --kl-bg: #eef3f7;
    --kl-surface: #ffffff;
    --kl-sidebar: #0f172a;
    --kl-sidebar-accent: #1e293b;
    --kl-text: #0f172a;
    --kl-muted: #64748b;
    --kl-primary: #166534;
    --kl-primary-dark: #14532d;
    --kl-border: rgba(15, 23, 42, 0.08);
    --kl-highlight: linear-gradient(135deg, #dcfce7 0%, #f8fafc 100%);
}

body {
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(22, 101, 52, 0.18), transparent 32%),
        linear-gradient(180deg, #f8fbfd 0%, var(--kl-bg) 100%);
    color: var(--kl-text);
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

.login-page {
    display: grid;
    place-items: center;
    padding: 1.5rem;
}

.login-shell {
    width: min(100%, 1100px);
}

.login-card {
    max-width: 520px;
    margin: 0 auto;
    border-radius: 1.5rem;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.94) 100%);
}

.eyebrow {
    display: inline-flex;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: rgba(22, 101, 52, 0.1);
    color: var(--kl-primary-dark);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    background: linear-gradient(180deg, var(--kl-sidebar) 0%, #111827 100%);
    color: #fff;
    width: 280px;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-close-btn {
    opacity: 1;
}

.sidebar-brand {
    font-size: 1.35rem;
    font-weight: 700;
}

.sidebar-subtitle {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    padding: 1rem;
    gap: 0.5rem;
}

.sidebar-link {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    padding: 0.9rem 1rem;
    border-radius: 1rem;
    background: transparent;
    transition: background-color 0.2s ease, transform 0.2s ease, color 0.2s ease;
}

.sidebar-link:hover,
.sidebar-link:focus {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(2px);
}

.sidebar-link.active {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.app-main {
    flex: 1;
    min-width: 0;
}

.app-header {
    background: rgba(255, 255, 255, 0.96) !important;
    backdrop-filter: blur(12px);
}

.app-icon-btn {
    width: 44px;
    height: 44px;
    border: 1px solid var(--kl-border);
    border-radius: 0.95rem;
    background: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.app-icon-btn:hover,
.app-icon-btn:focus {
    background: #f8fafc;
    border-color: rgba(22, 101, 52, 0.28);
}

.app-menu-icon {
    display: inline-flex;
    width: 18px;
    height: 14px;
    flex-direction: column;
    justify-content: space-between;
}

.app-menu-icon span {
    display: block;
    width: 100%;
    height: 2px;
    border-radius: 999px;
    background: var(--kl-text);
}

.app-dots-icon {
    display: inline-flex;
    width: 4px;
    height: 18px;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
}

.app-dots-icon span {
    width: 4px;
    height: 4px;
    border-radius: 999px;
    background: var(--kl-text);
}

.app-actions-menu {
    min-width: 220px;
    border-radius: 1rem;
    padding: 0.55rem;
}

.app-actions-menu .dropdown-item,
.app-actions-menu .dropdown-item-text {
    border-radius: 0.8rem;
    padding: 0.7rem 0.85rem;
}

.app-actions-menu .dropdown-item:active {
    background: rgba(22, 101, 52, 0.12);
    color: var(--kl-text);
}

.app-content {
    animation: fade-in 0.35s ease;
}

.stat-card {
    border-radius: 1.25rem;
    background: var(--kl-surface);
}

.stat-card-primary {
    background: var(--kl-highlight);
}

.stat-label {
    color: var(--kl-muted);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.dashboard-grid-item {
    border: 1px solid var(--kl-border);
    border-radius: 1rem;
    padding: 1.1rem;
    background: #fff;
}

.workflow-list {
    padding-left: 1.1rem;
    color: var(--kl-text);
}

.workflow-list li + li {
    margin-top: 0.9rem;
}

.page-loader {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 0.75rem;
    background: rgba(15, 23, 42, 0.72);
    z-index: 2000;
    color: #fff;
}

.page-loader.is-visible {
    display: flex;
}

.loader-text {
    font-size: 0.95rem;
    letter-spacing: 0.04em;
}

.prize-card,
.card {
    border-radius: 1.25rem;
}

.form-control,
.form-select,
.btn {
    border-radius: 0.9rem;
}

.form-control:focus,
.form-check-input:focus,
.btn:focus {
    box-shadow: 0 0 0 0.25rem rgba(22, 101, 52, 0.16);
    border-color: rgba(22, 101, 52, 0.45);
}

.btn-primary {
    background: var(--kl-primary);
    border-color: var(--kl-primary);
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    background: var(--kl-primary-dark);
    border-color: var(--kl-primary-dark);
}

#installAppButton {
    white-space: nowrap;
}

.cron-job-card {
    border: 1px solid var(--kl-border);
    border-radius: 1rem;
    padding: 1rem 1.1rem;
    background: #fff;
}

.cron-job-card.is-loading {
    border-color: rgba(22, 101, 52, 0.32);
    box-shadow: 0 0 0 0.2rem rgba(22, 101, 52, 0.08);
}

.cron-url {
    word-break: break-all;
    color: var(--kl-muted);
    font-size: 0.92rem;
}

.cron-run-btn {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    position: relative;
}

.cron-run-btn svg {
    width: 18px;
    height: 18px;
}

.cron-run-spinner {
    display: none;
}

.cron-run-btn.is-loading .cron-run-icon {
    opacity: 0;
}

.cron-run-btn.is-loading .cron-run-spinner {
    display: inline-flex;
    position: absolute;
}

@keyframes fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 991.98px) {
    .sidebar {
        width: min(85vw, 320px);
    }

    .offcanvas-backdrop.show {
        opacity: 0.45;
    }
}

@media (max-width: 767.98px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .app-content {
        padding-bottom: 2rem;
    }

    .app-header .container-fluid {
        padding-top: 0.9rem;
        padding-bottom: 0.9rem;
    }
}

@media (display-mode: standalone) {
    body {
        overscroll-behavior-y: contain;
    }
}

