:root {
    --brand-blue: #2563eb;
    --brand-blue-dark: #1d4ed8;
    --brand-purple: #7c3aed;
    --brand-purple-dark: #6d28d9;
    --brand-black: #0f0f14;
    --brand-black-soft: #1a1a24;
    --brand-white: #ffffff;
    --brand-gray-50: #f8fafc;
    --brand-gray-100: #f1f5f9;
    --brand-gray-200: #e2e8f0;
    --brand-gray-500: #64748b;
    --brand-gray-700: #334155;
    --brand-gray-900: #0f172a;
    --shadow-sm: 0 1px 2px rgba(15, 15, 20, 0.06);
    --shadow-md: 0 4px 16px rgba(37, 99, 235, 0.08), 0 2px 6px rgba(15, 15, 20, 0.04);
    --shadow-lg: 0 12px 40px rgba(124, 58, 237, 0.12), 0 4px 12px rgba(15, 15, 20, 0.08);
    --radius: 0.75rem;
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

[x-cloak] { display: none !important; }

body {
    background: linear-gradient(135deg, var(--brand-gray-50) 0%, #eef2ff 50%, #f5f3ff 100%);
    min-height: 100vh;
}

/* Loading bar */
#page-loader {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0;
    z-index: 9999;
    background: linear-gradient(90deg, var(--brand-blue), var(--brand-purple));
    transition: width 0.3s ease;
    box-shadow: 0 0 12px rgba(124, 58, 237, 0.6);
}
#page-loader.active { width: 70%; }
#page-loader.done { width: 100%; opacity: 0; transition: width 0.2s, opacity 0.3s 0.1s; }

/* Animations */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-8px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes pulse-soft {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.animate-fade-in-up { animation: fadeInUp 0.45s ease forwards; }
.animate-fade-in { animation: fadeIn 0.35s ease forwards; }
.animate-slide-in { animation: slideInLeft 0.35s ease forwards; }
.stagger-1 { animation-delay: 0.05s; opacity: 0; }
.stagger-2 { animation-delay: 0.1s; opacity: 0; }
.stagger-3 { animation-delay: 0.15s; opacity: 0; }
.stagger-4 { animation-delay: 0.2s; opacity: 0; }

/* Sidebar */
.sidebar-dark,
.sidebar-advanced {
    background: linear-gradient(180deg, var(--brand-black) 0%, var(--brand-black-soft) 35%, #1e1b4b 100%);
    border-right: 1px solid rgba(124, 58, 237, 0.25);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
}
.sidebar-section-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.35);
    padding: 0 0.75rem;
}
.sidebar-stat {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.5rem;
    padding: 0.5rem 0.625rem;
    text-align: center;
    transition: var(--transition);
}
.sidebar-stat:hover {
    background: rgba(124, 58, 237, 0.15);
    border-color: rgba(124, 58, 237, 0.3);
}
.sidebar-stat-value {
    display: block;
    font-size: 1.125rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}
.sidebar-stat-label {
    display: block;
    font-size: 0.625rem;
    color: rgba(255, 255, 255, 0.45);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.125rem;
}
.nav-badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    background: rgba(124, 58, 237, 0.35);
    color: #e9d5ff;
}
.nav-item-sub {
    padding-left: 2rem !important;
    font-size: 0.8125rem;
    opacity: 0.85;
}
.nav-item-nested {
    padding-left: 2.75rem !important;
    font-size: 0.75rem;
    opacity: 0.8;
}
.nav-item-static {
    cursor: default;
    pointer-events: none;
}
/* Sidebar: show real submenu labels before a context project exists (non-interactive preview) */
.sidebar-advanced .nav-item.nav-item-sub.nav-item-disabled-preview {
    cursor: not-allowed;
    opacity: 0.55 !important;
    transform: none !important;
}
.sidebar-advanced .nav-item.nav-item-sub.nav-item-disabled-preview::before {
    display: none;
}
.nav-group {
    border-radius: 0.625rem;
    padding: 0.125rem;
}
.nav-group-active {
    background: rgba(124, 58, 237, 0.08);
    box-shadow: inset 0 0 0 1px rgba(124, 58, 237, 0.15);
}
.nav-group-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.5rem 0.625rem;
    border-radius: 0.5rem;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(255, 255, 255, 0.55);
    transition: var(--transition);
}
.nav-group-toggle:hover {
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.85);
}
.nav-group-body {
    padding-left: 0.125rem;
}
.nav-subsection-label {
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(255, 255, 255, 0.28);
    padding: 0.5rem 0.75rem 0.125rem 1.75rem;
}
.nav-nested {
    padding-left: 0.25rem;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    margin-left: 1.25rem;
}
.nav-badge-sm {
    font-size: 0.6rem;
    padding: 0.05rem 0.35rem;
}
.nav-badge-muted {
    background: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.55);
}
.nav-badge-live {
    background: rgba(52, 211, 153, 0.25);
    color: #a7f3d0;
}
.nav-badge-warn {
    background: rgba(251, 191, 36, 0.25);
    color: #fde68a;
}
.sidebar-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.55);
    font-weight: 600;
}
.sidebar-pill-live {
    background: rgba(52, 211, 153, 0.15);
    color: #6ee7b7;
}
.sidebar-pill-pending {
    background: rgba(251, 191, 36, 0.12);
    color: #fcd34d;
}
.sidebar-search {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    padding: 0.375rem 0.625rem;
    font-size: 0.75rem;
    color: #fff;
}
.sidebar-search::placeholder { color: rgba(255, 255, 255, 0.35); }
.sidebar-search:focus {
    outline: none;
    border-color: var(--brand-purple);
    box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.25);
}
.sidebar-project-link {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    transition: var(--transition);
    text-decoration: none;
}
.sidebar-project-link:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(2px);
}
.sidebar-project-link.active {
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.25), rgba(124, 58, 237, 0.25));
    border: 1px solid rgba(124, 58, 237, 0.35);
}
.sidebar-project-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    flex-shrink: 0;
}
.sidebar-project-dot.dot-active { background: #34d399; box-shadow: 0 0 6px #34d399; }
/* Custom scrollbars — sidebar & app */
.sidebar-scroll,
.scrollbar-thin {
    scrollbar-width: thin;
    scrollbar-color: rgba(124, 58, 237, 0.55) rgba(255, 255, 255, 0.04);
}
.sidebar-scroll::-webkit-scrollbar,
.scrollbar-thin::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
.sidebar-scroll::-webkit-scrollbar-track,
.scrollbar-thin::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 999px;
    margin: 4px 0;
}
.sidebar-scroll::-webkit-scrollbar-thumb,
.scrollbar-thin::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(37, 99, 235, 0.5), rgba(124, 58, 237, 0.65));
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: padding-box;
}
.sidebar-scroll::-webkit-scrollbar-thumb:hover,
.scrollbar-thin::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(59, 130, 246, 0.75), rgba(139, 92, 246, 0.85));
    background-clip: padding-box;
}
.sidebar-scroll::-webkit-scrollbar-corner,
.scrollbar-thin::-webkit-scrollbar-corner {
    background: transparent;
}
/* Recent projects list — nested scroll */
.sidebar-projects-scroll {
    max-height: 200px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 2px;
    margin-right: -2px;
}
.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.65);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}
.nav-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, var(--brand-blue), var(--brand-purple));
    opacity: 0;
    transition: var(--transition);
}
.nav-item:hover {
    color: #fff;
    transform: translateX(4px);
}
.nav-item:hover::before { opacity: 0.15; }
.nav-item.active {
    color: #fff;
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.35), rgba(124, 58, 237, 0.35));
    box-shadow: inset 0 0 0 1px rgba(124, 58, 237, 0.4);
}
.nav-item svg, .nav-item span { position: relative; z-index: 1; }

/* Collapsed rail polish */
.sidebar-advanced[data-collapsed="1"] .nav-item {
    justify-content: center;
    padding-left: 0.625rem;
    padding-right: 0.625rem;
}
.sidebar-advanced[data-collapsed="1"] .nav-item:hover {
    transform: none;
}
.sidebar-advanced[data-collapsed="1"] .nav-group {
    padding: 0;
}
.sidebar-advanced[data-collapsed="1"] .sidebar-section-label {
    text-align: center;
    padding-left: 0;
    padding-right: 0;
}
.sidebar-advanced[data-collapsed="1"] .nav-group-toggle {
    justify-content: center;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

/* Cards */
.ui-card {
    background: var(--brand-white);
    border-radius: var(--radius);
    border: 1px solid var(--brand-gray-200);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}
.ui-card:hover { box-shadow: var(--shadow-md); }
.ui-card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--brand-gray-200);
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.03), rgba(124, 58, 237, 0.03));
}

/* Stat cards */
.stat-card {
    background: var(--brand-white);
    border-radius: var(--radius);
    border: 1px solid var(--brand-gray-200);
    padding: 1.25rem;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}
.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--brand-blue), var(--brand-purple));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}
.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(124, 58, 237, 0.3);
}
.stat-card:hover::after { transform: scaleX(1); }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 0.5rem;
    transition: var(--transition);
    cursor: pointer;
    border: none;
    text-decoration: none;
    white-space: nowrap;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary {
    background: linear-gradient(135deg, var(--brand-blue), var(--brand-purple));
    color: #fff;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.45);
    filter: brightness(1.05);
}
.btn-secondary {
    background: var(--brand-white);
    color: var(--brand-gray-700);
    border: 1px solid var(--brand-gray-200);
}
.btn-secondary:hover {
    background: var(--brand-gray-50);
    border-color: var(--brand-purple);
    color: var(--brand-purple);
}
.btn-ghost {
    background: transparent;
    color: var(--brand-gray-700);
    border: 1px solid transparent;
}
.btn-ghost:hover {
    background: rgba(124, 58, 237, 0.08);
    color: var(--brand-purple);
}
.btn-danger {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}
.btn-danger:hover { background: #fee2e2; }

/* Back button */
.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.875rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--brand-gray-700);
    background: var(--brand-white);
    border: 1px solid var(--brand-gray-200);
    border-radius: 9999px;
    transition: var(--transition);
    text-decoration: none;
}
.back-btn:hover {
    color: var(--brand-purple);
    border-color: var(--brand-purple);
    transform: translateX(-3px);
    box-shadow: var(--shadow-sm);
}
.back-btn svg { transition: transform 0.2s; }
.back-btn:hover svg { transform: translateX(-2px); }

/* Tables */
.ui-table thead { background: linear-gradient(90deg, #f8fafc, #f5f3ff); }
.ui-table tbody tr {
    transition: var(--transition);
}
.ui-table tbody tr:hover {
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.04), rgba(124, 58, 237, 0.04));
}

/* Form inputs */
.ui-input, .ui-select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    border: 1px solid var(--brand-gray-200);
    border-radius: 0.5rem;
    background: var(--brand-white);
    transition: var(--transition);
}
.ui-input:focus, .ui-select:focus {
    outline: none;
    border-color: var(--brand-purple);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 9999px;
}
.badge-live { background: #dcfce7; color: #166534; }
.badge-pending { background: #fef9c3; color: #854d0e; }
.badge-active { background: #dbeafe; color: #1e40af; }
.badge-inactive { background: #f1f5f9; color: #475569; }

/* Toast */
.toast {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 9998;
    min-width: 280px;
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    animation: fadeInUp 0.35s ease;
}
.toast-success {
    background: linear-gradient(135deg, #059669, #10b981);
    color: #fff;
}
.toast-error {
    background: linear-gradient(135deg, #dc2626, #ef4444);
    color: #fff;
}

/* Modal */
.modal-backdrop {
    background: rgba(15, 15, 20, 0.6);
    backdrop-filter: blur(4px);
}
.modal-panel {
    animation: fadeInUp 0.3s ease;
    background: var(--brand-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(124, 58, 237, 0.2);
}

/* Page wrapper */
.page-content {
    padding: 1.5rem;
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    box-sizing: border-box;
}

#main-content {
    width: 100%;
}

.dashboard-grid,
.insights-grid {
    display: grid;
    width: 100%;
    gap: 1rem;
}

.dashboard-grid--hero {
    grid-template-columns: 1fr;
}

@media (min-width: 1024px) {
    .dashboard-grid--hero {
        grid-template-columns: 1.7fr 1fr;
        align-items: stretch;
    }

    .dashboard-grid--hero .chart-panel--radial {
        justify-content: center;
    }
}

.dashboard-grid--triple {
    grid-template-columns: 1fr;
}

@media (min-width: 768px) {
    .dashboard-grid--triple {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1280px) {
    .dashboard-grid--triple {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.dashboard-grid--pair {
    grid-template-columns: 1fr;
}

@media (min-width: 768px) {
    .dashboard-grid--pair {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.dashboard-grid--three {
    grid-template-columns: 1fr;
}

@media (min-width: 768px) {
    .dashboard-grid--three {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .dashboard-grid--three {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.dashboard-grid--insights {
    grid-template-columns: 1fr;
}

@media (min-width: 768px) {
    .dashboard-grid--insights {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.insights-grid--quad {
    grid-template-columns: 1fr;
}

@media (min-width: 768px) {
    .insights-grid--quad {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .insights-grid--quad {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1280px) {
    .insights-grid--quad {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .insights-grid--quad .chart-panel--radial {
        min-height: 280px;
    }
}

.insights-grid--reports {
    grid-template-columns: 1fr;
}

@media (min-width: 1024px) {
    .insights-grid--reports {
        grid-template-columns: 2fr 1fr;
    }
}

.chart-panel {
    width: 100%;
    min-width: 0;
}

.chart-panel--radial {
    min-height: 300px;
}

.chart-panel--radial .chart-panel__body {
    min-height: 220px;
}

.chart-panel--radial .chart-canvas-wrap {
    margin-left: auto;
    margin-right: auto;
}

.chart-canvas-wrap {
    position: relative;
}

.chart-canvas-wrap canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
    max-width: 100%;
    max-height: 100%;
}
.page-title {
    font-size: 1.75rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--brand-black), var(--brand-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Skeleton loader */
.skeleton {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 0.25rem;
}

/* Header bar */
.top-header {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--brand-gray-200);
}

/* Link hover in content */
.link-brand {
    color: var(--brand-blue);
    transition: var(--transition);
}
.link-brand:hover { color: var(--brand-purple); text-decoration: underline; }

/* Filter chips */
.filter-chip {
    display: inline-flex;
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 999px;
    border: 1px solid var(--brand-gray-200);
    background: #fff;
    color: var(--brand-gray-700);
    transition: var(--transition);
}
.filter-chip:hover { border-color: var(--brand-purple); color: var(--brand-purple); background: #faf5ff; }
.filter-chip.active { background: linear-gradient(135deg, var(--brand-blue), var(--brand-purple)); color: #fff; border-color: transparent; }

/* Project badges */
.badge-service, .badge-status {
    display: inline-flex;
    padding: 0.125rem 0.5rem;
    font-size: 0.65rem;
    font-weight: 600;
    border-radius: 999px;
}
.badge-seo { background: #dbeafe; color: #1e40af; }
.badge-seo_gmb { background: #e0e7ff; color: #3730a3; }
.badge-gmb { background: #fef3c7; color: #92400e; }
.badge-active { background: #d1fae5; color: #065f46; }
.badge-on_hold { background: #fef3c7; color: #92400e; }

/* Project cards grid */
.project-card {
    background: #fff;
    border: 1px solid var(--brand-gray-200);
    border-radius: var(--radius);
    padding: 1.25rem;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}
.project-card:hover {
    border-color: rgba(124, 58, 237, 0.4);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

/* Global search palette */
.global-search-panel {
    background: #fff;
    border-radius: 1rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(124, 58, 237, 0.2);
}
.global-search-result {
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    transition: var(--transition);
    margin-bottom: 0.25rem;
}
.global-search-result:hover { background: linear-gradient(90deg, #eff6ff, #f5f3ff); }
.global-search-type {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--brand-purple);
    margin-bottom: 0.15rem;
}

/* Initial audit report — premium read view */
.initial-audit-hero {
    position: relative;
    overflow: hidden;
    border-radius: 1.25rem;
    border: 1px solid rgba(124, 58, 237, 0.18);
    background:
        radial-gradient(ellipse 100% 80% at 10% -30%, rgba(124, 58, 237, 0.16), transparent 55%),
        radial-gradient(ellipse 70% 50% at 95% -10%, rgba(37, 99, 235, 0.12), transparent 50%),
        linear-gradient(165deg, #faf5ff 0%, #ffffff 38%, #f8fafc 100%);
    box-shadow:
        var(--shadow-lg),
        inset 0 1px 0 rgba(255, 255, 255, 0.85);
}
.initial-audit-hero::after {
    content: '';
    position: absolute;
    inset: auto -20% -40% auto;
    width: min(520px, 70vw);
    height: min(520px, 70vw);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(124, 58, 237, 0.07) 0%, transparent 70%);
    pointer-events: none;
}
.initial-audit-kpi {
    position: relative;
    border-radius: 1rem;
    border: 1px solid rgba(226, 232, 240, 0.9);
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(248, 250, 252, 0.98));
    box-shadow:
        var(--shadow-sm),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    transition: transform 0.22s ease, border-color var(--transition), box-shadow var(--transition);
}
.initial-audit-kpi:hover {
    transform: translateY(-2px);
    border-color: rgba(124, 58, 237, 0.28);
    box-shadow: var(--shadow-md);
}
.initial-audit-section {
    border-radius: 1rem;
    border: 1px solid rgba(226, 232, 240, 0.95);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.initial-audit-section summary::-webkit-details-marker { display: none; }
.initial-audit-section summary {
    list-style: none;
}
.initial-audit-section[open] {
    border-color: rgba(124, 58, 237, 0.22);
    box-shadow: var(--shadow-md);
}
.initial-audit-section[open] > summary {
    background: linear-gradient(90deg, rgba(239, 246, 255, 0.65), rgba(250, 245, 255, 0.5));
}
.initial-audit-fields-grid .initial-audit-field:only-child {
    grid-column: 1 / -1;
}
@media (min-width: 768px) {
    .initial-audit-fields-grid .initial-audit-field:last-child:nth-child(odd):not(:only-child) {
        grid-column: 1 / -1;
    }
}
.initial-audit-field {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    text-align: left;
    border-radius: 0.75rem;
    border: 1px solid rgba(241, 245, 249, 0.95);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(248, 250, 252, 0.65));
    transition: border-color var(--transition);
}
.initial-audit-field dt {
    align-self: flex-start;
}
.initial-audit-field dd {
    width: 100%;
    margin: 0;
    text-align: left;
}
.initial-audit-field:hover {
    border-color: rgba(167, 139, 250, 0.35);
}

/* Keywords panel (collapsible, optional sidebar on lg+) */
.initial-audit-kw-panel {
    border-radius: 1rem;
    border: 1px solid rgba(226, 232, 240, 0.95);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.initial-audit-kw-panel summary::-webkit-details-marker {
    display: none;
}
.initial-audit-kw-panel summary {
    list-style: none;
}
.initial-audit-kw-panel summary .initial-audit-kw-chevron {
    transition: transform 0.2s ease;
}
.initial-audit-kw-panel[open] summary .initial-audit-kw-chevron {
    transform: rotate(180deg);
}

/* Keyword table: gentle scroll region (~15 tbody rows visible) */
.initial-audit-kw-scroll {
    --audit-kw-thead-h: 2.75rem;
    --audit-kw-row: 3rem;
    --audit-kw-visible-rows: 15;
    max-height: calc(var(--audit-kw-thead-h) + var(--audit-kw-visible-rows) * var(--audit-kw-row));
    overflow: auto;
    overscroll-behavior: contain;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(124, 58, 237, 0.32) rgba(241, 245, 249, 0.95);
}
.initial-audit-kw-scroll::-webkit-scrollbar {
    width: 9px;
    height: 9px;
}
.initial-audit-kw-scroll::-webkit-scrollbar-track {
    background: rgba(241, 245, 249, 0.9);
    border-radius: 9999px;
}
.initial-audit-kw-scroll::-webkit-scrollbar-thumb {
    background: rgba(124, 58, 237, 0.28);
    border-radius: 9999px;
}
.initial-audit-kw-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(124, 58, 237, 0.45);
}
.initial-audit-kw-scroll .initial-audit-kw-table {
    border-collapse: separate;
    border-spacing: 0;
}
.initial-audit-kw-scroll .initial-audit-kw-table thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    box-shadow: 0 1px 0 rgba(226, 232, 236, 0.95);
}
.initial-audit-kw-table thead th {
    font-size: 0.625rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 700;
    color: #64748b;
    background: linear-gradient(180deg, #f8fafc, #f1f5f9);
}

/* Target URLs — premium table & summary strip */

.tu-table-premium thead th {
    font-size: 0.625rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-weight: 700;
}

.tu-table-premium thead a {
    color: #475569;
    transition: color 0.18s ease, transform 0.18s ease;
}

.tu-table-premium thead a:hover {
    color: #7c3aed;
}

.tu-chip {
    display: inline-flex;
    align-items: center;
    border-radius: 9999px;
    padding: 0.125rem 0.5rem;
    font-size: 0.625rem;
    line-height: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.015em;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.tu-chip-warn {
    background: linear-gradient(180deg, #fffbeb 0%, #fde68a 100%);
    color: #713f12;
    border: 1px solid rgba(245, 158, 11, 0.35);
}

.tu-chip-live {
    background: linear-gradient(180deg, #ecfdf5 0%, #bbf7d0 100%);
    color: #14532d;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.tu-chip-neutral {
    background: linear-gradient(180deg, #f8fafc 0%, #e2e8f0 100%);
    color: #1e293b;
    border: 1px solid rgba(148, 163, 184, 0.4);
}

.tu-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0.875rem;
    border-radius: 0.875rem;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
    transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
    border: 1px solid rgb(226 232 240 / 0.95);
    background: #fff;
    color: #475569;
    box-shadow: 0 2px 6px rgb(15 23 42 / 0.04);
}

@media (hover: hover) {
    .tu-action:hover {
        border-color: rgb(167 139 250 / 0.45);
        color: rgb(109 40 217);
        box-shadow: 0 8px 20px rgb(124 58 237 / 0.12);
        transform: translateY(-1px);
    }

    .tu-action-primary:hover {
        color: #fff;
        filter: saturate(1.08) brightness(1.05);
    }

    .tu-action-danger:hover {
        border-color: rgb(248 113 113);
        color: rgb(127 29 29);
        box-shadow: 0 4px 16px rgb(239 68 68 / 0.15);
    }
}

.tu-action-primary {
    background: linear-gradient(145deg, #7c3aed 0%, #5b21b6 110%);
    color: #faf5ff;
    border: 1px solid rgb(91 33 182 / 0.45);
    box-shadow: 0 4px 14px rgb(124 58 237 / 0.3);
}

.tu-action-danger {
    border-color: rgb(254 202 202);
    background: rgb(254 242 242);
    color: rgb(153 27 27);
}

/* Icon-only compact row actions (Target URLs grid) */

.tu-action-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    flex-shrink: 0;
    border-radius: 0.5625rem;
    border: 1px solid rgb(226 232 240 / 0.95);
    background: #fff;
    color: #64748b;
    box-shadow: 0 1px 4px rgb(15 23 42 / 0.05);
    text-decoration: none;
    vertical-align: middle;
    cursor: pointer;
    transition:
        transform 0.14s ease,
        box-shadow 0.18s ease,
        border-color 0.18s ease,
        color 0.18s ease,
        filter 0.18s ease;
}

.tu-action-icon-svg {
    width: 1rem;
    height: 1rem;
    stroke-width: 2;
}

button.tu-action-icon {
    font: inherit;
    padding: 0;
    appearance: none;
    -webkit-appearance: none;
}

.tu-action-icon:focus-visible {
    outline: none;
    box-shadow:
        0 0 0 2px #fff,
        0 0 0 4px rgb(124 58 237 / 0.45);
}

@media (hover: hover) {
    .tu-action-icon:hover:not(:disabled) {
        border-color: rgb(167 139 250 / 0.4);
        color: rgb(91 33 182);
        box-shadow: 0 6px 16px rgb(124 58 237 / 0.12);
        transform: translateY(-1px);
    }

    .tu-action-icon-primary:hover {
        filter: saturate(1.08) brightness(1.06);
        color: #faf5ff;
    }

    .tu-action-icon-danger:hover {
        border-color: rgb(248 113 113);
        background: rgb(254 226 226);
        color: rgb(127 29 29);
    }
}

.tu-action-icon-primary {
    background: linear-gradient(148deg, #7c3aed 0%, #5b21b6 112%);
    color: #faf5ff;
    border-color: rgb(91 33 182 / 0.5);
    box-shadow: 0 2px 10px rgb(124 58 237 / 0.28);
}

.tu-action-icon-danger {
    border-color: rgb(254 202 202);
    background: rgb(254 242 242 / 0.95);
    color: rgb(185 28 28);
}

.tu-stat-chip {
    background: linear-gradient(180deg, #ffffff 0%, #fafbfc 65%, rgb(249 248 255) 100%);
    padding: 1.25rem 1.75rem;
    position: relative;
}

@media (min-width: 640px) {
    .tu-stat-chip {
        padding: 1.35rem 2rem;
    }
}

.tu-stat-chip::before {
    content: "";
    position: absolute;
    inset: auto 15% -1px 15%;
    height: 4px;
    border-radius: 9999px;
    background: linear-gradient(90deg, transparent 0%, rgb(124 58 237 / 0.08) 50%, transparent 100%);
    pointer-events: none;
}

.tu-stat-label {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgb(148 163 184);
}

.tu-stat-value {
    font-size: 1.875rem;
    font-weight: 800;
    line-height: 1.05;
    color: rgb(15 23 42);
    font-variant-numeric: tabular-nums;
}

.tu-stat-ico {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.85rem;
    height: 2.85rem;
    border-radius: 1rem;
    flex-shrink: 0;
    box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.5);
}

.tu-stat-ico-blue {
    background: linear-gradient(145deg, #dbeafe 0%, #ede9fe 100%);
    color: #4338ca;
}

.tu-stat-ico-emerald {
    background: linear-gradient(145deg, #d1fae5 0%, #ccfbf1 100%);
    color: #047857;
}

.tu-stat-ico-violet {
    background: linear-gradient(145deg, #ede9fe 0%, #e0f2fe 100%);
    color: #7c3aed;
}

.tu-stat-ico-amber {
    background: linear-gradient(145deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
}

/* Projects index — filters + segmented toggle */

.pj-stat-tile {
    padding-top: 1rem !important;
    padding-bottom: 1rem !important;
}

@media (min-width: 640px) {
    .pj-stat-tile {
        padding: 1.1rem 1.35rem !important;
    }
}

.pj-stat-tile .tu-stat-value {
    font-size: clamp(1.35rem, 3vw, 1.75rem);
}

.pj-select-full {
    width: 100%;
    appearance: none;
    border-radius: 1rem;
    border: 1px solid rgb(226 232 240 / 1);
    background: rgb(255 255 255);
    padding: 0.675rem 2.75rem 0.675rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: rgb(30 41 59);
    box-shadow: inset 0 2px 4px rgb(15 23 42 / 0.04);
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.pj-select-full:hover {
    border-color: rgb(196 181 253 / 0.8);
}

.pj-select-full:focus {
    outline: none;
    border-color: rgb(167 139 250 / 0.95);
    box-shadow:
        inset 0 2px 4px rgb(15 23 42 / 0.04),
        0 0 0 4px rgb(124 58 237 / 0.14);
}

.pj-segment-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.025em;
    text-transform: uppercase;
    cursor: pointer;
    border: none;
    background: transparent;
    color: rgb(71 85 105);
    transition:
        transform 0.15s ease,
        box-shadow 0.2s ease,
        filter 0.2s ease;
}

.pj-segment-idle {
    color: rgb(71 85 105);
}

@media (hover: hover) {
    .pj-segment-idle:hover {
        color: rgb(91 33 182);
    }
}

.pj-segment-active {
    background: linear-gradient(148deg, #7c3aed 0%, #5b21b6 112%);
    color: #faf5ff;
    box-shadow: 0 4px 16px rgb(124 58 237 / 0.28);
}

.pj-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.375rem 0.875rem;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-radius: 9999px;
    border: 1px solid rgb(226 232 240 / 1);
    background: rgb(255 255 255);
    color: rgb(71 85 105);
    text-decoration: none;
    transition:
        border-color 0.2s ease,
        color 0.2s ease,
        box-shadow 0.2s ease;
}

@media (hover: hover) {
    .pj-filter-chip:hover {
        border-color: rgb(167 139 250 / 0.75);
        color: rgb(91 33 182);
        box-shadow: 0 4px 14px rgb(124 58 237 / 0.1);
    }
}

.pj-filter-chip-active {
    background: linear-gradient(135deg, var(--brand-blue), var(--brand-purple));
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 14px rgb(124 58 237 / 0.25);
}

.pj-pagination-wrap nav[role='navigation'],
.pj-pagination-wrap .pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.pj-pagination-wrap nav a,
.pj-pagination-wrap nav span {
    display: inline-flex;
    min-width: 2rem;
    height: 2rem;
    align-items: center;
    justify-content: center;
    padding: 0 0.65rem;
    font-size: 0.8125rem;
    font-weight: 600;
    border-radius: 0.65rem;
    border: 1px solid rgb(226 232 240 / 1);
    background: #fff;
    color: rgb(71 85 105);
}

.pj-pagination-wrap nav span[aria-current='page'],
.pj-pagination-wrap nav .active span {
    background: linear-gradient(148deg, #7c3aed 0%, #5b21b6 112%);
    color: #fff;
    border-color: rgb(109 40 217);
}

.pj-pagination-wrap nav span[aria-disabled],
.pj-pagination-wrap nav .disabled span {
    opacity: 0.45;
    cursor: default;
}

/* Compact projects filter deck (narrower selects + tighter chips inside .pj-filter-deck-compact) */

.pj-filter-deck-compact .pj-select-full {
    padding: 0.35rem 1.65rem 0.35rem 0.5rem;
    font-size: 0.8125rem;
    line-height: 1.25;
    border-radius: 0.5rem;
}

.pj-filter-deck-compact .pj-filter-chip {
    padding: 0.25rem 0.625rem;
    font-size: 0.6875rem;
    letter-spacing: 0.052em;
}

