/* AI Dashboard Styles - Matching Figma Design */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* CSS Variables */
:root {
    /* Primary Colors */
    --ai-primary: #8200DB;
    --ai-primary-light: #FAF5FF;
    --ai-primary-gradient: linear-gradient(135deg, #9810FA 0%, #2B7FFF 100%);

    /* Active Nav Colors (v2 - Blue) */
    --ai-nav-active-bg: #EFF6FF;
    --ai-nav-active-color: #1447E6;

    /* Text Colors */
    --ai-text-dark: #101828;
    --ai-text-medium: #364153;
    --ai-text-light: #4A5565;
    --ai-text-muted: #6A7282;

    /* Background Colors */
    --ai-bg-main: #F9FAFB;
    --ai-bg-white: #FFFFFF;

    /* Border Colors */
    --ai-border: #E5E7EB;

    /* Accent Colors */
    --ai-success: #00A63E;
    --ai-success-light: #00C950;
    --ai-blue: #2563EB;
    --ai-blue-light: #DBEAFE;
    --ai-green: #16A34A;
    --ai-green-light: #DCFCE7;
    --ai-purple: #9333EA;
    --ai-purple-light: #F3E8FF;
    --ai-orange: #EA580C;
    --ai-orange-light: #FFEDD4;

    /* Shadows */
    --ai-shadow-sm: 0px 1px 2px -1px rgba(0, 0, 0, 0.1), 0px 1px 3px 0px rgba(0, 0, 0, 0.1);

    /* Typography */
    --ai-font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Reset */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    font-family: var(--ai-font);
    background: var(--ai-bg-main);
    color: var(--ai-text-dark);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* App Container */
.ai-app {
    display: flex;
    min-height: 100vh;
}

/* ==================== SIDEBAR ==================== */
.ai-sidebar {
    width: 256px;
    background: var(--ai-bg-white);
    border-right: 1px solid var(--ai-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
}

/* Sidebar Header - Logo */
/* Height matches top header (72px) for aligned bottom border */
.ai-sidebar-header {
    padding: 16px 24px;
    height: 72px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--ai-border);
}

.ai-logo {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-logo-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.ai-logo-icon img {
    width: 100%;
    height: 100%;
}

.ai-logo-text {
    display: flex;
    flex-direction: column;
}

.ai-logo-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--ai-text-dark);
    line-height: 1.4;
    letter-spacing: -0.02em;
}

.ai-logo-subtitle {
    font-size: 12px;
    font-weight: 400;
    color: var(--ai-text-muted);
    line-height: 1.33;
}

/* Logo Link - makes logo clickable to return home */
.ai-logo-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.ai-logo-link:hover {
    opacity: 0.85;
}

.ai-logo-link:hover .ai-logo-title {
    color: var(--ai-primary);
}

/* Feedback link in sidebar footer */
.ai-feedback-link {
    color: var(--ai-text-muted);
    text-decoration: underline;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.15s ease;
}

.ai-feedback-link:hover {
    color: var(--ai-primary);
}

/* Sidebar Navigation */
.ai-sidebar-nav {
    flex: 1;
    padding: 12px;
    overflow-y: auto;
}

.ai-nav-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ai-nav-item {
    width: 100%;
}

.ai-nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 14px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--ai-text-medium);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    letter-spacing: -0.02em;
    transition: all 0.15s ease;
}

.ai-nav-link:hover {
    background: var(--ai-bg-main);
}

.ai-nav-link.active {
    background: var(--ai-nav-active-bg);
    color: var(--ai-nav-active-color);
}

.ai-nav-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.ai-nav-link.active .ai-nav-icon {
    filter: brightness(0) saturate(100%) invert(26%) sepia(93%) saturate(1803%) hue-rotate(218deg) brightness(96%) contrast(91%);
}

/* Navigation Badge */
.ai-nav-badge {
    margin-left: auto;
    background: #DC2626;
    color: #FFFFFF;
    font-size: 12px;
    font-weight: 500;
    padding: 2px 6px;
    border-radius: 10px;
    line-height: 1.33;
}

.ai-nav-badge-gray {
    background: #E5E7EB;
    color: #364153;
    margin-left: 0;
}

/* Navigation Connected Checkmark */
.nav-connected-check {
    margin-left: auto;
    flex-shrink: 0;
}

/* Navigation Chevron */
.ai-nav-chevron {
    margin-left: auto;
    transition: transform 0.2s ease;
}

.ai-nav-link-parent[data-expanded="true"] .ai-nav-chevron {
    transform: rotate(180deg);
}

/* Expandable Navigation */
.ai-nav-item-expandable {
    display: flex;
    flex-direction: column;
}

.ai-nav-submenu {
    list-style: none;
    margin-left: 32px;
    display: none;
    flex-direction: column;
    gap: 4px;
    margin-top: 4px;
}

/* Show submenu when expanded */
.ai-nav-link-parent[data-expanded="true"] + .ai-nav-submenu {
    display: flex;
}

.ai-nav-sublink {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-radius: 10px;
    text-decoration: none;
    color: var(--ai-text-medium);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.43;
    letter-spacing: -0.01em;
    transition: all 0.15s ease;
}

.ai-nav-sublink:hover {
    background: var(--ai-bg-main);
}

.ai-nav-sublink.active {
    background: var(--ai-primary-light, #EEF2FF);
    color: var(--ai-primary);
    font-weight: 500;
}

.ai-nav-sublink .ai-nav-icon {
    width: 16px;
    height: 16px;
}

/* Navigation Section Labels (Jobs-to-be-done grouping) */
.ai-nav-section-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ai-text-muted);
    padding: 10px 14px 4px;
    list-style: none;
    margin-top: 4px;
}

.ai-nav-section-label:first-of-type {
    margin-top: 0;
}

/* Hide channel items that are disabled */
.ai-nav-item[data-channel].disabled {
    display: none;
}

/* Sidebar Footer - Settings link */
.ai-sidebar-footer {
    padding: 12px 14px;
    border-top: 1px solid var(--ai-border);
    margin-top: auto;
}

.ai-sidebar-footer .ai-nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 14px;
    border-radius: 8px;
    color: var(--ai-text-medium);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.15s ease;
}

.ai-sidebar-footer .ai-nav-link:hover {
    background: var(--ai-bg-main);
}

.ai-sidebar-footer .ai-nav-icon {
    stroke: var(--ai-text-light);
}

.ai-user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 16px;
}

.ai-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #E5E7EB 0%, #D1D5DC 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ai-user-avatar span {
    font-size: 14px;
    font-weight: 600;
    color: var(--ai-text-medium);
    letter-spacing: -0.01em;
}

.ai-user-avatar-blue {
    background: #155DFC;
}

.ai-user-avatar-blue span {
    color: #FFFFFF;
}

.ai-user-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.ai-user-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--ai-text-dark);
    line-height: 1.43;
    letter-spacing: -0.01em;
}

.ai-user-plan,
.ai-user-email {
    font-size: 12px;
    font-weight: 400;
    color: var(--ai-text-muted);
    line-height: 1.33;
}

/* ==================== SIDEBAR COLLAPSED STATE ==================== */
.ai-sidebar {
    transition: width 0.3s ease;
}

.ai-sidebar.collapsed {
    width: 72px;
}

.ai-sidebar.collapsed .ai-logo-text,
.ai-sidebar.collapsed .ai-nav-link span,
.ai-sidebar.collapsed .ai-nav-badge,
.ai-sidebar.collapsed .ai-nav-chevron,
.ai-sidebar.collapsed .ai-nav-submenu,
.ai-sidebar.collapsed .ai-user-info,
.ai-sidebar.collapsed .ai-sidebar-footer,
.ai-sidebar.collapsed .nav-connected-check {
    display: none;
}

.ai-sidebar.collapsed .ai-sidebar-header {
    padding: 24px 16px;
    display: flex;
    justify-content: center;
}

.ai-sidebar.collapsed .ai-logo {
    justify-content: center;
}

.ai-sidebar.collapsed .ai-sidebar-nav {
    padding: 12px 8px;
}

.ai-sidebar.collapsed .ai-nav-link {
    justify-content: center;
    padding: 10px;
}

.ai-sidebar.collapsed .ai-nav-link .ai-nav-icon {
    margin: 0;
}

.ai-sidebar.collapsed .ai-user-profile {
    justify-content: center;
    padding: 0;
}

/* Main content transition when sidebar collapses */
.ai-main-content {
    transition: margin-left 0.3s ease;
}

.ai-app.sidebar-collapsed .ai-main-content {
    margin-left: 72px;
}

/* ==================== TOP HEADER ==================== */
.ai-top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
    height: 72px;
    background: var(--ai-bg-white);
    border-bottom: 1px solid var(--ai-border);
    position: relative;
    z-index: 200;
}

.ai-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.ai-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-header-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    transition: background 0.15s ease;
}

.ai-header-btn:hover {
    background: var(--ai-bg-main);
}

/* Header button images - fill button container */
.ai-header-btn img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Avatar button shows 38x38 image in 58x58 button (20% increase) */
.ai-avatar-btn img {
    width: 38px;
    height: 38px;
}

/* Notification button has 20x20 icon centered */
.ai-notification-btn img {
    width: 20px;
    height: 20px;
}

.ai-avatar-btn {
    width: 40px;
    height: 40px;
    padding: 0;
}

/* Avatar initials circle */
.avatar-initials {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand-primary, #0D9488) 0%, #0d7377 100%);
    color: white;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: 0.5px;
}

/* User Menu Dropdown */
.ai-user-menu-container {
    position: relative;
}

.ai-user-menu {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 180px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--ai-border);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1000;
    overflow: hidden;
    margin-top: 8px;
}

.ai-user-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.ai-user-menu-header {
    padding: 12px 16px;
    background: var(--ai-bg-main);
}

.ai-user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--ai-text-dark);
}

.ai-user-menu-divider {
    height: 1px;
    background: var(--ai-border);
}

.ai-user-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    border: none;
    background: none;
    font-size: 14px;
    color: var(--ai-text-medium);
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: left;
}

.ai-user-menu-item:hover {
    background: var(--ai-bg-main);
    color: #DC2626;
}

.ai-user-menu-item svg {
    flex-shrink: 0;
}

.ai-notification-btn {
    position: relative;
}

.ai-notification-dot {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 8px;
    height: 8px;
    background: #FB2C36;
    border-radius: 50%;
}

.ai-notification-count {
    position: absolute;
    top: 0;
    right: 0;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: #FB2C36;
    border-radius: 9px;
    font-size: 11px;
    font-weight: 600;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transform: translate(25%, -25%);
}

/* Search Bar */
.ai-search-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 16px;
    width: 448px;
    height: 44px;
    background: var(--ai-bg-main);
    border: 1px solid var(--ai-border);
    border-radius: 10px;
    cursor: pointer;
}

.ai-search-bar:hover {
    border-color: #D1D5DC;
}

.ai-search-placeholder {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: var(--ai-text-muted);
    letter-spacing: -0.01em;
}

.ai-search-kbd {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 0 8px;
    height: 26px;
    background: var(--ai-bg-white);
    border: 1px solid #D1D5DC;
    border-radius: 4px;
}

.ai-search-kbd span {
    font-size: 12px;
    font-weight: 500;
    color: var(--ai-text-muted);
}

/* ==================== MAIN CONTENT ==================== */
.ai-main-content {
    flex: 1;
    margin-left: 256px;
    background: var(--ai-bg-main);
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Scrollable content area below header */
.ai-main-content-scroll {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

.ai-dashboard-home {
    padding: 32px;
    display: flex;
    flex-direction: column;
}

/* Explicit spacing between dashboard sections */
.ai-dashboard-home > * {
    margin-bottom: 32px;
}

.ai-dashboard-home > *:last-child {
    margin-bottom: 0;
}

/* Dashboard Header */
.ai-dashboard-header {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ai-welcome-title {
    font-size: 30px;
    font-weight: 700;
    color: var(--ai-text-dark);
    line-height: 1.2;
    letter-spacing: 0.01em;
    margin: 0;
}

.ai-welcome-subtitle {
    font-size: 16px;
    font-weight: 400;
    color: var(--ai-text-light);
    line-height: 1.5;
    letter-spacing: -0.02em;
    margin: 0;
}

/* ==================== ENGAGEMENT & GROWTH CARDS ==================== */
.ai-dashboard-cards-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-bottom: 32px;
}

.ai-dashboard-card {
    background: var(--ai-bg-white);
    border: 1px solid var(--ai-border);
    border-radius: 14px;
    padding: 25px;
    box-shadow: 0 1px 2px -1px rgba(0, 0, 0, 0.1), 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ai-dashboard-card-header {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.ai-dashboard-card-title {
    font-family: 'Inter', sans-serif;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.56;
    letter-spacing: -0.024em;
    color: #101828;
    margin: 0;
}

.ai-dashboard-card-date {
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.33;
    color: #6A7282;
    margin: 0;
}

.ai-dashboard-card-metrics {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ai-metric-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 12px;
    border-bottom: 1px solid #F3F4F6;
}

.ai-metric-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.ai-metric-item-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ai-metric-item-name {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.43;
    letter-spacing: -0.01em;
    color: #101828;
}

.ai-metric-item-stats {
    display: flex;
    align-items: baseline;
    gap: 12px;
}

.ai-metric-item-value {
    font-family: 'Inter', sans-serif;
    font-size: 30px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.013em;
    color: #101828;
}

.ai-metric-item-today {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.43;
    letter-spacing: -0.01em;
    color: #6A7282;
}

.ai-metric-item-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0;
}

.ai-metric-item-change {
    font-family: 'Inter', sans-serif;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.56;
    letter-spacing: -0.024em;
    text-align: right;
}

.ai-metric-item-change.positive {
    color: #00A63E;
}

.ai-metric-item-change.negative {
    color: #FB2C36;
}

.ai-metric-item-change.neutral {
    color: #6A7282;
}

.ai-metric-item-comparison {
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.33;
    text-align: right;
    color: #99A1AF;
}

/* Responsive for Engagement/Growth cards */
@media (max-width: 900px) {
    .ai-dashboard-cards-row {
        grid-template-columns: 1fr;
    }
}

/* ==================== METRIC CARDS (LEGACY) ==================== */
.ai-metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    column-gap: 24px;
    row-gap: 24px;
}

.ai-metric-card {
    background: var(--ai-bg-white);
    border: 1px solid var(--ai-border);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--ai-shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ai-metric-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ai-metric-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-metric-icon-blue {
    background: var(--ai-blue-light);
}

.ai-metric-icon-green {
    background: var(--ai-green-light);
}

.ai-metric-icon-purple {
    background: var(--ai-purple-light);
}

.ai-metric-icon-orange {
    background: var(--ai-orange-light);
}

.ai-metric-change {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.43;
    letter-spacing: -0.01em;
}

.ai-metric-change.positive {
    color: var(--ai-success);
}

.ai-metric-change.negative {
    color: #DC2626;
}

.ai-metric-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--ai-text-dark);
    line-height: 1.33;
    letter-spacing: 0.003em;
}

.ai-metric-label {
    font-size: 14px;
    font-weight: 400;
    color: var(--ai-text-light);
    line-height: 1.43;
    letter-spacing: -0.01em;
}

/* Metric Card V2 - Horizontal Layout */
.ai-metric-card-v2 {
    flex-direction: row;
    align-items: center;
    gap: 16px;
}

.ai-metric-card-v2 .ai-metric-icon {
    flex-shrink: 0;
}

.ai-metric-card-v2 .ai-metric-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ai-metric-card-v2 .ai-metric-label {
    order: -1;
    font-size: 14px;
    font-weight: 500;
    color: var(--ai-text-medium);
}

.ai-metric-card-v2 .ai-metric-stats {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-metric-card-v2 .ai-metric-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--ai-text-dark);
    line-height: 1.2;
}

.ai-metric-trend {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    font-weight: 500;
}

.ai-metric-trend.positive {
    color: var(--ai-success);
}

.ai-metric-trend.negative {
    color: #DC2626;
}

.ai-metric-trend img {
    width: 16px;
    height: 16px;
}

.ai-metric-comparison {
    font-size: 12px;
    font-weight: 400;
    color: #99A1AF;
    line-height: 1.33;
    text-align: right;
}

/* Metric Card V3 - Figma Layout (icon left, stats right) */
.ai-metric-card-v3 {
    flex-direction: column;
    gap: 16px;
    padding: 24px;
    border-radius: 12px;
}

.ai-metric-card-v3 .ai-metric-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ai-metric-card-v3 .ai-metric-icon {
    flex-shrink: 0;
}

.ai-metric-card-v3 .ai-metric-stats-group {
    text-align: right;
}

.ai-metric-card-v3 .ai-metric-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--ai-text-dark);
    line-height: 1.33;
}

.ai-metric-card-v3 .ai-metric-trend {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    font-size: 12px;
    font-weight: 500;
    margin-top: 4px;
}

.ai-metric-card-v3 .ai-metric-trend img {
    width: 12px;
    height: 12px;
}

.ai-metric-card-v3 .ai-metric-comparison {
    font-size: 12px;
    font-weight: 400;
    color: #9CA3AF;
    margin-top: 2px;
}

.ai-metric-card-v3 .ai-metric-label {
    font-size: 14px;
    font-weight: 400;
    color: #4B5563;
    line-height: 1.43;
}

/* Metrics Loading State */
.ai-metrics-loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 48px 24px;
    color: var(--ai-text-muted);
    font-size: 14px;
}

/* Dynamic Metrics Grid (adapts to enabled channels) */
.ai-metrics-grid.cols-1 { grid-template-columns: 1fr; }
.ai-metrics-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.ai-metrics-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.ai-metrics-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }

/* ==================== INSIGHTS SECTION ==================== */
.ai-insights-section {
    background: var(--ai-bg-white);
    border: 1px solid var(--ai-border);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--ai-shadow-sm);
    margin-top: 24px;
}

.ai-insights-header {
    margin-bottom: 20px;
}

.ai-insights-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--ai-text-dark);
    line-height: 1.56;
    letter-spacing: -0.02em;
    margin: 0 0 4px 0;
}

.ai-insights-subtitle {
    font-size: 14px;
    font-weight: 400;
    color: var(--ai-text-muted);
    line-height: 1.43;
    margin: 0;
}

.ai-insights-topics {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.ai-insight-topic {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--ai-bg-main);
    border: 1px solid var(--ai-border);
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--ai-text-medium);
    transition: all 0.15s ease;
}

.ai-insight-topic:hover {
    background: var(--ai-primary-light);
    border-color: var(--ai-primary);
    color: var(--ai-primary);
}

.ai-insight-count {
    background: var(--ai-bg-white);
    border-radius: 10px;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--ai-text-muted);
}

.ai-insights-empty {
    text-align: center;
    padding: 24px;
    color: var(--ai-text-muted);
    font-size: 14px;
}

/* ==================== CHARTS SECTION ==================== */
.ai-charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.ai-chart-card {
    background: var(--ai-bg-white);
    border: 1px solid var(--ai-border);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--ai-shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.ai-chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ai-chart-title-section {
    display: flex;
    flex-direction: column;
}

.ai-chart-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--ai-text-dark);
    line-height: 1.56;
    letter-spacing: -0.02em;
    margin: 0;
}

.ai-chart-subtitle {
    font-size: 14px;
    font-weight: 400;
    color: var(--ai-text-muted);
    line-height: 1.43;
    letter-spacing: -0.01em;
    margin: 0;
}

.ai-chart-menu-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: background 0.15s ease;
}

.ai-chart-menu-btn:hover {
    background: var(--ai-bg-main);
}

.ai-chart-container {
    height: 250px;
    position: relative;
}

/* AI Staff Status List */
.ai-staff-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ai-staff-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: var(--ai-bg-main);
    border-radius: 8px;
}

/* Dashboard-specific staff list styles (override ai-staff.css) */
.ai-chart-card .ai-staff-info {
    display: flex;
    flex-direction: row !important;
    flex-wrap: nowrap;
    align-items: center;
    gap: 12px;
}

.ai-chart-card .ai-staff-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.ai-chart-card .ai-staff-details {
    display: flex;
    flex-direction: column;
}

.ai-staff-status-dot.active {
    background: var(--ai-success-light);
}

.ai-staff-status-dot.inactive {
    background: #9CA3AF;
}

.ai-staff-details {
    display: flex;
    flex-direction: column;
}

.ai-staff-name {
    font-size: 16px;
    font-weight: 500;
    color: var(--ai-text-dark);
    line-height: 1.5;
    letter-spacing: -0.02em;
}

.ai-staff-role {
    font-size: 14px;
    font-weight: 400;
    color: var(--ai-text-muted);
    line-height: 1.43;
    letter-spacing: -0.01em;
}

.ai-staff-interactions {
    font-size: 14px;
    font-weight: 400;
    color: var(--ai-text-muted);
    line-height: 1.43;
    letter-spacing: -0.01em;
}

.ai-staff-stats {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.ai-staff-status-text {
    font-size: 14px;
    font-weight: 500;
    color: var(--ai-text-dark);
    line-height: 1.43;
    letter-spacing: -0.01em;
}

.ai-staff-response-time {
    font-size: 12px;
    font-weight: 400;
    color: var(--ai-text-muted);
    line-height: 1.33;
}

/* ==================== RECENT ACTIVITY ==================== */
.ai-activity-card {
    background: var(--ai-bg-white);
    border: 1px solid var(--ai-border);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--ai-shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.ai-activity-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ai-activity-title-section {
    display: flex;
    flex-direction: column;
}

.ai-activity-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--ai-text-dark);
    line-height: 1.56;
    letter-spacing: -0.02em;
    margin: 0;
}

.ai-activity-subtitle {
    font-size: 14px;
    font-weight: 400;
    color: var(--ai-text-muted);
    line-height: 1.43;
    letter-spacing: -0.01em;
    margin: 0;
}

.ai-activity-menu-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: background 0.15s ease;
}

.ai-activity-menu-btn:hover {
    background: var(--ai-bg-main);
}

.ai-activity-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ai-activity-item {
    display: flex;
    gap: 16px;
    padding: 16px;
    border-radius: 10px;
    transition: background 0.15s ease;
}

.ai-activity-item:hover {
    background: var(--ai-bg-main);
}

.ai-activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ai-activity-icon-blue {
    background: var(--ai-blue-light);
}

.ai-activity-icon-green {
    background: var(--ai-green-light);
}

.ai-activity-icon-purple {
    background: var(--ai-purple-light);
}

.ai-activity-content {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-width: 0;
}

.ai-activity-details {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.ai-activity-name {
    font-size: 16px;
    font-weight: 500;
    color: var(--ai-text-dark);
    line-height: 1.5;
    letter-spacing: -0.02em;
}

.ai-activity-description {
    font-size: 14px;
    font-weight: 400;
    color: var(--ai-text-light);
    line-height: 1.43;
    letter-spacing: -0.01em;
}

.ai-activity-time {
    font-size: 14px;
    font-weight: 400;
    color: var(--ai-text-muted);
    line-height: 1.43;
    flex-shrink: 0;
}

/* ==================== RESPONSIVE DESIGN ==================== */
@media (max-width: 1400px) {
    .ai-metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1200px) {
    .ai-charts-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1024px) {
    .ai-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        width: 256px; /* Reset to full width on mobile */
    }

    .ai-sidebar.open {
        transform: translateX(0);
    }

    /* Reset collapsed state on mobile */
    .ai-sidebar.collapsed {
        width: 256px;
    }

    .ai-sidebar.collapsed .ai-logo-text,
    .ai-sidebar.collapsed .ai-nav-link span,
    .ai-sidebar.collapsed .ai-nav-badge,
    .ai-sidebar.collapsed .ai-user-info,
    .ai-sidebar.collapsed .ai-sidebar-footer {
        display: block;
    }

    .ai-sidebar.collapsed .ai-nav-submenu {
        display: none; /* Keep submenu collapsed by default */
    }

    .ai-sidebar.collapsed .ai-sidebar-header {
        padding: 24px 24px 24px;
        justify-content: flex-start;
    }

    .ai-sidebar.collapsed .ai-logo {
        justify-content: flex-start;
    }

    .ai-sidebar.collapsed .ai-sidebar-nav {
        padding: 16px;
    }

    .ai-sidebar.collapsed .ai-nav-link {
        justify-content: flex-start;
        padding: 12px 16px;
    }

    .ai-main-content {
        margin-left: 0;
    }

    .ai-app.sidebar-collapsed .ai-main-content {
        margin-left: 0;
    }

    .ai-dashboard-home {
        padding: 24px;
        gap: 32px;
        row-gap: 32px;
    }

    /* Mobile sidebar overlay */
    .ai-sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 99;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }

    .ai-sidebar-overlay.active {
        opacity: 1;
        visibility: visible;
    }
}

@media (max-width: 768px) {
    .ai-metrics-grid {
        grid-template-columns: 1fr;
    }

    .ai-dashboard-home {
        padding: 16px;
        gap: 24px;
    }

    .ai-welcome-title {
        font-size: 24px;
    }

    .ai-activity-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .ai-activity-time {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .ai-metric-card {
        padding: 16px;
    }

    .ai-chart-card,
    .ai-activity-card {
        padding: 16px;
    }

    .ai-staff-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .ai-staff-stats {
        align-items: flex-start;
    }
}

/* ==================== PAGE CONTAINERS ==================== */
.ai-page-container {
    padding: 0;
}

.ai-page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
}

.ai-page-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--ai-text-dark);
    margin: 0;
}

.ai-page-subtitle {
    font-size: 14px;
    color: var(--ai-text-muted);
    margin-top: 4px;
}

/* ==================== BUTTONS ==================== */
.btn-primary {
    background: var(--ai-primary);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: #6d00b8;
}

.btn-secondary {
    background: white;
    color: var(--ai-text-dark);
    border: 1px solid var(--ai-border);
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: var(--ai-bg-main);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

/* ==================== AI STAFF GRID ==================== */
.ai-staff-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
}

.ai-staff-card {
    background: white;
    border-radius: 12px;
    border: 1px solid var(--ai-border);
    padding: 20px;
}

.ai-staff-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.ai-staff-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 600;
    color: white;
}

/* Unified Viva branding for AI assistant */
.ai-staff-avatar-viva { background: linear-gradient(135deg, #9810FA, #7C3AED); }

.ai-staff-card-info {
    flex: 1;
}

.ai-staff-card-name {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.ai-staff-card-role {
    font-size: 13px;
    color: var(--ai-text-muted);
}

.ai-staff-card-status {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 500;
}

.ai-staff-card-status.active {
    background: var(--ai-green-light);
    color: var(--ai-green);
}

.ai-staff-card-status.paused {
    background: #FEF3C7;
    color: #D97706;
}

.ai-staff-card-channels {
    margin-bottom: 16px;
}

.ai-staff-card-channels label {
    font-size: 12px;
    color: var(--ai-text-muted);
    display: block;
    margin-bottom: 8px;
}

.channel-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.channel-badge {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 6px;
    background: var(--ai-bg-main);
}

.channel-badge.inactive {
    opacity: 0.5;
}

.no-channels {
    font-size: 13px;
    color: var(--ai-text-muted);
    font-style: italic;
}

.ai-staff-card-stats {
    display: flex;
    gap: 24px;
    padding: 12px 0;
    border-top: 1px solid var(--ai-border);
    border-bottom: 1px solid var(--ai-border);
    margin-bottom: 16px;
}

.ai-staff-card-stats .stat {
    text-align: center;
}

.ai-staff-card-stats .stat-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--ai-text-dark);
}

.ai-staff-card-stats .stat-label {
    font-size: 11px;
    color: var(--ai-text-muted);
    text-transform: uppercase;
}

.ai-staff-card-actions {
    display: flex;
    gap: 8px;
}

.ai-staff-card-actions button {
    flex: 1;
}

/* ==================== EMAIL LIST ==================== */
.email-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-btn {
    background: white;
    border: 1px solid var(--ai-border);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-btn:hover {
    background: var(--ai-bg-main);
}

.filter-btn.active {
    background: var(--ai-primary);
    color: white;
    border-color: var(--ai-primary);
}

.filter-btn .count {
    margin-left: 6px;
    opacity: 0.8;
}

.email-list {
    background: white;
    border-radius: 12px;
    border: 1px solid var(--ai-border);
    overflow: hidden;
}

.email-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 16px 20px;
    border-bottom: 1px solid var(--ai-border);
    cursor: pointer;
    transition: background 0.2s;
}

.email-item:last-child {
    border-bottom: none;
}

.email-item:hover {
    background: var(--ai-bg-main);
}

.email-item-left {
    flex: 1;
    min-width: 0;
}

.email-sender {
    font-size: 14px;
    font-weight: 600;
    color: var(--ai-text-dark);
    margin-bottom: 4px;
}

.email-subject {
    font-size: 14px;
    color: var(--ai-text-medium);
    margin-bottom: 4px;
}

.email-preview {
    font-size: 13px;
    color: var(--ai-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.email-item-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    margin-left: 20px;
}

.email-status {
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 500;
}

.status-yellow { background: #FEF3C7; color: #D97706; }
.status-blue { background: var(--ai-blue-light); color: var(--ai-blue); }
.status-green { background: var(--ai-green-light); color: var(--ai-green); }
.status-red { background: #FEE2E2; color: #DC2626; }

.email-time {
    font-size: 12px;
    color: var(--ai-text-muted);
}

/* ==================== MODAL ==================== */
.ai-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.ai-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.ai-modal-content {
    position: relative;
    background: white;
    border-radius: 12px;
    padding: 24px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.ai-modal-content.modal-large {
    max-width: 700px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.modal-header h2 {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--ai-text-muted);
    cursor: pointer;
    line-height: 1;
}

.modal-close:hover {
    color: var(--ai-text-dark);
}

/* ==================== FORMS ==================== */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--ai-text-medium);
    margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--ai-border);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--ai-primary);
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

/* ==================== TICKET DETAIL ==================== */
.ticket-detail {
    font-size: 14px;
}

.ticket-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    padding: 12px;
    background: var(--ai-bg-main);
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 13px;
}

.ticket-body,
.ticket-draft {
    margin-bottom: 20px;
}

.ticket-body h4,
.ticket-draft h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}

.message-content {
    padding: 16px;
    background: var(--ai-bg-main);
    border-radius: 8px;
    white-space: pre-wrap;
    font-size: 14px;
    line-height: 1.6;
}

.ticket-draft textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--ai-border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
}

.ticket-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* ==================== NOTIFICATIONS ==================== */
.ai-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 14px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 2000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.ai-notification.show {
    opacity: 1;
    transform: translateY(0);
}

.ai-notification-success {
    background: var(--ai-green);
    color: white;
}

.ai-notification-error {
    background: #DC2626;
    color: white;
}

.ai-notification-info {
    background: var(--ai-blue);
    color: white;
}

/* ==================== LOADER ==================== */
.ai-loader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1500;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--ai-border);
    border-top-color: var(--ai-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ==================== LOADING PLACEHOLDER ==================== */
.ai-loading-placeholder {
    padding: 40px 24px;
    text-align: center;
    color: var(--ai-text-muted);
    font-size: 14px;
    background: var(--ai-bg-main);
    border-radius: 8px;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* ==================== EMPTY STATES ==================== */
.ai-empty-state {
    text-align: center;
    padding: 24px;
    color: var(--ai-text-muted);
}

.ai-empty-state-large {
    text-align: center;
    padding: 60px 40px;
    background: white;
    border-radius: 12px;
    border: 1px solid var(--ai-border);
}

.ai-empty-state-large h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--ai-text-dark);
    margin-bottom: 8px;
}

.ai-empty-state-large p {
    color: var(--ai-text-muted);
    margin-bottom: 20px;
}

/* ==================== SETTINGS ==================== */
.settings-section {
    background: white;
    border-radius: 12px;
    border: 1px solid var(--ai-border);
    padding: 24px;
    margin-bottom: 20px;
}

.settings-section h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
}

/* ==================== AI STAFF PAGE - LIST + DETAIL LAYOUT ==================== */

/* Main container */
.ai-staff-management {
    padding: 32px;
}

.ai-staff-header {
    margin-bottom: 24px;
}

.ai-staff-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--ai-text-dark);
    margin: 0 0 4px 0;
}

.ai-staff-subtitle {
    font-size: 14px;
    color: var(--ai-text-muted);
    margin: 0;
}

/* Two-column layout */
.ai-staff-layout {
    display: flex;
    gap: 24px;
    min-height: calc(100vh - 200px);
}

/* Left Sidebar - Staff List */
.ai-staff-sidebar {
    width: 320px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: 12px;
    border: 1px solid var(--ai-border);
    overflow: hidden;
}

.ai-staff-list-container {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.ai-staff-empty {
    padding: 40px 20px;
    text-align: center;
    color: var(--ai-text-muted);
}

/* Staff list items */
.ai-staff-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s ease;
    margin-bottom: 4px;
}

.ai-staff-list-item:hover {
    background: var(--ai-bg-main);
}

.ai-staff-list-item.selected {
    background: var(--ai-primary-light);
    border: 1px solid var(--ai-primary);
}

.ai-staff-list-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ai-staff-list-info {
    flex: 1;
    min-width: 0;
}

.ai-staff-list-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--ai-text-dark);
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-staff-list-name .ai-staff-status-dot {
    width: 8px;
    height: 8px;
}

.ai-staff-list-role {
    font-size: 13px;
    color: var(--ai-text-muted);
    margin-top: 2px;
}

.ai-staff-list-channels {
    display: flex;
    gap: 8px;
    margin-top: 6px;
}

/* Add button */
.ai-staff-add-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px;
    background: var(--ai-primary);
    color: white;
    border: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.ai-staff-add-btn:hover {
    background: #6d00b8;
}

/* Right Detail Panel */
.ai-staff-detail {
    flex: 1;
    background: white;
    border-radius: 12px;
    border: 1px solid var(--ai-border);
    overflow: hidden;
}

.ai-staff-detail-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--ai-text-muted);
    font-size: 15px;
}

.ai-staff-detail-content {
    padding: 28px;
}

/* Detail Header */
.ai-staff-detail-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 28px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--ai-border);
}

.ai-staff-detail-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ai-staff-detail-info {
    flex: 1;
}

.ai-staff-detail-name {
    font-size: 20px;
    font-weight: 600;
    color: var(--ai-text-dark);
    margin: 0 0 4px 0;
}

.ai-staff-detail-role {
    font-size: 14px;
    color: var(--ai-text-muted);
    margin: 0;
}

.btn-configure {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: white;
    border: 1px solid var(--ai-border);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--ai-text-medium);
    cursor: pointer;
    transition: all 0.15s;
}

.btn-configure:hover {
    background: var(--ai-bg-main);
    border-color: #D1D5DC;
}

/* Stats Grid */
.ai-staff-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 28px;
}

.ai-staff-stat-card {
    background: var(--ai-bg-main);
    border-radius: 12px;
    padding: 18px;
    text-align: center;
}

.ai-staff-stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
}

.ai-staff-stat-icon.blue {
    background: var(--ai-blue-light);
    color: var(--ai-blue);
}

.ai-staff-stat-icon.purple {
    background: var(--ai-purple-light);
    color: var(--ai-purple);
}

.ai-staff-stat-icon.green {
    background: var(--ai-green-light);
    color: var(--ai-green);
}

.ai-staff-stat-icon.red {
    background: #FEE2E2;
    color: #DC2626;
}

.ai-staff-stat-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--ai-text-dark);
    margin-bottom: 4px;
}

.ai-staff-stat-label {
    font-size: 12px;
    color: var(--ai-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

/* Sections */
.ai-staff-section {
    margin-bottom: 28px;
}

.ai-staff-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
    color: var(--ai-text-dark);
    margin: 0 0 16px 0;
}

.ai-staff-section-title svg {
    color: var(--ai-text-muted);
}

/* Capabilities */
.ai-staff-capabilities {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.ai-staff-capability {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: #F0FDF4;
    border-radius: 8px;
    font-size: 14px;
    color: var(--ai-text-medium);
}

/* Channel Cards */
.ai-staff-channels-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.ai-staff-channel-card {
    background: var(--ai-bg-main);
    border: 1px solid var(--ai-border);
    border-radius: 12px;
    padding: 18px;
    transition: all 0.15s;
}

.ai-staff-channel-card.active {
    background: white;
    border-color: #10B981;
    box-shadow: 0 0 0 1px #10B981;
}

.ai-staff-channel-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.ai-staff-channel-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-staff-channel-label {
    font-size: 15px;
    font-weight: 600;
    color: var(--ai-text-dark);
}

.ai-staff-channel-identifier {
    font-size: 13px;
    color: var(--ai-text-muted);
    margin-bottom: 8px;
}

.ai-staff-channel-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #10B981;
    font-weight: 500;
}

.ai-staff-channel-status .status-dot {
    width: 6px;
    height: 6px;
    background: #10B981;
    border-radius: 50%;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .ai-staff-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .ai-staff-channels-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1024px) {
    .ai-staff-layout {
        flex-direction: column;
    }

    .ai-staff-sidebar {
        width: 100%;
        max-height: 300px;
    }

    .ai-staff-list-container {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    .ai-staff-list-item {
        flex: 1 1 calc(50% - 4px);
        min-width: 200px;
    }
}

@media (max-width: 768px) {
    .ai-staff-management {
        padding: 20px;
    }

    .ai-staff-stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .ai-staff-channels-grid {
        grid-template-columns: 1fr;
    }

    .ai-staff-detail-header {
        flex-wrap: wrap;
    }

    .btn-configure {
        width: 100%;
        justify-content: center;
        margin-top: 12px;
    }
}

/* ==================== TRIAL BADGE ==================== */
.trial-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
    border: 1px solid #F59E0B;
    border-radius: 10px;
    margin-bottom: 20px;
}

.trial-badge-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: #FDE68A;
    border-radius: 50%;
    color: #92400E;
}

.trial-badge-icon svg {
    width: 16px;
    height: 16px;
}

.trial-badge-text {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: #92400E;
}

.trial-badge-btn {
    padding: 8px 16px;
    background: #F59E0B;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.trial-badge-btn:hover {
    background: #D97706;
}

/* ==================== UPGRADE MODAL ==================== */
.modal-upgrade {
    max-width: 440px;
}

.upgrade-modal {
    text-align: center;
}

.upgrade-modal-header {
    margin-bottom: 24px;
}

.upgrade-modal-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.upgrade-modal-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--ai-text-dark);
    margin: 0 0 8px 0;
}

.upgrade-modal-subtitle {
    font-size: 15px;
    color: var(--ai-text-muted);
    margin: 0;
    line-height: 1.5;
}

.upgrade-plan-card {
    background: linear-gradient(135deg, #FAF5FF 0%, #F3E8FF 100%);
    border: 2px solid var(--ai-primary);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    text-align: left;
}

.upgrade-plan-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(130, 0, 219, 0.2);
}

.upgrade-plan-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--ai-primary);
    margin: 0;
}

.upgrade-plan-price {
    text-align: right;
}

.price-amount {
    font-size: 32px;
    font-weight: 700;
    color: var(--ai-text-dark);
}

.price-period {
    font-size: 14px;
    color: var(--ai-text-muted);
}

.upgrade-plan-features {
    list-style: none;
    margin: 0;
    padding: 0;
}

.upgrade-plan-features li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    font-size: 14px;
    color: var(--ai-text-medium);
}

.feature-check {
    color: var(--ai-success);
    font-weight: 600;
    font-size: 16px;
}

.upgrade-modal-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-upgrade-primary {
    width: 100%;
    padding: 14px 24px;
    background: var(--ai-primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-upgrade-primary:hover {
    background: #6d00b8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(130, 0, 219, 0.3);
}

.btn-upgrade-secondary {
    width: 100%;
    padding: 12px 24px;
    background: transparent;
    color: var(--ai-text-muted);
    border: 1px solid var(--ai-border);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-upgrade-secondary:hover {
    background: var(--ai-bg-main);
    color: var(--ai-text-medium);
}

.upgrade-modal-footer {
    margin-top: 20px;
    font-size: 13px;
    color: var(--ai-text-muted);
}

.upgrade-modal-footer a {
    color: var(--ai-primary);
    text-decoration: none;
    font-weight: 500;
}

.upgrade-modal-footer a:hover {
    text-decoration: underline;
}

/* Expired trial - more urgent styling */
.trial-expired .trial-badge {
    background: linear-gradient(135deg, #FEE2E2 0%, #FECACA 100%);
    border-color: #DC2626;
}

.trial-expired .trial-badge-icon {
    background: #FECACA;
    color: #991B1B;
}

.trial-expired .trial-badge-text {
    color: #991B1B;
}

.trial-expired .trial-badge-btn {
    background: #DC2626;
}

.trial-expired .trial-badge-btn:hover {
    background: #B91C1C;
}

/* Feature gating overlay */
.feature-gated {
    position: relative;
    pointer-events: none;
    opacity: 0.5;
}

.feature-gated::after {
    content: 'Upgrade to access';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--ai-primary);
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    pointer-events: auto;
    cursor: pointer;
}

/* ==================== HELP CHAT ==================== */
.ai-help-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    border-radius: 10px;
    color: var(--ai-text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.ai-help-btn:hover {
    background: var(--ai-bg-main);
    color: var(--ai-text-dark);
}

.ai-help-btn.active {
    background: var(--ai-primary-light);
    color: var(--ai-primary);
}

/* Help Chat Panel */
.help-chat-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 380px;
    height: 100vh;
    background: var(--ai-bg-white);
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    z-index: 1001;
    transition: right 0.3s ease;
}

.help-chat-panel.open {
    right: 0;
}

.help-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--ai-border);
    background: var(--ai-primary-gradient);
    color: white;
}

.help-chat-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.help-chat-title h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.help-chat-status {
    font-size: 12px;
    opacity: 0.8;
}

.help-chat-avatar {
    border-radius: 50%;
    background: white;
    padding: 2px;
}

.help-chat-close {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.help-chat-close:hover {
    opacity: 1;
}

.help-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.help-chat-message {
    max-width: 85%;
}

.help-chat-message.assistant {
    align-self: flex-start;
}

.help-chat-message.user {
    align-self: flex-end;
}

.help-chat-message .message-content {
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
}

.help-chat-message.assistant .message-content {
    background: var(--ai-bg-main);
    color: var(--ai-text-dark);
    border-bottom-left-radius: 4px;
}

.help-chat-message.user .message-content {
    background: var(--ai-primary);
    color: white;
    border-bottom-right-radius: 4px;
}

.help-chat-message.typing .message-content {
    background: var(--ai-bg-main);
    color: var(--ai-text-muted);
}

.help-chat-input-container {
    display: flex;
    gap: 8px;
    padding: 16px 20px;
    border-top: 1px solid var(--ai-border);
    background: var(--ai-bg-white);
}

.help-chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--ai-border);
    border-radius: 24px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}

.help-chat-input:focus {
    border-color: var(--ai-primary);
}

.help-chat-send {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: var(--ai-primary);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    transition: background 0.2s;
}

.help-chat-send:hover {
    background: #7000c0;
}

/* ==================== ONBOARDING OVERLAY ==================== */
.onboarding-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.3s ease;
}

.onboarding-overlay.fade-out {
    animation: fadeOut 0.3s ease forwards;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

.onboarding-container {
    width: 100%;
    max-width: 560px;
    background: var(--ai-bg-white);
    border-radius: 20px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.24);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    animation: slideUp 0.4s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.onboarding-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 32px 32px 24px;
    background: var(--ai-primary-gradient);
    color: white;
}

.onboarding-avatar {
    flex-shrink: 0;
    background: white;
    border-radius: 50%;
    padding: 4px;
}

.onboarding-title h1 {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 4px;
}

.onboarding-title p {
    font-size: 14px;
    margin: 0;
    opacity: 0.9;
}

.onboarding-chat {
    flex: 1;
    overflow-y: auto;
    padding: 24px 32px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 200px;
    max-height: 400px;
}

.onboarding-message {
    max-width: 90%;
}

.onboarding-message.assistant {
    align-self: flex-start;
}

.onboarding-message.user {
    align-self: flex-end;
}

.onboarding-message .message-content {
    padding: 14px 18px;
    border-radius: 18px;
    font-size: 15px;
    line-height: 1.6;
}

.onboarding-message.assistant .message-content {
    background: var(--ai-bg-main);
    color: var(--ai-text-dark);
    border-bottom-left-radius: 6px;
}

.onboarding-message.user .message-content {
    background: var(--ai-primary);
    color: white;
    border-bottom-right-radius: 6px;
}

.onboarding-input-container {
    display: flex;
    gap: 12px;
    padding: 20px 32px;
    border-top: 1px solid var(--ai-border);
}

.onboarding-input {
    flex: 1;
    padding: 14px 20px;
    border: 2px solid var(--ai-border);
    border-radius: 28px;
    font-size: 15px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}

.onboarding-input:focus {
    border-color: var(--ai-primary);
}

.onboarding-send {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    background: var(--ai-primary);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.onboarding-send:hover {
    background: #7000c0;
}

.onboarding-send:active {
    transform: scale(0.95);
}

.onboarding-skip {
    display: block;
    width: 100%;
    padding: 16px;
    background: transparent;
    border: none;
    border-top: 1px solid var(--ai-border);
    color: var(--ai-text-muted);
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.onboarding-skip:hover {
    background: var(--ai-bg-main);
    color: var(--ai-text-dark);
}

.onboarding-continue {
    display: block;
    width: calc(100% - 64px);
    margin: 0 32px 24px;
    padding: 16px 24px;
    background: var(--ai-primary);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.onboarding-continue:hover {
    background: #7000c0;
}

.onboarding-continue:active {
    transform: scale(0.98);
}

/* Mobile responsive */
@media (max-width: 640px) {
    .onboarding-container {
        max-width: calc(100% - 32px);
        margin: 16px;
        max-height: calc(100vh - 32px);
    }

    .onboarding-header {
        padding: 24px 20px 20px;
    }

    .onboarding-chat {
        padding: 20px;
    }

    .onboarding-input-container {
        padding: 16px 20px;
    }

    .help-chat-panel {
        width: 100%;
        right: -100%;
    }
}

/* ==================== COMMAND PALETTE ==================== */
.command-palette {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    padding: 15vh 16px 16px;
}

.command-palette.open {
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.command-palette-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    animation: commandPaletteFadeIn 0.15s ease-out;
}

@keyframes commandPaletteFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.command-palette-dialog {
    position: relative;
    width: 100%;
    max-width: 560px;
    background: var(--ai-bg-white);
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    animation: commandPaletteSlideIn 0.15s ease-out;
}

@keyframes commandPaletteSlideIn {
    from {
        opacity: 0;
        transform: scale(0.96) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.command-palette-header {
    padding: 12px;
    border-bottom: 1px solid var(--ai-border);
}

.command-palette-input-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 4px;
}

.command-palette-input-wrapper svg {
    flex-shrink: 0;
    color: var(--ai-text-muted);
}

.command-palette-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 16px;
    font-weight: 400;
    color: var(--ai-text-primary);
    background: transparent;
}

.command-palette-input::placeholder {
    color: var(--ai-text-muted);
}

.command-palette-results {
    max-height: 360px;
    overflow-y: auto;
    padding: 8px;
}

.command-palette-group {
    margin-bottom: 8px;
}

.command-palette-group:last-child {
    margin-bottom: 0;
}

.command-palette-group-label {
    padding: 8px 12px 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ai-text-muted);
}

.command-palette-group-items {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.command-palette-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.1s ease;
}

.command-palette-item:hover,
.command-palette-item.selected {
    background: var(--ai-bg-card);
}

.command-palette-item.selected {
    background: var(--ai-primary);
}

.command-palette-item.selected .command-palette-item-label,
.command-palette-item.selected .command-palette-item-description,
.command-palette-item.selected .command-palette-item-icon {
    color: white;
}

.command-palette-item.selected .command-palette-item-icon svg {
    stroke: white;
}

.command-palette-item-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: var(--ai-bg-card);
    color: var(--ai-text-secondary);
    flex-shrink: 0;
}

.command-palette-item.selected .command-palette-item-icon {
    background: rgba(255, 255, 255, 0.2);
}

.command-palette-item-icon svg {
    width: 18px;
    height: 18px;
}

.command-palette-item-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.command-palette-item-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--ai-text-primary);
}

.command-palette-item-label mark {
    background: rgba(255, 122, 0, 0.2);
    color: inherit;
    padding: 0 2px;
    border-radius: 2px;
}

.command-palette-item.selected .command-palette-item-label mark {
    background: rgba(255, 255, 255, 0.3);
}

.command-palette-item-description {
    font-size: 12px;
    color: var(--ai-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.command-palette-footer {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 16px;
    border-top: 1px solid var(--ai-border);
    background: var(--ai-bg-card);
}

.command-palette-hint {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--ai-text-muted);
}

.command-palette-hint kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: var(--ai-bg-white);
    border: 1px solid var(--ai-border);
    border-radius: 4px;
    font-size: 11px;
    font-family: inherit;
    color: var(--ai-text-secondary);
}

/* Command Palette AI Section */
.command-palette-ai-section {
    padding: 20px;
    border-top: 1px solid var(--ai-border);
    background: linear-gradient(135deg, rgba(130, 0, 219, 0.03) 0%, rgba(255, 122, 0, 0.03) 100%);
}

.command-palette-ai-loading {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--ai-text-secondary);
    font-size: 14px;
}

.command-palette-ai-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--ai-border);
    border-top-color: var(--ai-primary);
    border-radius: 50%;
    animation: commandPaletteSpinner 0.8s linear infinite;
}

@keyframes commandPaletteSpinner {
    to { transform: rotate(360deg); }
}

.command-palette-ai-response {
    font-size: 14px;
    line-height: 1.7;
    color: var(--ai-text);
    white-space: pre-wrap;
    max-height: 300px;
    overflow-y: auto;
}

.command-palette-ai-response strong {
    font-weight: 600;
    color: var(--ai-text-dark);
}

.command-palette-ai-response code {
    background: var(--ai-bg-tertiary);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'SF Mono', Monaco, Consolas, monospace;
    font-size: 13px;
}

.command-palette-ai-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--ai-border);
}

.command-palette-ai-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--ai-primary);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.command-palette-ai-btn:hover {
    background: var(--ai-primary-dark);
    transform: translateY(-1px);
}

.command-palette-ai-btn-secondary {
    background: var(--ai-bg-white);
    color: var(--ai-text-secondary);
    border: 1px solid var(--ai-border);
}

.command-palette-ai-btn-secondary:hover {
    background: var(--ai-bg-tertiary);
    color: var(--ai-text);
    transform: translateY(-1px);
}

/* AI Hint Bar */
.command-palette-ai-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    background: linear-gradient(90deg, rgba(130, 0, 219, 0.08) 0%, rgba(255, 122, 0, 0.08) 100%);
    color: var(--ai-primary);
    font-size: 13px;
    font-weight: 500;
    border-top: 1px solid rgba(130, 0, 219, 0.1);
}

.command-palette-ai-hint svg {
    width: 16px;
    height: 16px;
    stroke: var(--ai-primary);
}

/* Mobile responsive */
@media (max-width: 640px) {
    .command-palette {
        padding: 8px;
        padding-top: 10vh;
    }

    .command-palette-dialog {
        max-width: 100%;
    }

    .command-palette-results {
        max-height: 50vh;
    }

    .command-palette-footer {
        flex-wrap: wrap;
        gap: 8px 16px;
    }
}
