:root {
    color-scheme: light;
}

html.dark {
    color-scheme: dark;
}

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

body {
    transition: background-color 180ms ease, color 180ms ease;
}

[data-ajax-filter-submit],
[data-execution-queue-filter-submit] {
    display: none !important;
}

.app-main {
    min-width: 0;
}

.dashboard-summary-card {
    background-color: #ffffff;
    background-image: linear-gradient(
        135deg,
        rgb(248 250 252 / 0.98) 0%,
        rgb(255 255 255 / 0.96) 44%,
        #ffffff 100%
    );
}

.dashboard-card-teal {
    background-image: linear-gradient(
        135deg,
        #ffffff 0%,
        rgb(255 255 255 / 0.96) 50%,
        rgb(240 253 250 / 0.92) 100%
    );
}

.dashboard-card-blue {
    background-image: linear-gradient(
        135deg,
        #ffffff 0%,
        rgb(255 255 255 / 0.96) 50%,
        rgb(239 246 255 / 0.92) 100%
    );
}

.dashboard-card-violet {
    background-image: linear-gradient(
        135deg,
        #ffffff 0%,
        rgb(255 255 255 / 0.96) 50%,
        rgb(245 243 255 / 0.9) 100%
    );
}

.dashboard-card-amber {
    background-image: linear-gradient(
        135deg,
        #ffffff 0%,
        rgb(255 255 255 / 0.96) 50%,
        rgb(255 251 235 / 0.9) 100%
    );
}

.dashboard-card-green {
    background-image: linear-gradient(
        135deg,
        #ffffff 0%,
        rgb(255 255 255 / 0.96) 50%,
        rgb(240 253 244 / 0.9) 100%
    );
}

.dashboard-card-red {
    background-image: linear-gradient(
        135deg,
        #ffffff 0%,
        rgb(255 255 255 / 0.96) 50%,
        rgb(254 242 242 / 0.9) 100%
    );
}

.queue-status-summary-pill {
    display: inline-flex;
    height: 2rem;
    min-width: 6.1rem;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    border-width: 1px;
    border-style: solid;
    border-radius: 0.5rem;
    padding: 0 0.625rem;
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    box-shadow: 0 1px 2px rgb(15 23 42 / 0.08);
}

.queue-status-summary-running {
    border-color: #93c5fd;
    background-color: #dbeafe;
    color: #1e40af;
}

.queue-status-summary-retry {
    border-color: #fcd34d;
    background-color: #fef3c7;
    color: #92400e;
}

.queue-status-summary-error {
    border-color: #fca5a5;
    background-color: #fee2e2;
    color: #991b1b;
}

.queue-status-summary-waiting {
    border-color: #c4b5fd;
    background-color: #ede9fe;
    color: #5b21b6;
}

.queue-status-summary-pending {
    border-color: #cbd5e1;
    background-color: #e2e8f0;
    color: #334155;
}

.crm-queue-alert {
    --alert-border: #bfdbfe;
    --alert-background: #eff6ff;
    --alert-icon-background: #dbeafe;
    --alert-accent: #2563eb;
    --alert-heading: #1e3a8a;
    --alert-text: #475569;
    display: flex;
    align-items: center;
    gap: 0.875rem;
    border: 1px solid var(--alert-border);
    border-radius: 1rem;
    background: var(--alert-background);
    padding: 0.875rem 1rem;
    box-shadow: 0 1px 2px rgb(15 23 42 / 0.04);
}

.crm-queue-alert--error {
    --alert-border: #fecaca;
    --alert-background: #fef2f2;
    --alert-icon-background: #fee2e2;
    --alert-accent: #dc2626;
    --alert-heading: #991b1b;
}

.crm-queue-alert--retry {
    --alert-border: #fde68a;
    --alert-background: #fffbeb;
    --alert-icon-background: #fef3c7;
    --alert-accent: #d97706;
    --alert-heading: #92400e;
}

.crm-queue-alert--running {
    --alert-border: #a7f3d0;
    --alert-background: #ecfdf5;
    --alert-icon-background: #d1fae5;
    --alert-accent: #059669;
    --alert-heading: #065f46;
}

.crm-queue-alert__icon {
    display: flex;
    width: 2.5rem;
    height: 2.5rem;
    flex: 0 0 2.5rem;
    align-items: center;
    justify-content: center;
    border-radius: 0.75rem;
    background: var(--alert-icon-background);
    color: var(--alert-accent);
}

.crm-queue-alert__icon svg {
    width: 1.25rem;
    height: 1.25rem;
}

.crm-queue-alert__content {
    min-width: 0;
    flex: 1;
}

.crm-queue-alert__heading {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    color: var(--alert-heading);
    font-size: 0.875rem;
}

.crm-queue-alert__content p {
    margin-top: 0.2rem;
    color: var(--alert-text);
    font-size: 0.75rem;
    line-height: 1.45;
}

.crm-queue-alert__badge {
    border: 1px solid color-mix(in srgb, var(--alert-accent) 28%, transparent);
    border-radius: 999px;
    background: color-mix(in srgb, var(--alert-accent) 10%, transparent);
    padding: 0.125rem 0.45rem;
    color: var(--alert-accent);
    font-size: 0.625rem;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.crm-queue-alert__action {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    border: 1px solid color-mix(in srgb, var(--alert-accent) 32%, transparent);
    border-radius: 0.625rem;
    background: rgb(255 255 255 / 0.72);
    padding: 0.5rem 0.7rem;
    color: var(--alert-accent);
    font-size: 0.75rem;
    font-weight: 700;
    transition: background-color 160ms ease, border-color 160ms ease;
}

.crm-queue-alert__action:hover {
    border-color: color-mix(in srgb, var(--alert-accent) 52%, transparent);
    background: #ffffff;
}

.crm-queue-alert__action svg {
    width: 0.875rem;
    height: 0.875rem;
}

.crm-queue-alert__spinner {
    animation: ajax-loading-spin 800ms linear infinite;
}

@media (max-width: 639px) {
    .crm-queue-alert {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .crm-queue-alert__action {
        width: 100%;
        margin-left: 3.375rem;
    }
}

.theme-icon {
    transition: opacity 160ms ease, transform 160ms ease;
}

.theme-logo-dark {
    display: none;
}

.ajax-loading-host {
    position: relative;
}

.ajax-loading-overlay {
    position: absolute;
    inset: 0;
    z-index: 80;
    display: none;
    align-items: center;
    justify-content: center;
    border-radius: inherit;
    background: rgb(248 250 252 / 0.72);
    backdrop-filter: blur(2px);
}

.ajax-loading-host.ajax-loading-upper .ajax-loading-overlay {
    align-items: flex-start;
    padding-top: clamp(3rem, 14vh, 7rem);
}

.ajax-loading-host.is-ajax-loading .ajax-loading-overlay {
    display: flex;
}

.ajax-loading-panel {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    border-radius: 0.75rem;
    border: 1px solid rgb(226 232 240 / 0.95);
    background: rgb(255 255 255 / 0.94);
    padding: 0.625rem 0.875rem;
    color: #334155;
    font-size: 0.75rem;
    font-weight: 700;
    box-shadow: 0 18px 45px rgb(15 23 42 / 0.14);
}

.ajax-loading-spinner {
    width: 1rem;
    height: 1rem;
    border-radius: 999px;
    border: 2px solid rgb(148 163 184 / 0.35);
    border-top-color: #2563eb;
    animation: ajax-loading-spin 700ms linear infinite;
}

@keyframes ajax-loading-spin {
    to {
        transform: rotate(360deg);
    }
}

.dark .theme-logo-light {
    display: none;
}

.dark .theme-logo-dark {
    display: block;
}

@media (max-width: 1279px) {
    .app-main {
        overflow-x: hidden;
    }

    .app-main h1 {
        overflow-wrap: anywhere;
    }

    .app-main :is(section, div):has(> table) {
        max-width: 100%;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    .app-main :is(section, div):has(> table) > table {
        min-width: 760px;
    }

    .app-main #executionQueueTable > table,
    .app-main [data-process-panel="history"] :is(section, div):has(> table) > table {
        min-width: 1180px;
    }

    .app-main :is(section, div):has(> table)::-webkit-scrollbar {
        height: 8px;
    }

    .app-main :is(section, div):has(> table)::-webkit-scrollbar-track {
        background: rgb(226 232 240 / 0.6);
        border-radius: 999px;
    }

    .app-main :is(section, div):has(> table)::-webkit-scrollbar-thumb {
        background: rgb(100 116 139 / 0.65);
        border-radius: 999px;
    }

    .dark .app-main :is(section, div):has(> table)::-webkit-scrollbar-track {
        background: rgb(15 23 42 / 0.9);
    }

    .dark .app-main :is(section, div):has(> table)::-webkit-scrollbar-thumb {
        background: rgb(71 85 105 / 0.9);
    }
}

html.dark body,
.dark .bg-gray-100 {
    background-color: #020617 !important;
    color: #cbd5e1;
}

.dark .bg-white {
    background-color: #0f172a !important;
}

.dark .dashboard-summary-card {
    background-image: linear-gradient(
        135deg,
        rgb(30 41 59 / 0.68) 0%,
        rgb(15 23 42 / 0.96) 50%,
        #0f172a 100%
    ) !important;
}

.dark .dashboard-card-teal {
    background-image: linear-gradient(
        135deg,
        #0f172a 0%,
        rgb(15 23 42 / 0.96) 52%,
        rgb(20 184 166 / 0.16) 100%
    ) !important;
}

.dark .dashboard-card-blue {
    background-image: linear-gradient(
        135deg,
        #0f172a 0%,
        rgb(15 23 42 / 0.96) 52%,
        rgb(37 99 235 / 0.16) 100%
    ) !important;
}

.dark .dashboard-card-violet {
    background-image: linear-gradient(
        135deg,
        #0f172a 0%,
        rgb(15 23 42 / 0.96) 52%,
        rgb(124 58 237 / 0.16) 100%
    ) !important;
}

.dark .dashboard-card-amber {
    background-image: linear-gradient(
        135deg,
        #0f172a 0%,
        rgb(15 23 42 / 0.96) 52%,
        rgb(217 119 6 / 0.16) 100%
    ) !important;
}

.dark .dashboard-card-green {
    background-image: linear-gradient(
        135deg,
        #0f172a 0%,
        rgb(15 23 42 / 0.96) 52%,
        rgb(22 163 74 / 0.15) 100%
    ) !important;
}

.dark .dashboard-card-red {
    background-image: linear-gradient(
        135deg,
        #0f172a 0%,
        rgb(15 23 42 / 0.96) 52%,
        rgb(220 38 38 / 0.15) 100%
    ) !important;
}

.dark .queue-status-summary-running {
    border-color: rgb(59 130 246 / 0.5);
    background-color: rgb(59 130 246 / 0.12);
    color: #bfdbfe;
}

.dark .queue-status-summary-retry {
    border-color: rgb(245 158 11 / 0.5);
    background-color: rgb(245 158 11 / 0.12);
    color: #fde68a;
}

.dark .queue-status-summary-error {
    border-color: rgb(239 68 68 / 0.5);
    background-color: rgb(239 68 68 / 0.12);
    color: #fecaca;
}

.dark .queue-status-summary-waiting {
    border-color: rgb(139 92 246 / 0.5);
    background-color: rgb(139 92 246 / 0.12);
    color: #ddd6fe;
}

.dark .queue-status-summary-pending {
    border-color: rgb(100 116 139 / 0.55);
    background-color: rgb(100 116 139 / 0.16);
    color: #e2e8f0;
}

.dark .crm-queue-alert {
    --alert-border: rgb(59 130 246 / 0.46);
    --alert-background: rgb(30 64 175 / 0.16);
    --alert-icon-background: rgb(37 99 235 / 0.2);
    --alert-accent: #93c5fd;
    --alert-heading: #dbeafe;
    --alert-text: #cbd5e1;
    box-shadow:
        inset 0 1px 0 rgb(255 255 255 / 0.025),
        0 10px 30px rgb(0 0 0 / 0.14);
}

.dark .crm-queue-alert--error {
    --alert-border: rgb(248 113 113 / 0.48);
    --alert-background: rgb(127 29 29 / 0.22);
    --alert-icon-background: rgb(220 38 38 / 0.2);
    --alert-accent: #fca5a5;
    --alert-heading: #fee2e2;
}

.dark .crm-queue-alert--retry {
    --alert-border: rgb(251 191 36 / 0.46);
    --alert-background: rgb(120 53 15 / 0.2);
    --alert-icon-background: rgb(217 119 6 / 0.2);
    --alert-accent: #fcd34d;
    --alert-heading: #fef3c7;
}

.dark .crm-queue-alert--running {
    --alert-border: rgb(52 211 153 / 0.4);
    --alert-background: rgb(6 78 59 / 0.2);
    --alert-icon-background: rgb(5 150 105 / 0.2);
    --alert-accent: #6ee7b7;
    --alert-heading: #d1fae5;
}

.dark .crm-queue-alert__action {
    border-color: color-mix(in srgb, var(--alert-accent) 35%, transparent);
    background: rgb(15 23 42 / 0.58);
    color: var(--alert-accent);
}

.dark .crm-queue-alert__action:hover {
    border-color: color-mix(in srgb, var(--alert-accent) 58%, transparent);
    background: rgb(30 41 59 / 0.9);
}

.dark .bg-slate-50,
.dark .bg-slate-50\/70 {
    background-color: rgb(30 41 59 / 0.68) !important;
}

.dark .bg-slate-100 {
    background-color: #1e293b !important;
}

.dark .bg-slate-200 {
    background-color: #334155 !important;
}

.dark .bg-slate-300 {
    background-color: #475569 !important;
}

.dark .text-slate-900,
.dark .text-slate-800 {
    color: #e2e8f0 !important;
}

.dark .text-slate-700 {
    color: #cbd5e1 !important;
}

.dark .text-slate-600,
.dark .text-slate-500 {
    color: #94a3b8 !important;
}

.dark .text-slate-400 {
    color: #64748b !important;
}

.dark .border-slate-100,
.dark .border-slate-200,
.dark .border-slate-300,
.dark .border-slate-700 {
    border-color: #334155 !important;
}

.dark .divide-slate-200 > :not([hidden]) ~ :not([hidden]) {
    border-color: #334155 !important;
}

.dark input:not([type="checkbox"]):not([type="radio"]),
.dark select,
.dark textarea {
    background-color: #111827 !important;
    border-color: #334155 !important;
    color: #e2e8f0 !important;
}

.dark input:disabled,
.dark select:disabled,
.dark textarea:disabled {
    background-color: #1e293b !important;
    color: #94a3b8 !important;
}

.dark input::placeholder,
.dark textarea::placeholder {
    color: #64748b !important;
}

.dark option {
    background-color: #111827;
    color: #e2e8f0;
}

.dark .shadow,
.dark .shadow-sm,
.dark .shadow-xl,
.dark .shadow-2xl {
    box-shadow: 0 18px 45px rgb(0 0 0 / 0.35) !important;
}

.dark .hover\:bg-slate-50:hover,
.dark .hover\:bg-slate-100:hover,
.dark .hover\:bg-slate-200:hover {
    background-color: #334155 !important;
}

.dark .hover\:bg-slate-300:hover,
.dark .hover\:bg-slate-700:hover {
    background-color: #475569 !important;
}

.dark .hover\:bg-slate-800:hover,
.dark .hover\:bg-slate-900:hover {
    background-color: #1e293b !important;
}

.dark button.bg-slate-100,
.dark a.bg-slate-100 {
    background-color: #334155 !important;
    box-shadow: inset 0 0 0 1px rgb(71 85 105 / 0.9) !important;
    color: #e2e8f0 !important;
}

.dark button.bg-slate-900,
.dark a.bg-slate-900 {
    background-color: #334155 !important;
    box-shadow: inset 0 0 0 1px rgb(71 85 105 / 0.9) !important;
    color: #f8fafc !important;
}

.dark button.hover\:bg-slate-200:hover,
.dark a.hover\:bg-slate-200:hover {
    background-color: #475569 !important;
}

.dark button.hover\:bg-slate-700:hover,
.dark a.hover\:bg-slate-700:hover {
    background-color: #475569 !important;
}

.dark .hover\:text-slate-700:hover,
.dark .hover\:text-slate-900:hover {
    color: #f8fafc !important;
}

.dark .bg-blue-50,
.dark .bg-blue-100 {
    background-color: rgb(37 99 235 / 0.18) !important;
}

.dark .border-blue-200 {
    border-color: rgb(59 130 246 / 0.35) !important;
}

.dark .text-blue-700 {
    color: #93c5fd !important;
}

.dark .hover\:text-blue-900:hover {
    color: #bfdbfe !important;
}

.dark .bg-violet-100 {
    background-color: rgb(124 58 237 / 0.2) !important;
}

.dark .text-violet-700 {
    color: #c4b5fd !important;
}

.dark .bg-teal-100 {
    background-color: rgb(13 148 136 / 0.2) !important;
}

.dark .text-teal-700 {
    color: #5eead4 !important;
}

.dark .bg-green-100 {
    background-color: rgb(22 163 74 / 0.18) !important;
}

.dark .text-green-600,
.dark .text-green-700 {
    color: #86efac !important;
}

.dark .bg-amber-100 {
    background-color: rgb(217 119 6 / 0.2) !important;
}

.dark .text-amber-600,
.dark .text-amber-700 {
    color: #fcd34d !important;
}

.dark .bg-red-50,
.dark .bg-red-100 {
    background-color: rgb(220 38 38 / 0.18) !important;
}

.dark .border-red-200 {
    border-color: rgb(248 113 113 / 0.35) !important;
}

.dark .text-red-500,
.dark .text-red-600,
.dark .text-red-700 {
    color: #fca5a5 !important;
}

.dark .bg-black\/50 {
    background-color: rgb(2 6 23 / 0.78) !important;
}

.dark .ajax-loading-overlay {
    background: rgb(2 6 23 / 0.58);
}

.dark .ajax-loading-panel {
    border-color: rgb(71 85 105 / 0.9);
    background: rgb(15 23 42 / 0.94);
    color: #e2e8f0;
    box-shadow: 0 18px 45px rgb(0 0 0 / 0.36);
}

.dark .ajax-loading-spinner {
    border-color: rgb(71 85 105 / 0.75);
    border-top-color: #60a5fa;
}

.dark .from-slate-100 {
    --tw-gradient-from: #020617 var(--tw-gradient-from-position);
    --tw-gradient-to: rgb(2 6 23 / 0) var(--tw-gradient-to-position);
    --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
}

.dark .to-slate-200 {
    --tw-gradient-to: #0f172a var(--tw-gradient-to-position);
}
