/* Smart Quick-Input & Auto-Pilot Styling */
.smart-autopilot-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 40%, #f0fdf4 100%);
    border: 1px solid #bbf7d0;
    border-radius: var(--radius-lg, 12px);
    box-shadow:
        0 4px 20px -2px rgba(16, 185, 129, 0.08),
        0 2px 6px -1px rgba(0, 0, 0, 0.04);
    margin-bottom: 24px;
    padding: 22px 24px;
    position: relative;
    overflow: hidden;
    transition: all 0.25s ease;
}

.smart-autopilot-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #10b981 0%, #06b6d4 50%, #6366f1 100%);
}

.smart-autopilot-card.highlight-pulse {
    animation: autopilotPulse 1.4s ease-out;
}

@keyframes autopilotPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6);
    }
    70% {
        box-shadow: 0 0 0 14px rgba(16, 185, 129, 0);
    }
    100% {
        box-shadow: 0 4px 20px -2px rgba(16, 185, 129, 0.08);
    }
}

.autopilot-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid #e2e8f0;
}

.autopilot-title-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.autopilot-icon-badge {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
    flex-shrink: 0;
}

.autopilot-title-group h2 {
    font-size: 17px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.autopilot-badge {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
    padding: 2px 8px;
    border-radius: 999px;
}

.autopilot-subtitle {
    font-size: 12.5px;
    color: #64748b;
    margin: 3px 0 0 0;
}

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

.btn-autopilot-toggle {
    background: transparent;
    border: none;
    color: #64748b;
    cursor: pointer;
    padding: 4px 6px;
    font-size: 12px;
    border-radius: 4px;
}

.btn-autopilot-toggle:hover {
    color: #0f172a;
    background: #f1f5f9;
}

/* Quick Input Rows */
.autopilot-section-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #475569;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.autopilot-client-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 12px;
    margin-bottom: 18px;
}

@media (max-width: 900px) {
    .autopilot-client-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 580px) {
    .autopilot-client-grid {
        grid-template-columns: 1fr;
    }
}

.autopilot-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.autopilot-metric-box {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 12px;
    transition: all 0.2s ease;
    position: relative;
}

.autopilot-metric-box:hover,
.autopilot-metric-box:focus-within {
    border-color: #10b981;
    box-shadow: 0 2px 10px rgba(16, 185, 129, 0.1);
}

.autopilot-metric-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.autopilot-metric-title {
    font-size: 12px;
    font-weight: 600;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 5px;
}

.autopilot-metric-source {
    font-size: 10px;
    font-weight: 600;
    padding: 1px 5px;
    border-radius: 4px;
    background: #f1f5f9;
    color: #475569;
}

.source-ga4 {
    background: #fef3c7;
    color: #92400e;
}
.source-gsc {
    background: #e0e7ff;
    color: #3730a3;
}
.source-semrush {
    background: #ffedd5;
    color: #9a3412;
}
.source-leads {
    background: #ecfdf5;
    color: #065f46;
}

.autopilot-inputs-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.autopilot-input-wrap {
    flex: 1;
}

.autopilot-input-wrap label {
    display: block;
    font-size: 10px;
    color: #64748b;
    margin-bottom: 2px;
    font-weight: 500;
}

.autopilot-input {
    width: 100%;
    padding: 6px 8px;
    font-size: 12.5px;
    font-weight: 600;
    color: #0f172a;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 5px;
    font-family: inherit;
    transition: all 0.15s ease;
}

.autopilot-input:focus {
    background: #ffffff;
    border-color: #10b981;
    outline: none;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.autopilot-diff-badge {
    font-size: 10.5px;
    font-weight: 700;
    padding: 3px 6px;
    border-radius: 4px;
    background: #f1f5f9;
    color: #64748b;
    white-space: nowrap;
    align-self: flex-end;
    margin-bottom: 1px;
    min-width: 45px;
    text-align: center;
}

.autopilot-diff-badge.up {
    background: #dcfce7;
    color: #15803d;
}

.autopilot-diff-badge.down {
    background: #fee2e2;
    color: #b91c1c;
}

.autopilot-diff-badge.neutral {
    background: #f1f5f9;
    color: #64748b;
}

/* Footer & BOOM Button */
.autopilot-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    padding-top: 14px;
    border-top: 1px solid #e2e8f0;
}

.btn-smart-boom {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 24px;
    font-size: 13.5px;
    font-weight: 700;
    letter-spacing: 0.3px;
    color: #ffffff;
    background: linear-gradient(135deg, #059669 0%, #10b981 50%, #0d9488 100%);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    box-shadow:
        0 4px 14px rgba(16, 185, 129, 0.35),
        0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    user-select: none;
}

.btn-smart-boom:hover {
    background: linear-gradient(135deg, #047857 0%, #059669 50%, #0f766e 100%);
    box-shadow:
        0 6px 20px rgba(16, 185, 129, 0.45),
        0 2px 4px rgba(0, 0, 0, 0.15);
    transform: translateY(-1.5px);
}

.btn-smart-boom:active {
    transform: translateY(0.5px);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
}

.btn-smart-boom .boom-bolt {
    font-size: 16px;
    animation: boomPulse 1.8s infinite ease-in-out;
}

@keyframes boomPulse {
    0%,
    100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.25);
    }
}

/* Table Toolbar Smart Auto-Fill Button */
.btn-table-magic-fill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11.5px;
    font-weight: 600;
    color: #047857;
    background: linear-gradient(135deg, #ffffff 0%, #ecfdf5 50%, #d1fae5 100%);
    border: 1px solid #6ee7b7;
    padding: 5px 11px;
    border-radius: var(--radius-sm, 6px);
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 0 1px 2px rgba(16, 185, 129, 0.08);
}

.btn-table-magic-fill:hover {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    border-color: #34d399;
    color: #065f46;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(16, 185, 129, 0.18);
}

/* Header Trigger Button */
.btn-quick-autopilot-nav {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%) !important;
    border-color: #059669 !important;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
    font-weight: 700 !important;
    letter-spacing: 0.2px;
}

.btn-quick-autopilot-nav:hover {
    background: linear-gradient(135deg, #047857 0%, #059669 100%) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
}

/* ========================================================
   Visual 6-Month Organic Sessions Trend Chart Inputs
   ======================================================== */
.trend-grid-wrapper {
    margin-top: 10px;
    margin-bottom: 12px;
}

.trend-months-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
}

@media (max-width: 900px) {
    .trend-months-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 520px) {
    .trend-months-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.trend-month-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 8px;
    text-align: center;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.trend-month-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.06);
}

.trend-month-card.is-prev {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.trend-month-card.is-current {
    background: #f0fdf4;
    border: 2px solid #10b981;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.15);
}

.trend-card-month-badge {
    font-size: 12px;
    font-weight: 700;
    color: #334155;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 6px;
    padding-bottom: 4px;
    border-bottom: 1px solid #f1f5f9;
}

.trend-month-card.is-current .trend-card-month-badge {
    color: #047857;
    border-color: #d1fae5;
}

.trend-card-input-wrap {
    margin: 4px 0;
}

.trend-card-input {
    text-align: center;
    font-weight: 700;
    font-size: 13.5px;
    color: #0f172a;
    height: 34px;
    padding: 2px 4px;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    transition: border-color 0.15s ease;
}

.trend-card-input:focus {
    border-color: #10b981;
    outline: none;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.trend-card-pct {
    margin-top: 6px;
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
}

.trend-card-pct.positive {
    color: #16a34a;
}

.trend-card-pct.negative {
    color: #dc2626;
}

.trend-card-pct.highlight {
    background: #dcfce7;
    color: #15803d;
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
}

.trend-summary-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 8px 14px;
    margin-top: 10px;
}

.trend-summary-left {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
}

.trend-calc-title {
    color: #64748b;
    font-weight: 600;
}

.trend-calc-text {
    font-weight: 700;
    color: #0f172a;
}

.btn-toggle-custom-sub {
    background: transparent;
    border: none;
    color: #4f46e5;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
}

.btn-toggle-custom-sub:hover {
    background: #eef2ff;
    text-decoration: underline;
}

/* ========================================================
   1-Click Preset Checkbox Chips / Pills
   ======================================================== */
.preset-chips-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
    margin-top: 2px;
}

.preset-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    font-size: 11.5px;
    font-weight: 600;
    border-radius: 20px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #475569;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
    line-height: 1.3;
}

.preset-chip:hover {
    border-color: #94a3b8;
    background: #f1f5f9;
    color: #1e293b;
    transform: translateY(-1px);
}

.preset-chip.active {
    background: #eff6ff;
    border-color: #60a5fa;
    color: #1d4ed8;
    box-shadow: 0 1px 3px rgba(37, 99, 235, 0.15);
}

.preset-chip.active::before {
    content: "✓ ";
    font-weight: 800;
    color: #2563eb;
}

/* Auto-Calc Live Badges */
.auto-calc-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    color: #047857;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: 4px;
    padding: 2px 8px;
}

/* ========================================================
   Smart Textarea Action Buttons (Top-Right of Textarea)
   ======================================================== */
.textarea-smart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 6px;
}

.textarea-smart-header .form-label {
    margin-bottom: 0;
}

.textarea-smart-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
}

.btn-smart-draft {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11.5px;
    font-weight: 600;
    color: #047857;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    padding: 3px 9px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    line-height: 1.4;
    white-space: nowrap;
    user-select: none;
}

.btn-smart-draft:hover {
    background: #d1fae5;
    border-color: #6ee7b7;
    color: #065f46;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.15);
}

.btn-smart-draft:active {
    transform: translateY(0);
}

.btn-smart-undo {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    color: #475569;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    padding: 3px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    line-height: 1.4;
    white-space: nowrap;
    user-select: none;
}

.btn-smart-undo:hover {
    background: #f1f5f9;
    color: #0f172a;
    border-color: #94a3b8;
}

/* Pulsing highlight animation when text is drafted */
.textarea-draft-pulse {
    animation: draftPulseAnimation 0.85s ease-out;
}

@keyframes draftPulseAnimation {
    0% {
        border-color: #10b981 !important;
        box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.35) !important;
        background-color: #f0fdf4 !important;
    }
    100% {
        border-color: #cbd5e1;
        box-shadow: none;
        background-color: #ffffff;
    }
}

/* ========================================================
   Table Top-Right "⚡ Sync to Tables" Action Button
   ======================================================== */
.btn-sync-tables-action {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-weight: 700 !important;
    background: linear-gradient(135deg, #059669 0%, #10b981 100%) !important;
    border-color: #059669 !important;
    color: #ffffff !important;
    box-shadow: 0 1px 3px rgba(16, 185, 129, 0.2);
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-sync-tables-action:hover {
    background: linear-gradient(135deg, #047857 0%, #059669 100%) !important;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(16, 185, 129, 0.3);
}



