body.app-body {
    font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at top left, rgba(79, 70, 229, 0.12), transparent 55%),
        radial-gradient(circle at bottom right, rgba(14, 165, 233, 0.12), transparent 55%),
        #f3f4f6;
    color: #0f172a;
    min-height: 100vh;
}

main.container {
    max-width: 1200px;
}

.app-navbar {
    background: rgba(255, 255, 255, 0.92) !important;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.app-navbar .navbar-brand {
    font-weight: 600;
    letter-spacing: 0.02em;
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.app-navbar .navbar-brand i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    color: #ffffff;
    font-size: 1rem;
}

.app-navbar .nav-link {
    font-weight: 500;
    color: #4b5563;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.app-navbar .nav-link i {
    font-size: 0.95rem;
}

.app-navbar .nav-link:hover {
    color: #111827;
}

.app-navbar .nav-link.active,
.app-navbar .nav-link[aria-current="page"] {
    color: #111827;
}

.app-navbar .nav-link.active::after,
.app-navbar .nav-link[aria-current="page"]::after {
    content: "";
    display: block;
    height: 2px;
    border-radius: 999px;
    background: linear-gradient(90deg, #4f46e5, #6366f1);
    margin-top: 4px;
}

.app-navbar .dropdown-menu {
    border-radius: 14px;
    border-color: #e5e7eb;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.16);
}

.app-navbar .dropdown-item {
    font-size: 0.9rem;
}

.btn-primary {
    --bs-btn-bg: #4f46e5;
    --bs-btn-border-color: #4f46e5;
    --bs-btn-hover-bg: #4338ca;
    --bs-btn-hover-border-color: #4338ca;
    --bs-btn-focus-shadow-rgb: 79, 70, 229;
    --bs-btn-active-bg: #3730a3;
    --bs-btn-active-border-color: #3730a3;
}

.card {
    border-radius: 18px;
    border-color: #e5e7eb;
    box-shadow:
        0 18px 45px rgba(15, 23, 42, 0.06),
        0 0 0 1px rgba(148, 163, 184, 0.12);
}

.card-header {
    border-radius: 18px 18px 0 0 !important;
}

.alert {
    border-radius: 14px;
    border-width: 1px;
}

.alert-dismissible .btn-close {
    padding: 1.1rem 1.1rem;
}

footer {
    border-top: 1px solid rgba(148, 163, 184, 0.4);
    backdrop-filter: blur(10px);
}

.auth-layout {
    min-height: calc(100vh - 140px);
}

.auth-card {
    border-radius: 22px;
}

.auth-card .card-header {
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    color: #ffffff;
}

.auth-card .card-header h4 {
    font-weight: 600;
}

input.form-control {
    border-radius: 12px;
    border-color: #e5e7eb;
    padding-top: 0.6rem;
    padding-bottom: 0.6rem;
}

input.form-control:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 1px rgba(79, 70, 229, 0.12), 0 0 0 0.25rem rgba(79, 70, 229, 0.15);
}

.autopilot-nav-btn {
    min-width: 148px;
    font-weight: 700;
    letter-spacing: 0.01em;
    box-shadow: 0 8px 22px rgba(79, 70, 229, 0.28);
}

.autopilot-nav-btn.processing {
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.35), 0 8px 24px rgba(34, 197, 94, 0.35);
}

.autopilot-live-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-right: 6px;
    border-radius: 999px;
    background: #94a3b8;
    vertical-align: middle;
}

.autopilot-live-dot.active {
    background: #16a34a;
    box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.75);
    animation: autopilotPulse 1.1s infinite;
}

@keyframes autopilotPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.65);
    }
    70% {
        box-shadow: 0 0 0 8px rgba(22, 163, 74, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(22, 163, 74, 0);
    }
}

.autopilot-panel-toggle {
    position: fixed;
    right: 12px;
    top: 45%;
    z-index: 1100;
    border: 0;
    border-radius: 10px;
    background: #2563eb;
    color: #fff;
    padding: 10px 11px;
    box-shadow: 0 10px 26px rgba(37, 99, 235, 0.35);
}

.autopilot-panel-toggle.is-active {
    background: #1d4ed8;
}

.autopilot-panel {
    position: fixed;
    right: 12px;
    top: 110px;
    width: 350px;
    max-height: calc(100vh - 130px);
    z-index: 1099;
    border: 1px solid #d1d5db;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 22px 56px rgba(15, 23, 42, 0.22);
    overflow: hidden;
    transform: translateX(120%);
    transition: transform 0.24s ease;
}

.autopilot-panel.open {
    transform: translateX(0);
}

.autopilot-panel.collapsed .autopilot-panel-body {
    display: none;
}

.autopilot-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
    cursor: ns-resize;
}

.autopilot-title {
    font-weight: 700;
    color: #0f172a;
}

.autopilot-mini {
    font-size: 12px;
    color: #475569;
}

.autopilot-header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.autopilot-panel-body {
    padding: 10px 12px;
    overflow-y: auto;
    max-height: calc(100vh - 190px);
}

.autopilot-overview {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 10px;
}

.autopilot-overview > div {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 7px 8px;
    text-align: center;
    background: #fff;
}

.autopilot-overview strong {
    display: block;
    font-size: 16px;
    line-height: 1;
}

.autopilot-overview span {
    font-size: 11px;
    color: #64748b;
}

.autopilot-health {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    margin-bottom: 10px;
    color: #334155;
}

.autopilot-sync-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
    padding: 7px 8px;
    margin-bottom: 10px;
}

.autopilot-feedback {
    font-size: 12px;
    border: 1px solid #c7d2fe;
    background: #eef2ff;
    color: #3730a3;
    border-radius: 8px;
    padding: 6px 8px;
    margin-bottom: 10px;
}

.autopilot-section {
    margin-bottom: 10px;
}

.autopilot-section-title {
    font-size: 12px;
    font-weight: 700;
    color: #334155;
    margin-bottom: 4px;
}

.autopilot-tasks {
    display: grid;
    gap: 6px;
}

.autopilot-task-item {
    border: 1px solid #e5e7eb;
    border-radius: 9px;
    background: #fff;
    padding: 6px 8px;
}

.autopilot-task-type {
    font-size: 12px;
    font-weight: 700;
    color: #0f172a;
}

.autopilot-task-name {
    font-size: 12px;
    color: #111827;
    line-height: 1.25;
}

.autopilot-task-meta {
    font-size: 11px;
    color: #64748b;
}

.autopilot-stale-hint {
    font-size: 11px;
    margin-top: 5px;
    color: #9a3412;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 8px;
    padding: 6px 8px;
}

.autopilot-footer {
    margin-top: 4px;
    font-size: 11px;
    color: #64748b;
    text-align: center;
}

@media (max-width: 991px) {
    .autopilot-nav-btn {
        width: 100%;
        margin-bottom: 8px;
    }

    .autopilot-panel {
        width: min(350px, calc(100vw - 16px));
        right: 8px;
    }
}

