/* My Assistant - Personal AI Assistant for Business Owners */
/* Version: 20260112i - Added task modal styles */

/* =====================================================
   INHERIT DASHBOARD VARIABLES
   Map generic vars to ai-dashboard.css variables for consistency
   ===================================================== */

.assistant-page,
.assistant-settings-modal {
    --bg-primary: var(--ai-bg-white, #FFFFFF);
    --bg-secondary: var(--ai-bg-main, #F9FAFB);
    --text-primary: var(--ai-text-dark, #101828);
    --text-secondary: var(--ai-text-medium, #364153);
    --text-tertiary: var(--ai-text-muted, #6A7282);
    --border-color: var(--ai-border, #E5E7EB);
    --accent-color: var(--ai-primary, #8200DB);
    --accent-light: var(--ai-primary-light, #FAF5FF);
    --success-color: var(--ai-success, #00A63E);
    --error-color: #DC2626;
}

/* =====================================================
   MODE SWITCHER (Business/Personal Toggle)
   ===================================================== */

.mode-switcher {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 16px;
}

.mode-switcher-label {
    font-size: 12px;
    font-weight: 500;
    color: #9CA3AF;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.mode-switcher-buttons {
    display: flex;
    align-items: center;
    gap: 2px;
    background: #F3F4F6;
    border-radius: 8px;
    padding: 3px;
    border: 1px solid #E5E7EB;
}

.mode-switcher-btn {
    padding: 6px 12px;
    border: none;
    background: transparent;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #6B7280;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
}

.mode-switcher-btn:hover {
    color: #374151;
    background: rgba(255, 255, 255, 0.5);
}

.mode-switcher-btn.active {
    background: white;
    color: #111827;
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* Mobile: Compact mode switcher */
@media (max-width: 768px) {
    .mode-switcher {
        margin-left: 8px;
    }

    .mode-switcher-label {
        display: none;
    }

    .mode-switcher-btn {
        padding: 6px 10px;
        font-size: 12px;
    }
}

/* =====================================================
   SIDEBAR FOOTER LINKS (Feedback | SOS)
   ===================================================== */

.ai-sidebar-footer-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid #F3F4F6;
}

.ai-feedback-link,
.ai-sos-link {
    font-size: 12px;
    font-weight: 500;
    color: #9CA3AF;
    text-decoration: none;
    transition: color 0.15s ease;
}

.ai-feedback-link:hover,
.ai-sos-link:hover {
    color: #8200DB;
}

.ai-footer-divider {
    color: #D1D5DB;
    font-size: 12px;
}

/* =====================================================
   MY ASSISTANT PAGE BODY STYLES
   ===================================================== */

/* Purple accent for Personal Assistant to differentiate from Business Dashboard */
.my-assistant-page {
    --ai-primary: #8200DB;
    --ai-primary-light: #FAF5FF;
    --ai-nav-active-bg: #FAF5FF;
    --ai-nav-active-color: #8200DB;
}

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

.my-assistant-page .ai-nav-link.active .ai-nav-icon {
    filter: none;
    stroke: var(--ai-nav-active-color);
}

/* =====================================================
   MY ASSISTANT DASHBOARD CONTENT
   ===================================================== */

.my-assistant-dashboard {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
}

/* Stats Cards Grid */
.my-assistant-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.my-assistant-stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border: 1px solid #E5E7EB;
}

.my-assistant-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.my-assistant-stat-card.purple .my-assistant-stat-icon {
    background: #FAF5FF;
    color: #8200DB;
}

.my-assistant-stat-card.cyan .my-assistant-stat-icon {
    background: #ECFEFF;
    color: #0891B2;
}

.my-assistant-stat-card.orange .my-assistant-stat-icon {
    background: #FFF7ED;
    color: #EA580C;
}

.my-assistant-stat-content {
    flex: 1;
    min-width: 0;
}

.my-assistant-stat-label {
    font-size: 12px;
    font-weight: 500;
    color: #6B7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.my-assistant-stat-value {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
}

/* Content Cards */
.my-assistant-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border: 1px solid #E5E7EB;
    margin-bottom: 16px;
}

.my-assistant-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #F3F4F6;
}

.my-assistant-card-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.my-assistant-card-title svg {
    color: #8200DB;
}

.my-assistant-card-action {
    font-size: 13px;
    font-weight: 500;
    color: #8200DB;
    text-decoration: none;
    transition: color 0.15s ease;
}

.my-assistant-card-action:hover {
    color: #6B21A8;
}

/* Priority Actions */
.my-assistant-action-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    transition: background 0.15s ease;
}

.my-assistant-action-item:hover {
    background: #F9FAFB;
}

.my-assistant-action-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #F3F4F6;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #6B7280;
}

.my-assistant-action-content {
    flex: 1;
    min-width: 0;
}

.my-assistant-action-title {
    font-size: 14px;
    font-weight: 500;
    color: #111827;
    margin-bottom: 2px;
}

.my-assistant-action-desc {
    font-size: 13px;
    color: #6B7280;
}

/* Two Column Layout */
.my-assistant-two-col {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.my-assistant-two-col .my-assistant-card {
    margin-bottom: 0;
}

/* Empty State */
.my-assistant-empty-text {
    color: #9CA3AF;
    font-size: 14px;
    padding: 12px;
    text-align: center;
}

/* Metrics */
.my-assistant-metric {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    background: #F9FAFB;
    margin-bottom: 8px;
}

.my-assistant-metric:last-child {
    margin-bottom: 0;
}

.my-assistant-metric-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.my-assistant-metric-icon.revenue {
    background: #DCFCE7;
    color: #16A34A;
}

.my-assistant-metric-icon.customers {
    background: #DBEAFE;
    color: #2563EB;
}

.my-assistant-metric-content {
    flex: 1;
    min-width: 0;
}

.my-assistant-metric-label {
    font-size: 12px;
    font-weight: 500;
    color: #6B7280;
    margin-bottom: 2px;
}

.my-assistant-metric-value {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
}

.my-assistant-metric-change {
    font-size: 13px;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 6px;
}

.my-assistant-metric-change.positive {
    background: #DCFCE7;
    color: #16A34A;
}

.my-assistant-metric-change.negative {
    background: #FEE2E2;
    color: #DC2626;
}

/* Ask Viva Button Section */
.my-assistant-ask-section {
    margin-top: 8px;
}

.my-assistant-ask-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, #8200DB 0%, #A855F7 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(130, 0, 219, 0.25);
}

.my-assistant-ask-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(130, 0, 219, 0.35);
}

.my-assistant-ask-btn svg {
    width: 20px;
    height: 20px;
}

/* Schedule Items */
.my-assistant-schedule-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    background: #F9FAFB;
    margin-bottom: 8px;
}

.my-assistant-schedule-item:last-child {
    margin-bottom: 0;
}

.my-assistant-schedule-time {
    font-size: 13px;
    font-weight: 600;
    color: #8200DB;
    min-width: 65px;
}

.my-assistant-schedule-content {
    flex: 1;
    min-width: 0;
}

.my-assistant-schedule-title {
    font-size: 14px;
    font-weight: 500;
    color: #111827;
    margin-bottom: 2px;
}

.my-assistant-schedule-meta {
    font-size: 13px;
    color: #6B7280;
}

/* Action Items Icon Types */
.my-assistant-action-icon.urgent {
    background: #FEE2E2;
    color: #DC2626;
}

.my-assistant-action-icon.warning {
    background: #FEF3C7;
    color: #D97706;
}

.my-assistant-action-icon.info {
    background: #DBEAFE;
    color: #2563EB;
}

/* Action Button */
.my-assistant-action-btn {
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid #E5E7EB;
    background: white;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.my-assistant-action-btn:hover {
    background: #F9FAFB;
    border-color: #D1D5DB;
}

.my-assistant-action-btn.primary {
    background: #8200DB;
    color: white;
    border-color: #8200DB;
}

.my-assistant-action-btn.primary:hover {
    background: #6B21A8;
    border-color: #6B21A8;
}

/* Mobile Responsive */
@media (max-width: 900px) {
    .my-assistant-stats {
        grid-template-columns: 1fr;
    }

    .my-assistant-two-col {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .my-assistant-dashboard {
        padding: 16px;
    }

    .my-assistant-stat-card {
        padding: 16px;
    }

    .my-assistant-stat-icon {
        width: 40px;
        height: 40px;
    }

    .my-assistant-stat-value {
        font-size: 16px;
    }
}

/* =====================================================
   DASHBOARD SWITCHER (Business/Personal Assistant Tabs)
   ===================================================== */

.dashboard-switcher {
    display: flex;
    align-items: center;
    gap: 2px;
    background: #F3F4F6;
    border-radius: 10px;
    padding: 4px;
    margin-left: 16px;
    border: 1px solid #E5E7EB;
}

.dashboard-switcher-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid transparent;
    background: transparent;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #6B7280;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    text-decoration: none;
}

.dashboard-switcher-btn:hover {
    color: #374151;
    background: rgba(255, 255, 255, 0.6);
}

.dashboard-switcher-btn.active {
    background: white;
    color: #111827;
    font-weight: 600;
    border: 1px solid #D1D5DB;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.dashboard-switcher-btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* Badge for unread counts */
.dashboard-switcher-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: var(--accent-color, #FF6B35);
    color: white;
    font-size: 11px;
    font-weight: 600;
    border-radius: 9px;
}

/* Mobile: Hide text, show icons only */
@media (max-width: 768px) {
    .dashboard-switcher {
        margin-left: 8px;
        padding: 3px;
    }

    .dashboard-switcher-btn {
        padding: 8px 10px;
    }

    .dashboard-switcher-btn span:not(.dashboard-switcher-badge) {
        display: none;
    }
}

/* =====================================================
   MY ASSISTANT PAGE LAYOUT
   ===================================================== */

.assistant-page {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-width: 100%;
    background: var(--bg-primary, #fff);
}

.assistant-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color, #e5e5e5);
    background: var(--bg-primary, #fff);
}

.assistant-page-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary, #333);
    margin: 0;
}

.assistant-settings-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    border-radius: 8px;
    color: var(--text-secondary, #666);
    cursor: pointer;
    transition: all 0.2s ease;
}

.assistant-settings-btn:hover {
    background: var(--bg-secondary, #f5f5f5);
    color: var(--text-primary, #333);
}

/* =====================================================
   CHAT CONTAINER
   ===================================================== */

.assistant-chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

/* Chat Toolbar */
.chat-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    border-bottom: 1px solid var(--ai-border, #E5E7EB);
    background: var(--ai-bg-secondary, #F9FAFB);
}

.chat-toolbar-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--ai-text-secondary, #6B7280);
}

.chat-toolbar-actions {
    display: flex;
    gap: 8px;
}

.chat-toolbar-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 500;
    color: var(--ai-text-secondary, #6B7280);
    background: var(--ai-bg-white, #FFFFFF);
    border: 1px solid var(--ai-border, #E5E7EB);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.chat-toolbar-btn:hover {
    color: var(--ai-text-primary, #111827);
    border-color: var(--ai-border-dark, #D1D5DB);
    background: var(--ai-bg-hover, #F3F4F6);
}

.chat-toolbar-btn:active {
    transform: scale(0.98);
}

.chat-toolbar-btn svg {
    flex-shrink: 0;
}

.chat-toolbar-btn.success {
    color: #059669;
    border-color: #059669;
    background: #ECFDF5;
}

.chat-toolbar-btn.error {
    color: #DC2626;
    border-color: #DC2626;
    background: #FEF2F2;
}

.assistant-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* =====================================================
   MESSAGE BUBBLES
   ===================================================== */

.assistant-message {
    display: flex;
    gap: 12px;
    max-width: 85%;
    animation: fadeInUp 0.3s ease;
}

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

.assistant-message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

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

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 14px;
    font-weight: 600;
}

.assistant-message.assistant .message-avatar {
    background: var(--ai-primary-gradient, linear-gradient(135deg, #9810FA 0%, #2B7FFF 100%));
    color: white;
}

.assistant-message.user .message-avatar {
    background: var(--bg-secondary, #f0f0f0);
    color: var(--text-secondary, #666);
}

.message-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.message-bubble {
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary, #333);
}

.assistant-message.assistant .message-bubble {
    background: var(--bg-secondary, #f5f5f5);
    border-bottom-left-radius: 4px;
}

.assistant-message.user .message-bubble {
    background: var(--accent-color, #FF6B35);
    color: white;
    border-bottom-right-radius: 4px;
}

.message-time {
    font-size: 11px;
    color: var(--text-tertiary, #999);
    padding: 0 4px;
}

.assistant-message.user .message-time {
    text-align: right;
}

/* Briefing message type */
.assistant-message.briefing .message-bubble {
    background: linear-gradient(135deg, #FAF5FF 0%, #F3E8FF 100%);
    border: 1px solid rgba(130, 0, 219, 0.15);
}

.briefing-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(130, 0, 219, 0.15);
    font-weight: 600;
    color: var(--accent-color);
}

.briefing-section {
    margin-bottom: 12px;
}

.briefing-section:last-child {
    margin-bottom: 0;
}

.briefing-section-title {
    font-weight: 500;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.briefing-list {
    margin: 0;
    padding-left: 20px;
    color: var(--text-secondary, #666);
}

.briefing-list li {
    margin-bottom: 4px;
}

/* =====================================================
   QUICK ACTIONS BAR
   ===================================================== */

.assistant-quick-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border-top: 1px solid var(--border-color, #e5e5e5);
    background: var(--bg-primary, #fff);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.quick-action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: 1px solid var(--border-color, #e0e0e0);
    background: white;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary, #666);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.quick-action-btn:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
    background: var(--accent-light, #FAF5FF);
}

.quick-action-btn svg {
    width: 16px;
    height: 16px;
}

/* =====================================================
   INPUT AREA
   ===================================================== */

.assistant-input-container {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid var(--border-color, #e5e5e5);
    background: var(--bg-primary, #fff);
}

.assistant-input-wrapper {
    flex: 1;
    display: flex;
    align-items: flex-end;
    background: var(--bg-secondary, #f5f5f5);
    border-radius: 24px;
    padding: 4px 4px 4px 16px;
    min-height: 48px;
}

.assistant-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary, #333);
    resize: none;
    max-height: 120px;
    padding: 10px 0;
    outline: none;
}

.assistant-input::placeholder {
    color: var(--text-tertiary, #999);
}

.assistant-send-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    background: var(--accent-color, #FF6B35);
    border-radius: 50%;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.assistant-send-btn:hover {
    background: #6B21A8;
    transform: scale(1.05);
}

.assistant-send-btn:disabled {
    background: var(--text-tertiary, #ccc);
    cursor: not-allowed;
    transform: none;
}

.assistant-send-btn svg {
    width: 20px;
    height: 20px;
}

/* =====================================================
   TASKS VIEW
   ===================================================== */

.assistant-tasks-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

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

.tasks-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary, #333);
    margin: 0;
}

.tasks-add-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: none;
    background: var(--accent-color, #FF6B35);
    color: white;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tasks-add-btn:hover {
    background: #6B21A8;
}

.tasks-section {
    margin-bottom: 24px;
}

.tasks-section-title {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-tertiary, #999);
    margin-bottom: 12px;
}

.task-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg-secondary, #f8f8f8);
    border-radius: 12px;
    margin-bottom: 8px;
    transition: all 0.2s ease;
}

.task-item:hover {
    background: #f0f0f0;
}

.task-checkbox {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color, #ddd);
    border-radius: 50%;
    cursor: pointer;
    flex-shrink: 0;
    margin-top: 2px;
    transition: all 0.2s ease;
}

.task-checkbox:hover {
    border-color: var(--accent-color, #FF6B35);
}

.task-item.completed .task-checkbox {
    background: var(--success-color, #22c55e);
    border-color: var(--success-color, #22c55e);
}

.task-item.completed .task-checkbox::after {
    content: '';
    display: block;
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) translate(2px, -2px);
    margin: 2px auto;
}

.task-content {
    flex: 1;
    min-width: 0;
}

.task-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary, #333);
    margin-bottom: 4px;
}

.task-item.completed .task-title {
    text-decoration: line-through;
    color: var(--text-tertiary, #999);
}

.task-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: var(--text-tertiary, #999);
}

.task-due {
    display: flex;
    align-items: center;
    gap: 4px;
}

.task-due.overdue {
    color: var(--error-color, #ef4444);
}

.task-due svg {
    width: 12px;
    height: 12px;
}

/* Completed section collapsed by default */
.tasks-section.completed .task-item {
    opacity: 0.6;
}

.tasks-section-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    padding: 8px 0;
    border: none;
    background: transparent;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-tertiary, #999);
    cursor: pointer;
}

.tasks-section-toggle svg {
    width: 16px;
    height: 16px;
    transition: transform 0.2s ease;
}

.tasks-section-toggle.collapsed svg {
    transform: rotate(-90deg);
}

/* =====================================================
   ASSISTANT SETTINGS MODAL
   ===================================================== */

.assistant-settings-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.assistant-settings-modal.active {
    display: flex;
}

.assistant-settings-content {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
}

.assistant-settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color, #e5e5e5);
}

.assistant-settings-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary, #333);
    margin: 0;
}

.assistant-settings-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    border-radius: 8px;
    color: var(--text-secondary, #666);
    cursor: pointer;
}

.assistant-settings-close:hover {
    background: var(--bg-secondary, #f5f5f5);
}

.assistant-settings-body {
    padding: 24px;
}

.settings-group {
    margin-bottom: 24px;
}

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

.settings-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary, #333);
    margin-bottom: 8px;
}

.settings-input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border-color, #e0e0e0);
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-primary, #333);
    outline: none;
    transition: border-color 0.2s ease;
}

.settings-input:focus {
    border-color: var(--accent-color, #FF6B35);
}

.settings-select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border-color, #e0e0e0);
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-primary, #333);
    outline: none;
    background: white;
    cursor: pointer;
}

.settings-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
}

.toggle-label {
    font-size: 14px;
    color: var(--text-primary, #333);
}

.toggle-switch {
    position: relative;
    width: 48px;
    height: 28px;
    background: var(--bg-secondary, #e0e0e0);
    border-radius: 14px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.toggle-switch.active {
    background: var(--accent-color, #FF6B35);
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 24px;
    height: 24px;
    background: white;
    border-radius: 50%;
    transition: transform 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.toggle-switch.active::after {
    transform: translateX(20px);
}

.assistant-settings-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color, #e5e5e5);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.settings-btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.settings-btn-secondary {
    border: 1px solid var(--border-color, #e0e0e0);
    background: white;
    color: var(--text-secondary, #666);
}

.settings-btn-secondary:hover {
    background: var(--bg-secondary, #f5f5f5);
}

.settings-btn-primary {
    border: none;
    background: var(--accent-color, var(--figma-primary, #8200DB));
    color: white;
}

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

/* =====================================================
   LOADING STATES
   ===================================================== */

.assistant-typing {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 16px;
    background: var(--bg-secondary, #f5f5f5);
    border-radius: 16px;
    border-bottom-left-radius: 4px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: var(--text-tertiary, #999);
    border-radius: 50%;
    animation: typingDot 1.4s ease-in-out infinite;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingDot {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-6px);
    }
}

/* =====================================================
   EMPTY STATE
   ===================================================== */

.assistant-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    color: var(--text-secondary, #666);
}

.assistant-empty-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.assistant-empty-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary, #333);
    margin-bottom: 8px;
}

.assistant-empty-text {
    font-size: 14px;
    max-width: 300px;
    line-height: 1.5;
}

/* =====================================================
   MOBILE OPTIMIZATIONS
   ===================================================== */

@media (max-width: 768px) {
    .assistant-page-header {
        padding: 12px 16px;
    }

    .assistant-page-title {
        font-size: 18px;
    }

    .assistant-messages {
        padding: 16px;
    }

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

    .message-avatar {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }

    .assistant-quick-actions {
        padding: 10px 16px;
    }

    .assistant-input-container {
        padding: 12px 16px;
    }

    .assistant-tasks-container {
        padding: 16px;
    }

    .task-item {
        padding: 12px 14px;
    }
}

/* Safe area for mobile PWA */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .assistant-input-container {
        padding-bottom: calc(16px + env(safe-area-inset-bottom));
    }
}

/* =====================================================
   VIEW TABS (Chat / Tasks)
   ===================================================== */

.assistant-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color, #e5e5e5);
    background: var(--bg-primary, #fff);
}

.assistant-tab {
    flex: 1;
    padding: 14px 20px;
    border: none;
    background: transparent;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary, #666);
    cursor: pointer;
    position: relative;
    transition: color 0.2s ease;
}

.assistant-tab:hover {
    color: var(--text-primary, #333);
}

.assistant-tab.active {
    color: var(--accent-color, #FF6B35);
}

.assistant-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 20px;
    right: 20px;
    height: 2px;
    background: var(--accent-color, #FF6B35);
    border-radius: 1px;
}

.assistant-tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: var(--accent-color, #FF6B35);
    color: white;
    font-size: 11px;
    font-weight: 600;
    border-radius: 9px;
    margin-left: 6px;
}

/* Hide inactive view */
.assistant-view {
    display: none;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.assistant-view.active {
    display: flex;
}

/* =====================================================
   CHAT PAGE SPECIFIC STYLES (assistant/chat.html)
   These match the class names used in assistant-chat.js
   ===================================================== */

/* Chat container full height fix */
.my-assistant-page .assistant-chat-container {
    height: calc(100vh - 72px);
    display: flex;
    flex-direction: column;
    background: var(--ai-bg-main, #F9FAFB);
}

.my-assistant-page .assistant-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Chat Message - Base */
.chat-message {
    display: flex;
    gap: 12px;
    max-width: 80%;
    animation: fadeInUp 0.3s ease;
}

.chat-message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

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

/* Chat Avatar */
.chat-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 13px;
    font-weight: 600;
}

.chat-avatar.assistant {
    background: var(--ai-primary-gradient, linear-gradient(135deg, #9810FA 0%, #2B7FFF 100%));
    color: white;
}

.chat-avatar.user {
    background: var(--ai-bg-main, #F3F4F6);
    color: var(--ai-text-medium, #4B5563);
    border: 1px solid var(--ai-border, #E5E7EB);
}

/* Chat Bubble */
.chat-bubble {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 100%;
}

.chat-bubble-content {
    padding: 14px 18px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--ai-text-dark, #111827);
}

.chat-message.assistant .chat-bubble-content {
    background: white;
    border: 1px solid var(--ai-border, #E5E7EB);
    border-bottom-left-radius: 4px;
}

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

.chat-bubble-content strong {
    font-weight: 600;
}

.chat-bubble-content ul {
    margin: 8px 0;
    padding-left: 20px;
}

.chat-bubble-content li {
    margin-bottom: 4px;
}

.chat-bubble-time {
    font-size: 11px;
    color: var(--ai-text-muted, #6B7280);
    padding: 0 4px;
}

.chat-message.user .chat-bubble-time {
    text-align: right;
}

/* Chat Actions */
.chat-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.chat-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: white;
    border: 1px solid var(--ai-border, #E5E7EB);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--ai-text-medium, #374151);
    cursor: pointer;
    transition: all 0.15s ease;
}

.chat-action-btn:hover {
    background: var(--ai-primary-light, #FAF5FF);
    border-color: var(--ai-primary, #8200DB);
    color: var(--ai-primary, #8200DB);
}

.chat-action-btn svg {
    width: 16px;
    height: 16px;
}

/* Loading state */
.chat-message.loading .chat-bubble-content {
    min-width: 60px;
}

/* Quick Actions Bar - Improved styling */
.my-assistant-page .assistant-quick-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: white;
    border-top: 1px solid var(--ai-border, #E5E7EB);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.my-assistant-page .quick-action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: white;
    border: 1px solid var(--ai-border, #E5E7EB);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--ai-text-medium, #374151);
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.my-assistant-page .quick-action-btn:hover {
    background: var(--ai-primary-light, #FAF5FF);
    border-color: var(--ai-primary, #8200DB);
    color: var(--ai-primary, #8200DB);
}

.my-assistant-page .quick-action-btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* Input Area - Improved styling */
.my-assistant-page .assistant-input-container {
    padding: 16px 24px 24px;
    background: white;
    border-top: 1px solid var(--ai-border, #E5E7EB);
}

.my-assistant-page .assistant-input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    background: var(--ai-bg-main, #F9FAFB);
    border: 1px solid var(--ai-border, #E5E7EB);
    border-radius: 12px;
    padding: 4px 4px 4px 16px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.my-assistant-page .assistant-input-wrapper:focus-within {
    border-color: var(--ai-primary, #8200DB);
    box-shadow: 0 0 0 3px rgba(130, 0, 219, 0.1);
}

.my-assistant-page .assistant-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 14px;
    line-height: 1.5;
    color: var(--ai-text-dark, #111827);
    resize: none;
    max-height: 120px;
    padding: 12px 0;
    outline: none;
    font-family: var(--ai-font, 'Inter', sans-serif);
}

.my-assistant-page .assistant-input::placeholder {
    color: var(--ai-text-muted, #9CA3AF);
}

.my-assistant-page .assistant-send-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: none;
    background: var(--ai-primary, #8200DB);
    border-radius: 10px;
    color: white;
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.my-assistant-page .assistant-send-btn:hover:not(:disabled) {
    background: #6B21A8;
    transform: scale(1.02);
}

.my-assistant-page .assistant-send-btn:disabled {
    background: var(--ai-border, #D1D5DB);
    cursor: not-allowed;
}

.my-assistant-page .assistant-send-btn svg {
    width: 20px;
    height: 20px;
}

/* Empty state for chat */
.my-assistant-page .assistant-messages:empty::before {
    content: '';
}

/* Mobile Responsive for Chat Page */
@media (max-width: 768px) {
    .my-assistant-page .assistant-chat-container {
        height: calc(100vh - 64px);
    }

    .my-assistant-page .assistant-messages {
        padding: 16px;
    }

    /* Chat toolbar mobile */
    .chat-toolbar {
        padding: 10px 16px;
    }

    .chat-toolbar-title {
        font-size: 13px;
    }

    .chat-toolbar-btn {
        padding: 5px 10px;
        font-size: 12px;
    }

    .chat-toolbar-btn span {
        display: none;
    }

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

    .chat-avatar {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }

    .chat-bubble-content {
        padding: 12px 14px;
        font-size: 14px;
    }

    .my-assistant-page .assistant-quick-actions {
        padding: 10px 16px;
    }

    .my-assistant-page .quick-action-btn {
        padding: 8px 12px;
        font-size: 12px;
    }

    .my-assistant-page .assistant-input-container {
        padding: 12px 16px 20px;
    }
}

/* =====================================================
   TASK MODAL STYLES
   ===================================================== */

.task-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

.task-modal.active {
    opacity: 1;
    visibility: visible;
}

.task-modal-content {
    background: var(--bg-primary, #FFFFFF);
    border-radius: 16px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.95);
    transition: transform 0.2s ease;
}

.task-modal.active .task-modal-content {
    transform: scale(1);
}

.task-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid var(--border-color, #E5E7EB);
}

.task-modal-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary, #101828);
}

.task-modal-close {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--bg-secondary, #F9FAFB);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary, #364153);
    cursor: pointer;
    font-size: 20px;
    transition: all 0.15s ease;
}

.task-modal-close:hover {
    background: var(--border-color, #E5E7EB);
    color: var(--text-primary, #101828);
}

.task-modal-body {
    padding: 20px;
}

.task-form-group {
    margin-bottom: 16px;
}

.task-form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary, #101828);
    margin-bottom: 6px;
}

.task-form-input,
.task-form-textarea,
.task-form-select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border-color, #E5E7EB);
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-primary, #101828);
    background: var(--bg-primary, #FFFFFF);
    transition: all 0.15s ease;
    box-sizing: border-box;
}

.task-form-input:focus,
.task-form-textarea:focus,
.task-form-select:focus {
    outline: none;
    border-color: var(--accent-color, #8200DB);
    box-shadow: 0 0 0 3px rgba(130, 0, 219, 0.1);
}

.task-form-textarea {
    resize: vertical;
    min-height: 80px;
}

.task-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.task-modal-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding: 16px 20px;
    border-top: 1px solid var(--border-color, #E5E7EB);
}

.task-modal-footer .btn-secondary {
    padding: 10px 20px;
    border: 1px solid var(--border-color, #E5E7EB);
    background: var(--bg-primary, #FFFFFF);
    color: var(--text-secondary, #364153);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.task-modal-footer .btn-secondary:hover {
    background: var(--bg-secondary, #F9FAFB);
}

.task-modal-footer .btn-primary {
    padding: 10px 20px;
    border: none;
    background: var(--accent-color, #8200DB);
    color: #FFFFFF;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.task-modal-footer .btn-primary:hover {
    background: #6B00B8;
}
