/* Automation Pages Styles - v20260103a */

/* ============================================
   PAGE LAYOUT
   ============================================ */

.automation-page {
    padding: 32px 40px;
    max-width: 1200px;
}

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

.automation-header-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.automation-title {
    font-size: 28px;
    font-weight: 600;
    color: #101828;
    margin: 0;
}

.automation-subtitle {
    font-size: 14px;
    color: #4A5565;
    margin: 0;
}

.automation-action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: white;
    color: #374151;
    border: 1px solid #D1D5DB;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.automation-action-btn:hover {
    background: #F9FAFB;
    border-color: #9CA3AF;
}

/* ============================================
   SETUP BANNER
   ============================================ */

.automation-setup-banner {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    background: linear-gradient(135deg, #EBF5FF 0%, #F3E8FF 100%);
    border: 1px solid #C7D2FE;
    border-radius: 12px;
    margin-bottom: 24px;
}

.automation-setup-banner-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6366F1;
    flex-shrink: 0;
}

.automation-setup-banner-content {
    flex: 1;
}

.automation-setup-banner-content strong {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: #1F2937;
    margin-bottom: 4px;
}

.automation-setup-banner-content p {
    margin: 0;
    font-size: 14px;
    color: #4B5563;
}

.automation-setup-banner-btn {
    padding: 10px 24px;
    background: linear-gradient(90deg, #9810FA 0%, #155DFC 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.2s;
    flex-shrink: 0;
}

.automation-setup-banner-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* ============================================
   METRICS GRID
   ============================================ */

.automation-metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

.automation-metric-card {
    background: white;
    border: 1px solid #EAECF0;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

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

.automation-metric-icon--blue {
    background: #EBF5FF;
    color: #155DFC;
}

.automation-metric-icon--green {
    background: #DCFCE7;
    color: #166534;
}

.automation-metric-icon--purple {
    background: #F3E8FF;
    color: #9810FA;
}

.automation-metric-icon--orange {
    background: #FEF3C7;
    color: #92400E;
}

.automation-metric-value {
    font-size: 28px;
    font-weight: 600;
    color: #101828;
    margin: 0;
}

.automation-metric-label {
    font-size: 14px;
    color: #4A5565;
    margin: 0;
}

.automation-metric-change {
    font-size: 13px;
    font-weight: 500;
    margin: 0;
}

.automation-metric-change--up {
    color: #059669;
}

.automation-metric-change--down {
    color: #DC2626;
}

/* ============================================
   SECTIONS
   ============================================ */

.automation-section {
    background: white;
    border: 1px solid #EAECF0;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}

.automation-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.automation-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
    color: #101828;
    margin: 0;
}

.automation-section-title svg {
    color: #6B7280;
}

.automation-section-subtitle {
    font-size: 13px;
    color: #6B7280;
}

.automation-section-link {
    font-size: 14px;
    color: #155DFC;
    text-decoration: none;
    font-weight: 500;
}

.automation-section-link:hover {
    text-decoration: underline;
}

/* ============================================
   ATTENTION NEEDED
   ============================================ */

.automation-attention-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.automation-attention-group {
    border: 1px solid #EAECF0;
    border-radius: 8px;
    overflow: hidden;
}

.automation-attention-group-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #F9FAFB;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
}

.automation-attention-group-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.automation-attention-group-icon--yellow {
    background: #FEF3C7;
    color: #92400E;
}

.automation-attention-group-icon--red {
    background: #FEE2E2;
    color: #DC2626;
}

.automation-attention-group-count {
    margin-left: auto;
    font-size: 13px;
    font-weight: 400;
    color: #6B7280;
}

.automation-attention-items {
    padding: 8px 0;
}

.automation-attention-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    font-size: 14px;
    color: #374151;
}

.automation-attention-item:hover {
    background: #F9FAFB;
}

.automation-attention-item-text {
    display: flex;
    align-items: center;
    gap: 8px;
}

.automation-attention-item-count {
    font-size: 12px;
    color: #9CA3AF;
    background: #F3F4F6;
    padding: 2px 8px;
    border-radius: 10px;
}

.automation-attention-item-btn {
    padding: 6px 12px;
    background: #F3F4F6;
    color: #374151;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.automation-attention-item-btn:hover {
    background: #E5E7EB;
}

.automation-attention-empty {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: #F0FDF4;
    border-radius: 8px;
    font-size: 14px;
    color: #166534;
}

.automation-attention-empty svg {
    color: #22C55E;
    flex-shrink: 0;
}

/* ============================================
   CATEGORY TABLE
   ============================================ */

.automation-category-table {
    border: 1px solid #EAECF0;
    border-radius: 8px;
    overflow: hidden;
}

.automation-category-header {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 100px;
    gap: 16px;
    padding: 12px 16px;
    background: #F9FAFB;
    font-size: 12px;
    font-weight: 600;
    color: #6B7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.automation-category-list {
    max-height: 400px;
    overflow-y: auto;
}

.automation-category-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 100px;
    gap: 16px;
    padding: 14px 16px;
    border-bottom: 1px solid #EAECF0;
    align-items: center;
    font-size: 14px;
    color: #374151;
    cursor: pointer;
    transition: background 0.2s;
}

.automation-category-row:hover {
    background: #F9FAFB;
}

.automation-category-row:last-child {
    border-bottom: none;
}

.automation-category-row--inactive {
    color: #9CA3AF;
}

.automation-category-name {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}

.automation-category-icon {
    font-size: 18px;
}

.automation-category-knowledge {
    display: flex;
    gap: 4px;
}

.automation-category-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #E5E7EB;
}

.automation-category-dot--filled {
    background: #22C55E;
}

.automation-category-actions {
    color: #6B7280;
}

.automation-category-status {
    display: flex;
    justify-content: center;
}

.automation-category-status-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.automation-category-status-icon--good {
    color: #22C55E;
}

.automation-category-status-icon--warning {
    color: #F59E0B;
}

.automation-category-status-icon--inactive {
    color: #D1D5DB;
}

.automation-category-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 40px;
    color: #6B7280;
    font-size: 14px;
}

.automation-category-footer {
    padding: 12px 16px;
    background: #F9FAFB;
    border-top: 1px solid #EAECF0;
}

.automation-category-setup-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: white;
    color: #374151;
    border: 1px solid #D1D5DB;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.automation-category-setup-btn:hover {
    background: #F3F4F6;
    border-color: #9CA3AF;
}

/* Category table column styling */
.automation-category-col {
    display: flex;
    align-items: center;
}

.automation-category-col--name {
    gap: 10px;
    font-weight: 500;
}

.automation-category-col--knowledge,
.automation-category-col--actions {
    color: #6B7280;
}

.automation-category-col--status {
    justify-content: center;
}

/* Status badge styles */
.automation-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.automation-status--active {
    background: #DCFCE7;
    color: #166534;
}

.automation-status--active svg {
    stroke: #166534;
}

.automation-status--warning {
    background: #FEF3C7;
    color: #92400E;
}

.automation-status--warning svg {
    stroke: #92400E;
}

.automation-status--inactive {
    background: #F3F4F6;
    color: #6B7280;
}

/* Template row styles for Actions/Routines */
.automation-category-name-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.automation-category-icon {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #F3F4F6;
}

.automation-category-icon svg {
    width: 18px;
    height: 18px;
    stroke: #6B7280;
}

.automation-category-name-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.automation-category-name {
    font-size: 14px;
    font-weight: 500;
    color: #111827;
}

.automation-category-desc {
    font-size: 12px;
    color: #6B7280;
    line-height: 1.3;
    max-width: 280px;
}

/* Type badges for action types */
.automation-type-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

.automation-type-badge--share_info {
    background: #DBEAFE;
    color: #1D4ED8;
}

.automation-type-badge--search_recommend {
    background: #FEF3C7;
    color: #B45309;
}

.automation-type-badge--complete_task {
    background: #D1FAE5;
    color: #047857;
}

.automation-type-badge--message_customer {
    background: #FCE7F3;
    color: #BE185D;
}

/* Tool badge */
.automation-tool-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    background: #F3F4F6;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    color: #4B5563;
}

/* Use button in template row */
.automation-category-use-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: #7C3AED;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.automation-category-use-btn:hover {
    background: #6D28D9;
}

.automation-category-use-btn svg {
    width: 14px;
    height: 14px;
    stroke: white;
}

/* Trigger badges for routines */
.automation-trigger-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

.automation-trigger-badge--scheduled {
    background: #DBEAFE;
    color: #1D4ED8;
}

.automation-trigger-badge--event {
    background: #FEF3C7;
    color: #B45309;
}

.automation-trigger-badge--manual {
    background: #F3F4F6;
    color: #4B5563;
}

.automation-trigger-badge--webhook {
    background: #E0E7FF;
    color: #4338CA;
}

/* Templates empty state */
.automation-templates-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    text-align: center;
    color: #6B7280;
}

.automation-templates-empty .empty-icon {
    margin-bottom: 16px;
}

.automation-templates-empty .empty-icon svg {
    stroke: #D1D5DB;
}

.automation-templates-empty h3 {
    font-size: 16px;
    font-weight: 600;
    color: #374151;
    margin: 0 0 8px 0;
}

.automation-templates-empty p {
    font-size: 14px;
    margin: 0;
}

/* Category empty state */
.automation-category-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 48px 24px;
    color: #6B7280;
    text-align: center;
}

.automation-category-empty svg {
    stroke: #D1D5DB;
}

.automation-category-empty p {
    margin: 0;
    font-size: 14px;
}

.automation-btn-sm {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #6366F1;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.automation-btn-sm:hover {
    background: #4F46E5;
}

/* ============================================
   ROUTINE LIST
   ============================================ */

.automation-routine-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.automation-routine-card {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    gap: 16px;
    padding: 14px 16px;
    background: #F9FAFB;
    border-radius: 8px;
    align-items: center;
}

.automation-routine-icon {
    font-size: 20px;
}

.automation-routine-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.automation-routine-name {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
}

.automation-routine-stats {
    font-size: 13px;
    color: #6B7280;
}

.automation-routine-conversion {
    font-size: 14px;
    font-weight: 600;
    color: #059669;
}

.automation-routine-loading,
.automation-routine-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 40px;
    color: #6B7280;
    font-size: 14px;
}

.automation-routine-empty svg {
    color: #D1D5DB;
}

.automation-routine-empty-link {
    color: #155DFC;
    text-decoration: none;
    font-weight: 500;
}

.automation-routine-empty-link:hover {
    text-decoration: underline;
}

/* Routine Performance Rows */
.automation-routine-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #F9FAFB;
    border-radius: 8px;
    gap: 16px;
}

.automation-routine-row .automation-routine-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.automation-routine-row .automation-routine-status {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    background: #D1D5DB;
}

.automation-routine-row .automation-routine-status.active {
    background: #10B981;
}

.automation-routine-row .automation-routine-status.paused {
    background: #F59E0B;
}

.automation-routine-row .automation-routine-name {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.automation-routine-row .automation-routine-stats {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

.automation-routine-row .automation-routine-runs {
    font-size: 13px;
    font-weight: 500;
    color: #6B7280;
    white-space: nowrap;
}

.automation-routine-row .automation-routine-last {
    font-size: 13px;
    color: #9CA3AF;
    white-space: nowrap;
}

/* ============================================
   LOADING SPINNER
   ============================================ */

.automation-loading-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #E5E7EB;
    border-top-color: #155DFC;
    border-radius: 50%;
    animation: automation-spin 1s linear infinite;
}

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

/* ============================================
   MODALS
   ============================================ */

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

.automation-modal {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.automation-modal--wizard {
    max-width: 600px;
}

.automation-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #EAECF0;
}

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

.automation-modal-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    border-radius: 8px;
    color: #6B7280;
    cursor: pointer;
    transition: background 0.2s;
}

.automation-modal-close:hover {
    background: #F3F4F6;
}

.automation-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.automation-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid #EAECF0;
}

/* ============================================
   WIZARD STEPS
   ============================================ */

.automation-wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 24px;
    background: #F9FAFB;
}

.automation-wizard-step {
    display: flex;
    align-items: center;
    gap: 8px;
}

.automation-wizard-step-number {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #E5E7EB;
    color: #6B7280;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

.automation-wizard-step.active .automation-wizard-step-number {
    background: linear-gradient(90deg, #9810FA 0%, #155DFC 100%);
    color: white;
}

.automation-wizard-step.completed .automation-wizard-step-number {
    background: #22C55E;
    color: white;
}

.automation-wizard-step-label {
    font-size: 13px;
    font-weight: 500;
    color: #6B7280;
}

.automation-wizard-step.active .automation-wizard-step-label {
    color: #374151;
}

.automation-wizard-step-line {
    width: 40px;
    height: 2px;
    background: #E5E7EB;
    margin: 0 8px;
}

.automation-wizard-content {
    padding: 32px 24px;
}

.automation-wizard-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.automation-wizard-icon {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    background: #F3E8FF;
    color: #9810FA;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.automation-wizard-icon--success {
    background: #DCFCE7;
    color: #22C55E;
}

.automation-wizard-panel-title {
    font-size: 20px;
    font-weight: 600;
    color: #101828;
    margin: 0 0 8px 0;
}

.automation-wizard-panel-desc {
    font-size: 14px;
    color: #6B7280;
    margin: 0 0 24px 0;
}

.automation-wizard-pages {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: left;
}

.automation-wizard-page {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #F9FAFB;
    border: 1px solid #EAECF0;
    border-radius: 8px;
}

.automation-wizard-page-check {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    background: #22C55E;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.automation-wizard-page-info {
    flex: 1;
    min-width: 0;
}

.automation-wizard-page-name {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
}

.automation-wizard-page-url {
    font-size: 12px;
    color: #9CA3AF;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.automation-wizard-routines {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: left;
}

.automation-wizard-routine {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    background: #F9FAFB;
    border: 1px solid #EAECF0;
    border-radius: 8px;
}

.automation-wizard-routine-check {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 2px solid #D1D5DB;
    background: white;
    flex-shrink: 0;
    cursor: pointer;
    transition: all 0.2s;
}

.automation-wizard-routine-check.checked {
    background: #22C55E;
    border-color: #22C55E;
    position: relative;
}

.automation-wizard-routine-check.checked::after {
    content: '';
    position: absolute;
    inset: 3px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E") center/contain no-repeat;
}

.automation-wizard-routine-info {
    flex: 1;
}

.automation-wizard-routine-name {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 2px;
}

.automation-wizard-routine-desc {
    font-size: 13px;
    color: #6B7280;
}

.automation-wizard-routine-warning {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #F59E0B;
    margin-top: 4px;
}

/* ============================================
   FORM ELEMENTS
   ============================================ */

.automation-form-group {
    width: 100%;
    margin-bottom: 16px;
}

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

.automation-form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
}

.automation-form-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #D1D5DB;
    border-radius: 8px;
    font-size: 14px;
    color: #374151;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.automation-form-input:focus {
    outline: none;
    border-color: #155DFC;
    box-shadow: 0 0 0 3px rgba(21, 93, 252, 0.1);
}

.automation-form-input--large {
    padding: 14px 18px;
    font-size: 16px;
}

.automation-form-input::placeholder {
    color: #9CA3AF;
}

.automation-test-description {
    font-size: 14px;
    color: #6B7280;
    margin: 0 0 20px 0;
}

.automation-test-response {
    margin-top: 20px;
    padding: 16px;
    background: #F9FAFB;
    border-radius: 8px;
}

.automation-test-response label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #6B7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.automation-response-content {
    font-size: 14px;
    color: #374151;
    line-height: 1.6;
}

.automation-response-sources {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #E5E7EB;
    font-size: 12px;
    color: #9CA3AF;
}

/* ============================================
   BUTTONS
   ============================================ */

.automation-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(90deg, #9810FA 0%, #155DFC 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.2s;
}

.automation-btn-primary:hover {
    opacity: 0.9;
}

.automation-btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.automation-btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: white;
    color: #374151;
    border: 1px solid #D1D5DB;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.automation-btn-secondary:hover {
    background: #F9FAFB;
    border-color: #9CA3AF;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1024px) {
    .automation-metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .automation-category-header,
    .automation-category-row {
        grid-template-columns: 1.5fr 1fr 1fr 80px;
    }
}

@media (max-width: 768px) {
    .automation-page {
        padding: 20px;
    }

    .automation-header {
        flex-direction: column;
        gap: 16px;
    }

    .automation-action-btn {
        width: 100%;
        justify-content: center;
    }

    .automation-metrics-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .automation-metric-card {
        padding: 16px;
    }

    .automation-metric-value {
        font-size: 24px;
    }

    .automation-setup-banner {
        flex-direction: column;
        text-align: center;
    }

    .automation-setup-banner-btn {
        width: 100%;
    }

    .automation-category-header,
    .automation-category-row {
        grid-template-columns: 1fr auto auto;
    }

    .automation-category-col--knowledge {
        display: none;
    }

    .automation-wizard-steps {
        padding: 16px;
    }

    .automation-wizard-step-label {
        display: none;
    }

    .automation-wizard-step-line {
        width: 24px;
    }

    .automation-modal {
        max-height: 100%;
        border-radius: 16px 16px 0 0;
        margin-top: auto;
    }
}

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

    .automation-section {
        padding: 16px;
    }

    .automation-routine-card {
        grid-template-columns: auto 1fr;
        gap: 12px;
    }

    .automation-routine-stats,
    .automation-routine-conversion {
        grid-column: 2;
    }
}

/* ============================================
   ROUTINES SEARCH AND FILTER
   ============================================ */

.routines-filter-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.routines-search-wrapper {
    position: relative;
    flex: 1;
    max-width: 320px;
    min-width: 200px;
}

.routines-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #9CA3AF;
    pointer-events: none;
}

.routines-search-input {
    width: 100%;
    padding: 10px 14px 10px 40px;
    font-size: 14px;
    font-weight: 400;
    color: #101828;
    background: #fff;
    border: 1px solid #D1D5DB;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.routines-search-input:focus {
    outline: none;
    border-color: #7C3AED;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.routines-search-input::placeholder {
    color: #9CA3AF;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .routines-filter-row {
        flex-direction: column;
        align-items: stretch;
    }

    .routines-search-wrapper {
        max-width: 100%;
    }

    .status-filter-tabs {
        justify-content: center;
    }
}

/* ============================================
   TAB NAVIGATION
   ============================================ */

.automation-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
    border-bottom: 1px solid #EAECF0;
}

.automation-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: #6B7280;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: -1px;
}

.automation-tab:hover {
    color: #374151;
    background: #F9FAFB;
}

.automation-tab.active {
    color: #155DFC;
    border-bottom-color: #155DFC;
}

.automation-tab svg {
    opacity: 0.7;
}

.automation-tab.active svg {
    opacity: 1;
}

.automation-tab-panel {
    display: none;
}

.automation-tab-panel.active {
    display: block;
}

/* ============================================
   TEST CENTER
   ============================================ */

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

.test-center-summary {
    display: flex;
    gap: 24px;
}

.test-center-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.test-center-stat-value {
    font-size: 24px;
    font-weight: 600;
    color: #101828;
}

.test-center-stat-value--green {
    color: #059669;
}

.test-center-stat-value--red {
    color: #DC2626;
}

.test-center-stat-label {
    font-size: 12px;
    color: #6B7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.test-center-actions {
    display: flex;
    gap: 12px;
}

/* Test Filters */
.test-center-filters {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.test-center-filter-group {
    display: flex;
    gap: 12px;
}

.test-center-select {
    padding: 8px 32px 8px 12px;
    border: 1px solid #D1D5DB;
    border-radius: 6px;
    font-size: 14px;
    color: #374151;
    background: white url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") right 8px center no-repeat;
    appearance: none;
    cursor: pointer;
    min-width: 140px;
}

.test-center-select:focus {
    outline: none;
    border-color: #155DFC;
    box-shadow: 0 0 0 3px rgba(21, 93, 252, 0.1);
}

.test-center-search {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: white;
    border: 1px solid #D1D5DB;
    border-radius: 6px;
    flex: 1;
    max-width: 280px;
}

.test-center-search svg {
    color: #9CA3AF;
    flex-shrink: 0;
}

.test-center-search input {
    flex: 1;
    border: none;
    font-size: 14px;
    color: #374151;
}

.test-center-search input:focus {
    outline: none;
}

.test-center-search input::placeholder {
    color: #9CA3AF;
}

/* Test List */
.test-center-list {
    background: white;
    border: 1px solid #EAECF0;
    border-radius: 12px;
    overflow: hidden;
}

.test-center-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 48px;
    color: #6B7280;
    font-size: 14px;
}

.test-center-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 64px 24px;
    text-align: center;
}

.test-center-empty svg {
    color: #D1D5DB;
}

.test-center-empty h3 {
    font-size: 16px;
    font-weight: 600;
    color: #374151;
    margin: 0;
}

.test-center-empty p {
    font-size: 14px;
    color: #6B7280;
    margin: 0 0 16px 0;
    max-width: 320px;
}

/* Test Items */
.test-center-items {
    display: flex;
    flex-direction: column;
}

.test-item {
    display: grid;
    grid-template-columns: 40px 1fr auto auto;
    gap: 16px;
    padding: 16px 20px;
    border-bottom: 1px solid #EAECF0;
    align-items: center;
    transition: background 0.2s;
}

.test-item:hover {
    background: #F9FAFB;
}

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

.test-item-status {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.test-item-status--passing {
    background: #DCFCE7;
    color: #166534;
}

.test-item-status--failing {
    background: #FEE2E2;
    color: #DC2626;
}

.test-item-status--not-run {
    background: #F3F4F6;
    color: #6B7280;
}

.test-item-content {
    min-width: 0;
}

.test-item-question {
    font-size: 14px;
    font-weight: 500;
    color: #101828;
    margin: 0 0 4px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.test-item-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.test-item-type {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.test-item-type--knowledge {
    background: #EBF5FF;
    color: #155DFC;
}

.test-item-type--action {
    background: #F3E8FF;
    color: #9810FA;
}

.test-item-type--routine {
    background: #FEF3C7;
    color: #92400E;
}

.test-item-tags {
    display: flex;
    gap: 4px;
}

.test-item-tag {
    padding: 2px 6px;
    background: #F3F4F6;
    border-radius: 4px;
    font-size: 11px;
    color: #6B7280;
}

.test-item-last-run {
    font-size: 12px;
    color: #9CA3AF;
}

.test-item-actions {
    display: flex;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.2s;
}

.test-item:hover .test-item-actions {
    opacity: 1;
}

.test-item-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 1px solid #D1D5DB;
    border-radius: 6px;
    color: #6B7280;
    cursor: pointer;
    transition: all 0.2s;
}

.test-item-btn:hover {
    background: #F3F4F6;
    color: #374151;
}

.test-item-btn--run {
    color: #059669;
}

.test-item-btn--run:hover {
    background: #DCFCE7;
    border-color: #059669;
}

/* Create Test Modal Styles */
.automation-modal--medium {
    max-width: 560px;
}

.test-modal-description {
    font-size: 14px;
    color: #6B7280;
    margin: 0 0 20px 0;
}

.automation-form-textarea {
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
}

.test-optional {
    font-weight: 400;
    color: #9CA3AF;
}

.test-field-hint {
    font-size: 12px;
    color: #9CA3AF;
    margin: 4px 0 0 0;
}

.test-result-preview {
    margin-top: 20px;
    padding: 16px;
    background: #F9FAFB;
    border-radius: 8px;
    border: 1px solid #EAECF0;
}

.test-result-preview label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #6B7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.test-result-content {
    font-size: 14px;
    color: #374151;
    line-height: 1.6;
    padding: 12px;
    background: white;
    border-radius: 6px;
    border: 1px solid #EAECF0;
}

.test-result-status {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
}

.test-result-status--pass {
    background: #DCFCE7;
    color: #166534;
}

.test-result-status--fail {
    background: #FEE2E2;
    color: #DC2626;
}

/* Test Results Modal */
.test-results-summary {
    display: flex;
    justify-content: center;
    gap: 32px;
    padding: 20px;
    background: #F9FAFB;
    border-radius: 8px;
    margin-bottom: 20px;
}

.test-results-summary-item {
    text-align: center;
}

.test-results-summary-value {
    font-size: 28px;
    font-weight: 600;
    color: #101828;
}

.test-results-summary-value--pass {
    color: #059669;
}

.test-results-summary-value--fail {
    color: #DC2626;
}

.test-results-summary-label {
    font-size: 12px;
    color: #6B7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.test-results-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 400px;
    overflow-y: auto;
}

.test-results-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    background: #F9FAFB;
    border-radius: 8px;
}

.test-results-item-status {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.test-results-item-status--pass {
    background: #DCFCE7;
    color: #166534;
}

.test-results-item-status--fail {
    background: #FEE2E2;
    color: #DC2626;
}

.test-results-item-content {
    flex: 1;
    min-width: 0;
}

.test-results-item-question {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin: 0 0 4px 0;
}

.test-results-item-answer {
    font-size: 13px;
    color: #6B7280;
    margin: 0;
}

/* Training Center Responsive */
@media (max-width: 768px) {
    .test-center-header {
        flex-direction: column;
        align-items: stretch;
    }

    .test-center-summary {
        justify-content: center;
    }

    .test-center-actions {
        justify-content: center;
    }

    .test-center-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .test-center-filter-group {
        flex-wrap: wrap;
    }

    .test-center-search {
        max-width: 100%;
    }

    .test-item {
        grid-template-columns: 36px 1fr auto;
        gap: 12px;
        padding: 14px 16px;
    }

    .test-item-actions {
        opacity: 1;
    }

    .automation-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .automation-tab {
        white-space: nowrap;
    }
}

/* ============================================
   INSIGHTS TAB - Ambient AI Style
   ============================================ */

/* Page Header */
.insights-page-header {
    margin-bottom: 24px;
}

.insights-page-title {
    font-size: 24px;
    font-weight: 700;
    color: #101828;
    margin: 0 0 6px;
}

.insights-page-subtitle {
    font-size: 14px;
    color: #4A5565;
    margin: 0;
}

/* Tab Switcher */
.insights-tabs-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.insights-tabs-switcher {
    display: inline-flex;
    background: #ECECF0;
    border-radius: 14px;
    padding: 4px;
}

.insights-tab-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border: none;
    background: transparent;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    color: #0A0A0A;
    cursor: pointer;
    transition: background 0.15s ease, box-shadow 0.15s ease;
}

.insights-tab-btn:hover {
    background: rgba(255, 255, 255, 0.5);
}

.insights-tab-btn.active {
    background: #FFFFFF;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.insights-tab-btn svg {
    width: 16px;
    height: 16px;
    color: #6B7280;
}

.insights-tab-btn.active svg {
    color: #155DFC;
}

.insights-tab-badge {
    padding: 2px 8px;
    background: #DBEAFE;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    color: #1447E6;
}

.insights-refresh-btn {
    width: 36px;
    height: 36px;
    border: 1px solid #E5E7EB;
    background: #FFFFFF;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6B7280;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.insights-refresh-btn:hover {
    background: #F9FAFB;
    border-color: #D1D5DB;
}

.insights-refresh-btn svg {
    width: 18px;
    height: 18px;
}

.insights-refresh-btn.loading svg {
    animation: spin 1s linear infinite;
}

/* Insights Grid */
.insights-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.insights-cards {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Loading & Empty States */
.insights-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 24px;
    color: #6B7280;
    gap: 12px;
    text-align: center;
}

.insights-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6A7282;
    display: none;
}

.insights-empty-state.visible {
    display: block;
}

.insights-empty-icon {
    margin-bottom: 16px;
    opacity: 0.5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.insights-empty-icon svg {
    stroke: #6A7282;
}

.insights-empty-state h3 {
    font-size: 18px;
    font-weight: 600;
    color: #101828;
    margin: 0 0 8px;
}

.insights-empty-state p {
    font-size: 14px;
    margin: 0;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

/* Insight Card - Ambient Style */
.insight-card {
    background: #FFFFFF;
    border: 1px solid #E5E7EB;
    border-radius: 14px;
    padding: 20px;
    transition: box-shadow 0.15s ease;
}

.insight-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* Card Header */
.insight-card-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}

/* Type-based Avatar */
.insight-card-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #F6339A 0%, #FF6B6B 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.insight-card-avatar.win {
    background: linear-gradient(135deg, #10B981 0%, #34D399 100%);
}

.insight-card-avatar.opportunity {
    background: linear-gradient(135deg, #3B82F6 0%, #60A5FA 100%);
}

.insight-card-avatar.needs-attention {
    background: linear-gradient(135deg, #F59E0B 0%, #FBBF24 100%);
}

.insight-card-avatar.info {
    background: linear-gradient(135deg, #8B5CF6 0%, #A78BFA 100%);
}

/* Card Meta */
.insight-card-meta {
    flex: 1;
}

.insight-card-meta-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.insight-card-staff {
    width: 16px;
    height: 16px;
    border-radius: 50%;
}

.insight-card-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.33;
}

.insight-card-badge.win {
    background: #DCFCE7;
    color: #166534;
}

.insight-card-badge.opportunity {
    background: #DBEAFE;
    color: #1E40AF;
}

.insight-card-badge.needs-attention {
    background: #FEF3C7;
    color: #92400E;
}

.insight-card-badge.info {
    background: #ECEEF2;
    color: #030213;
}

.insight-card-source {
    font-size: 12px;
    color: #6A7282;
}

.insight-card-timestamp {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #6A7282;
}

.insight-card-timestamp svg {
    width: 12px;
    height: 12px;
}

/* Card Actions Menu (3-dot) */
.insight-card-actions-menu {
    position: relative;
    margin-left: auto;
}

.insight-card-menu-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9CA3AF;
    transition: background 0.15s ease;
}

.insight-card-menu-btn:hover {
    background: #F3F4F6;
}

.insight-card-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: #FFFFFF;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    min-width: 140px;
    z-index: 10;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity 0.15s ease, visibility 0.15s ease, transform 0.15s ease;
}

.insight-card-dropdown.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(4px);
}

.insight-card-dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 10px 14px;
    border: none;
    background: transparent;
    font-size: 13px;
    color: #364153;
    cursor: pointer;
    transition: background 0.15s ease;
}

.insight-card-dropdown-item:hover {
    background: #F3F4F6;
}

.insight-card-dropdown-item.danger {
    color: #DC2626;
}

.insight-card-dropdown-item svg {
    width: 14px;
    height: 14px;
}

/* Card Body */
.insight-card-body {
    margin-bottom: 16px;
}

.insight-card-title {
    font-size: 16px;
    font-weight: 600;
    color: #101828;
    margin: 0 0 6px;
}

.insight-card-description {
    font-size: 14px;
    color: #4A5565;
    line-height: 1.5;
    margin: 0;
}

/* Card Footer */
.insight-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.insight-card-action-btn {
    padding: 8px 16px;
    border: none;
    background: linear-gradient(90deg, #9810FA 0%, #155DFC 100%);
    color: white;
    font-size: 12px;
    font-weight: 500;
    border-radius: 10px;
    cursor: pointer;
    transition: opacity 0.15s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.insight-card-action-btn:hover {
    opacity: 0.9;
}

.insight-card-action-btn svg {
    width: 14px;
    height: 14px;
}

.insight-card-action-btn.executed {
    background: #D1FAE5;
    color: #065F46;
    cursor: default;
}

.insight-card-context {
    display: flex;
    align-items: center;
    gap: 12px;
}

.insight-card-tag {
    padding: 2px 8px;
    background: #F3F4F6;
    border-radius: 4px;
    font-size: 12px;
    color: #4A5565;
}

.insight-card-continue {
    display: flex;
    align-items: center;
    gap: 4px;
    background: transparent;
    border: none;
    font-size: 12px;
    font-weight: 500;
    color: #155DFC;
    cursor: pointer;
}

.insight-card-continue:hover {
    text-decoration: underline;
}

.insight-card-continue svg {
    width: 12px;
    height: 12px;
}

/* Legacy compatibility classes */
.insight-action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    border: none;
}

.insight-action-btn--primary {
    background: linear-gradient(90deg, #9810FA 0%, #155DFC 100%);
    color: white;
}

.insight-action-btn--primary:hover {
    opacity: 0.9;
}

.insight-action-btn--secondary {
    background: #F3F4F6;
    color: #374151;
}

.insight-action-btn--secondary:hover {
    background: #E5E7EB;
}

.insight-action-btn--executed {
    background: #D1FAE5;
    color: #065F46;
    cursor: default;
}

.insight-action-btn svg {
    width: 14px;
    height: 14px;
}

/* Action Preview Modal */
.action-preview-insight {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px;
    background: #F9FAFB;
    border-radius: 12px;
    margin-bottom: 24px;
}

.action-preview-insight-emoji {
    font-size: 28px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 12px;
    flex-shrink: 0;
}

.action-preview-insight-text h3 {
    font-size: 16px;
    font-weight: 600;
    color: #101828;
    margin: 0 0 4px;
}

.action-preview-insight-text p {
    font-size: 14px;
    color: #4B5563;
    margin: 0;
    line-height: 1.5;
}

.action-preview-routine h4 {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin: 0 0 12px;
}

.action-preview-config {
    background: #F9FAFB;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
}

.action-preview-row {
    display: flex;
    align-items: flex-start;
    padding: 8px 0;
    border-bottom: 1px solid #E5E7EB;
}

.action-preview-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.action-preview-row:first-child {
    padding-top: 0;
}

.action-preview-label {
    font-size: 13px;
    color: #6B7280;
    width: 100px;
    flex-shrink: 0;
}

.action-preview-value {
    font-size: 13px;
    color: #101828;
    font-weight: 500;
}

.action-preview-message {
    margin-top: 16px;
}

.action-preview-message h4 {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin: 0 0 8px;
}

.action-preview-message-content {
    background: #F9FAFB;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    padding: 16px;
    font-size: 13px;
    color: #374151;
    line-height: 1.6;
    white-space: pre-wrap;
    font-family: inherit;
    max-height: 200px;
    overflow-y: auto;
}

/* Responsive */
@media (max-width: 768px) {
    .insights-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .insights-summary {
        width: 100%;
        justify-content: space-between;
    }

    .insights-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .insights-filter-group {
        flex-wrap: wrap;
    }

    .insight-card {
        flex-direction: column;
        gap: 12px;
        padding: 16px;
    }

    .insight-card-actions {
        width: 100%;
    }

    .insight-action-btn {
        flex: 1;
        justify-content: center;
    }
}
