/* ============================================
   Component Styles
   ============================================ */

/* ============================================
   Search Results Dropdown
   ============================================ */

.search-results-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    z-index: 99999;
    max-height: 320px;
    overflow-y: auto;
    padding: 0.375rem;
}

.search-results-dropdown.visible {
    display: block;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.search-result-item:hover,
.search-result-item.highlighted {
    background: rgba(113, 254, 235, 0.12);
}

.search-result-item-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(113, 254, 235, 0.15);
    color: var(--accent-primary);
    flex-shrink: 0;
}

.search-result-item-text {
    flex: 1;
    min-width: 0;
}

.search-result-item-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

.search-result-item-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-no-results {
    padding: 1rem 0.75rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8125rem;
}

/* ============================================
   Cards
   ============================================ */

.card {
    background: var(--glass-bg-white);
    backdrop-filter: blur(var(--blur-lg));
    -webkit-backdrop-filter: blur(var(--blur-lg));
    border-radius: 20px;
    padding: 1.5rem;
    border: 1px solid var(--border-glass);
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-glass);
    transition: all var(--transition-glass);
    /* Prevent overflow on mobile */
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

.card:hover {
    box-shadow: var(--shadow-glass-lg);
    background: rgba(255, 255, 255, 0.7);
    border-color: var(--border-glass-strong);
}

/* Connection Detail Rows */
.connection-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    min-width: 0;
}

.connection-detail-row span {
    min-width: 0;
}

.connection-detail-row span:last-child {
    flex-shrink: 1;
    word-break: break-word;
    overflow-wrap: break-word;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* ============================================
   Quick Action Cards (Shopify Dashboard)
   ============================================ */

.quick-action-card {
    background: var(--glass-bg-light);
    backdrop-filter: blur(var(--blur-sm));
    -webkit-backdrop-filter: blur(var(--blur-sm));
    transition: all var(--transition-glass);
}

.quick-action-card:hover {
    background: var(--glass-bg-white);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glass);
}

.quick-action-card:active {
    transform: translateY(0);
}

/* ============================================
   Ask AI Section
   ============================================ */

.ask-ai-section {
    background: var(--glass-bg-white);
    backdrop-filter: blur(var(--blur-sm));
    -webkit-backdrop-filter: blur(var(--blur-sm));
    border-radius: 16px;
    border: 1px solid var(--border-glass);
    margin-bottom: 1.5rem;
    overflow: hidden;
    box-shadow: var(--shadow-glass-sm);
}

.ask-ai-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-light);
    background: linear-gradient(135deg, rgba(26, 26, 46, 0.02) 0%, rgba(113, 254, 235, 0.05) 100%);
}

.ask-ai-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.ask-ai-title h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.ask-ai-title .ai-badge {
    background: var(--primary);
    color: var(--white);
    font-size: 0.625rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ask-ai-subtitle {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.ask-ai-minimize {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.2s;
}

.ask-ai-minimize:hover {
    background: var(--bg-main);
    color: var(--text-primary);
}

.ask-ai-chat-container {
    max-height: 300px;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.ask-ai-chat-container.minimized {
    max-height: 0;
}

.ask-ai-messages {
    padding: 1rem 1.5rem;
    max-height: 200px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.ask-ai-messages:empty::before {
    content: 'Ask me anything about automations...';
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.875rem;
}

.chat-message {
    display: flex;
    gap: 0.75rem;
    max-width: 85%;
}

.chat-message.user {
    margin-left: auto;
    flex-direction: row-reverse;
}

.chat-message-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    flex-shrink: 0;
    backdrop-filter: blur(var(--blur-sm));
    -webkit-backdrop-filter: blur(var(--blur-sm));
    border: 1px solid var(--border-glass-subtle);
    box-shadow: var(--shadow-glass-sm);
}

.chat-message.user .chat-message-avatar {
    background: var(--glass-bg-primary);
    color: var(--white);
    border-color: rgba(255, 255, 255, 0.15);
}

.chat-message.assistant .chat-message-avatar {
    background: var(--glass-bg-accent);
    color: var(--primary);
    border-color: var(--border-accent-glass);
}

.chat-message-content {
    background: var(--glass-bg-white);
    backdrop-filter: blur(var(--blur-md));
    -webkit-backdrop-filter: blur(var(--blur-md));
    padding: 0.75rem 1rem;
    border-radius: 12px;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--text-primary);
    border: 1px solid var(--border-glass);
    box-shadow: var(--shadow-glass-sm);
}

.chat-message.user .chat-message-content {
    background: var(--glass-bg-primary);
    color: var(--white);
    border-bottom-right-radius: 4px;
    border-color: rgba(255, 255, 255, 0.1);
}

.chat-message.assistant .chat-message-content {
    border-bottom-left-radius: 4px;
    background: var(--glass-bg-white);
}

.chat-message-typing {
    display: flex;
    gap: 4px;
    padding: 0.75rem 1rem;
}

.chat-message-typing span {
    width: 6px;
    height: 6px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out;
}

.chat-message-typing span:nth-child(1) { animation-delay: 0s; }
.chat-message-typing span:nth-child(2) { animation-delay: 0.2s; }
.chat-message-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
    0%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-6px); }
}

.ask-ai-input-container {
    display: flex;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-light);
    background: var(--bg-main);
}

.ask-ai-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    font-size: 0.875rem;
    background: var(--white);
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.2s;
}

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

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

.ask-ai-send {
    padding: 0.75rem 1.25rem;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ask-ai-send:hover {
    background: var(--primary-dark);
}

.ask-ai-send:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ============================================
   Automation Categories
   ============================================ */


/* ============================================
   Stats Grid
   ============================================ */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--glass-bg-white);
    backdrop-filter: blur(var(--blur-lg));
    -webkit-backdrop-filter: blur(var(--blur-lg));
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: var(--shadow-glass);
    transition: all var(--transition-glass);
    /* Prevent overflow */
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

.stat-card:hover {
    box-shadow: var(--shadow-glass-lg);
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 0.7);
    border-color: var(--border-glass-strong);
}

.stat-label {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.stat-subtext {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* ============================================
   Insights Section
   ============================================ */

.insights-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.insight-card {
    background: var(--glass-bg-white);
    backdrop-filter: blur(var(--blur-lg));
    -webkit-backdrop-filter: blur(var(--blur-lg));
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: var(--shadow-glass);
    transition: all var(--transition-glass);
}

.insight-card:hover {
    box-shadow: var(--shadow-glass-lg);
    background: rgba(255, 255, 255, 0.7);
    border-color: var(--border-glass-strong);
}

.insight-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.insight-card-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.insight-card-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 500;
}

.insight-card-badge.positive {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.insight-card-badge.neutral {
    background: rgba(107, 114, 128, 0.1);
    color: #6b7280;
}

.insight-card-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.insight-card-subtitle {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.chart-container {
    position: relative;
    height: 200px;
    margin-top: 1rem;
    /* Prevent overflow */
    max-width: 100%;
    width: 100%;
    overflow: hidden;
}

/* Ensure Chart.js canvas respects container width */
.chart-container canvas {
    max-width: 100% !important;
    width: 100% !important;
}

.insight-card.full-width {
    grid-column: span 2;
}

.insight-card .chart-container.large {
    height: 280px;
}

.insight-metrics {
    display: flex;
    gap: 2rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-light);
}

.insight-metric {
    flex: 1;
}

.insight-metric-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.insight-metric-value {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.insight-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

/* ============================================
   Form Elements
   ============================================ */

.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
input[type="number"],
input[type="tel"],
textarea,
select {
    width: 100%;
    padding: 1rem 1rem 1rem 1.5rem !important;
    min-height: 48px;
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    font-size: 1rem;
    line-height: 1.5;
    transition: all var(--transition-glass);
    background: var(--glass-bg-white);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    color: var(--text-primary);
    box-sizing: border-box;
    box-shadow: var(--shadow-glass-sm);
}

/* Number input spinner styling */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

input::placeholder,
textarea::placeholder {
    color: #9CA3AF;
    opacity: 1;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--border-accent-glass);
    box-shadow: var(--shadow-glass), 0 0 0 3px rgba(113, 254, 235, 0.1);
    background: var(--white);
}

input.error {
    border-color: var(--error);
}

.error-message {
    color: var(--error);
    font-size: 0.8125rem;
    margin-top: 0.5rem;
}

/* Length Toggle Buttons */
.length-btn {
    flex: 1;
    padding: 0.625rem 1rem;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    background: var(--white);
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.length-btn:hover {
    border-color: var(--accent);
    color: var(--text-primary);
}

.length-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--text-primary);
}

/* Form Select Styling */
.form-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: 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'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding: 1rem 2.5rem 1rem 1.5rem !important;
}

/* Textarea specific styling */
textarea {
    min-height: 120px;
    resize: vertical;
    padding: 1rem 1rem 1rem 1.5rem !important;
}

/* Channel Checkbox Styling */
.channel-checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.channel-checkbox input[type="checkbox"] {
    display: none;
}

.channel-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    background: var(--white);
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.15s ease;
    width: 100%;
}

.channel-checkbox input[type="checkbox"]:checked + .channel-label {
    background: rgba(113, 254, 235, 0.1);
    border-color: var(--accent);
    color: var(--text-primary);
}

.channel-label:hover {
    border-color: var(--accent);
}

/* Input Method Tab Styling */
.input-method-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    background: var(--white);
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.input-method-tab:hover {
    border-color: var(--accent);
    color: var(--text-primary);
}

.input-method-tab.active {
    background: rgba(113, 254, 235, 0.1);
    border-color: var(--accent);
    color: var(--text-primary);
}

.input-method-tab svg {
    flex-shrink: 0;
}

/* Form actions alignment */
.form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
    justify-content: flex-start;
}

.form-actions .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* ============================================
   Repurpose Result Card Styling
   ============================================ */

.repurpose-result-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    margin-bottom: 1rem;
    overflow: hidden;
}

.repurpose-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--white);
    border-bottom: 1px solid var(--border-light);
}

.repurpose-result-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--text-primary);
}

.repurpose-result-copy {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
    background: var(--white);
    border: 1px solid var(--border-light);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.repurpose-result-copy:hover {
    border-color: var(--accent);
    background: rgba(113, 254, 235, 0.1);
}

.repurpose-result-body {
    padding: 1rem;
    font-size: 0.875rem;
    line-height: 1.7;
    color: var(--text-primary);
    max-height: 200px;
    overflow-y: auto;
}

.repurpose-result-body strong {
    font-weight: 600;
    color: var(--text-primary);
}

.repurpose-result-body p {
    margin-bottom: 0.5rem;
}

.repurpose-result-tip {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    background: rgba(10, 40, 54, 0.05);
    border-top: 1px solid var(--border-light);
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.repurpose-result-tip svg {
    flex-shrink: 0;
    color: var(--primary);
}

/* ============================================
   Buttons
   ============================================ */

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 12px;
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-glass);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
}

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

.btn-primary {
    background: var(--gradient-accent);
    color: var(--white);
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(10, 40, 54, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
    transition: left 0.5s ease;
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #0F3D4A 0%, #165A68 50%, #1E7585 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(10, 40, 54, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.btn-primary:hover:not(:disabled)::before {
    left: 100%;
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(10, 40, 54, 0.3), inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-secondary {
    background: var(--glass-bg-light);
    backdrop-filter: blur(var(--blur-sm));
    -webkit-backdrop-filter: blur(var(--blur-sm));
    color: var(--text-primary);
    border: 1px solid var(--border-glass);
    box-shadow: var(--shadow-glass-sm);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--glass-bg-white);
    border-color: var(--border-glass-strong);
    box-shadow: var(--shadow-glass);
    transform: translateY(-1px);
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* ============================================
   Workflow Builder (Pipeline View)
   ============================================ */

/* --- List View --- */
.wf-list-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    gap: 1rem;
}
.wf-list-header .page-title { margin: 0; }
.wf-list-header .page-subtitle { margin: 0.25rem 0 0; }

.wf-stats-row {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}
.wf-stat-chip {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--glass-bg-white, rgba(255,255,255,0.6));
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 0.875rem;
}
.wf-stat-label {
    color: var(--text-muted);
    font-weight: 500;
}
.wf-stat-value {
    color: var(--text-primary);
    font-weight: 700;
}

/* --- Workflows Table --- */
.wf-table-wrap {
    background: var(--glass-bg-white, rgba(255,255,255,0.6));
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
}
.wf-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}
.wf-table thead th {
    background: var(--bg-secondary);
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
}
.wf-table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s ease;
    cursor: pointer;
}
.wf-table tbody tr:last-child { border-bottom: none; }
.wf-table tbody tr:hover {
    background: rgba(113, 254, 235, 0.04);
}
.wf-table td {
    padding: 0.875rem 1rem;
    vertical-align: middle;
}
.wf-table-name {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
}
.wf-table-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: white;
}
.wf-table-icon.recovery { background: linear-gradient(135deg, #ef4444, #f97316); }
.wf-table-icon.engagement { background: linear-gradient(135deg, #0d9488, #71FEEB); }
.wf-table-icon.retention { background: linear-gradient(135deg, #7c3aed, #a855f7); }

.wf-table-trigger {
    color: var(--text-secondary);
    font-size: 0.8125rem;
}
.wf-table-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.wf-table-actions .btn {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

/* --- Status Badge --- */
.wf-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.wf-status-badge.active {
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
}
.wf-status-badge.active::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 6px rgba(16, 185, 129, 0.5);
}
.wf-status-badge.paused {
    background: rgba(245, 158, 11, 0.12);
    color: #d97706;
}
.wf-status-badge.paused::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #f59e0b;
}

/* --- Empty State --- */
.wf-empty-state {
    text-align: center;
    padding: 4rem 2rem;
}
.wf-empty-icon {
    color: var(--text-muted);
    opacity: 0.3;
    margin-bottom: 1rem;
}
.wf-empty-state h3 {
    font-size: 1.125rem;
    margin: 0 0 0.5rem;
    color: var(--text-primary);
}
.wf-empty-state p {
    color: var(--text-muted);
    margin: 0 0 1.5rem;
    font-size: 0.875rem;
}

/* --- Toggle Switch --- */
.wf-toggle-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
}
.wf-toggle-label input { display: none; }
.wf-toggle-track {
    width: 40px;
    height: 22px;
    background: var(--border-color);
    border-radius: 11px;
    position: relative;
    transition: background 0.2s ease;
}
.wf-toggle-label input:checked + .wf-toggle-track {
    background: var(--accent, #71FEEB);
}
.wf-toggle-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    transition: transform 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.wf-toggle-label input:checked + .wf-toggle-track .wf-toggle-thumb {
    transform: translateX(18px);
}
.wf-toggle-text {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
}

/* Small toggle for table rows */
.wf-mini-toggle {
    width: 34px;
    height: 18px;
    border-radius: 9px;
    background: var(--border-color);
    position: relative;
    cursor: pointer;
    transition: background 0.2s ease;
    flex-shrink: 0;
}
.wf-mini-toggle.on { background: var(--accent, #71FEEB); }
.wf-mini-toggle::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    background: white;
    border-radius: 50%;
    transition: transform 0.2s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.15);
}
.wf-mini-toggle.on::after { transform: translateX(16px); }

/* --- Template Browser Overlay --- */
.wf-templates-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 40, 54, 0.6);
    backdrop-filter: blur(20px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    padding: 2rem;
    overflow-y: auto;
    animation: wfFadeIn 0.25s ease;
}
@keyframes wfFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
.wf-templates-panel {
    width: 100%;
    max-width: 960px;
    animation: wfSlideUp 0.3s ease;
}
@keyframes wfSlideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.wf-templates-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}
.wf-templates-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    color: white;
}
.wf-templates-header p {
    color: rgba(255,255,255,0.6);
    margin: 0.25rem 0 0;
    font-size: 0.875rem;
}
.wf-close-btn {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 10px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    transition: background 0.2s ease;
}
.wf-close-btn:hover { background: rgba(255,255,255,0.2); }

.wf-templates-toolbar {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}
.wf-search-input {
    flex: 1;
    min-width: 200px;
    padding: 0.625rem 1rem;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 10px;
    color: white;
    font-size: 0.875rem;
    outline: none;
    transition: border-color 0.2s ease;
}
.wf-search-input::placeholder { color: rgba(255,255,255,0.4); }
.wf-search-input:focus { border-color: var(--accent, #71FEEB); }

.wf-category-pills {
    display: flex;
    gap: 0.375rem;
}
.wf-pill {
    padding: 0.375rem 0.875rem;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.15);
    background: transparent;
    color: rgba(255,255,255,0.7);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}
.wf-pill:hover { background: rgba(255,255,255,0.08); color: white; }
.wf-pill.active {
    background: var(--accent, #71FEEB);
    color: #0A2836;
    border-color: var(--accent, #71FEEB);
    font-weight: 600;
}

/* --- Template Cards --- */
.wf-templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}
.wf-tpl-card {
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 16px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}
.wf-tpl-card:hover {
    background: rgba(255,255,255,0.12);
    border-color: rgba(113, 254, 235, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}
.wf-tpl-card-top {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}
.wf-tpl-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: white;
}
.wf-tpl-icon.recovery { background: linear-gradient(135deg, #ef4444, #f97316); }
.wf-tpl-icon.engagement { background: linear-gradient(135deg, #0d9488, #71FEEB); }
.wf-tpl-icon.retention { background: linear-gradient(135deg, #7c3aed, #a855f7); }

.wf-tpl-card h3 {
    font-size: 1rem;
    font-weight: 600;
    color: white;
    margin: 0;
    line-height: 1.3;
}
.wf-tpl-card-desc {
    color: rgba(255,255,255,0.55);
    font-size: 0.8125rem;
    line-height: 1.5;
    margin-bottom: 1rem;
}
.wf-tpl-card-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.75rem;
    color: rgba(255,255,255,0.45);
    margin-bottom: 1rem;
}
.wf-tpl-card-meta span {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}
.wf-tpl-activate-btn {
    width: 100%;
    padding: 0.5rem;
    background: rgba(113, 254, 235, 0.15);
    border: 1px solid rgba(113, 254, 235, 0.25);
    border-radius: 10px;
    color: var(--accent-dark);
    font-weight: 600;
    font-size: 0.8125rem;
    cursor: pointer;
    transition: all 0.2s ease;
}
.wf-tpl-activate-btn:hover {
    background: rgba(113, 254, 235, 0.25);
    border-color: var(--accent-dark);
}
.wf-tpl-activated {
    width: 100%;
    padding: 0.5rem;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    color: rgba(255,255,255,0.35);
    font-weight: 500;
    font-size: 0.8125rem;
    cursor: default;
    text-align: center;
}

/* --- Pipeline Builder: Top Bar --- */
.wf-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    gap: 1rem;
    flex-wrap: wrap;
}
.wf-topbar-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.wf-topbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.wf-back-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-primary);
    transition: all 0.2s ease;
}
.wf-back-btn:hover {
    background: var(--bg-tertiary, var(--border-color));
    border-color: var(--text-muted);
}
.wf-builder-title {
    font-size: 1.125rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary);
}

/* --- Pipeline Builder: Layout --- */
.wf-builder-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 1.5rem;
    min-height: 500px;
}
.wf-pipeline-canvas {
    display: flex;
    justify-content: center;
    padding: 2rem 1rem;
}
.wf-pipeline {
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* --- Pipeline Steps --- */
.wf-step {
    width: 100%;
    background: var(--glass-bg-white, rgba(255,255,255,0.6));
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 1rem 1.25rem;
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
    border-left: 4px solid transparent;
}
.wf-step:hover {
    border-color: rgba(113, 254, 235, 0.3);
    border-left-color: rgba(113, 254, 235, 0.3);
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}
.wf-step.active {
    border-color: var(--accent, #71FEEB);
    border-left-color: var(--accent, #71FEEB);
    box-shadow: 0 0 0 3px rgba(113, 254, 235, 0.12), 0 4px 16px rgba(0,0,0,0.08);
}
.wf-step.trigger {
    border-left-color: #0d9488;
    background: linear-gradient(135deg, rgba(13, 148, 136, 0.06), rgba(113, 254, 235, 0.04));
}
.wf-step.trigger:hover, .wf-step.trigger.active {
    border-left-color: #0d9488;
}
.wf-step.wait {
    border-left-color: #94a3b8;
    padding: 0.75rem 1.25rem;
}
.wf-step.email {
    border-left-color: #3b82f6;
}

.wf-step-header {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}
.wf-step-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.wf-step-icon.trigger-icon {
    background: rgba(13, 148, 136, 0.12);
    color: #0d9488;
}
.wf-step-icon.wait-icon {
    background: rgba(148, 163, 184, 0.12);
    color: #64748b;
}
.wf-step-icon.email-icon {
    background: rgba(59, 130, 246, 0.12);
    color: #3b82f6;
}
.wf-step-label {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 0.125rem;
}
.wf-step-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
}
.wf-step-subtitle {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-top: 0.125rem;
}

/* --- Pipeline Connectors --- */
.wf-connector {
    width: 2px;
    height: 32px;
    position: relative;
    overflow: hidden;
}
.wf-connector::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, var(--border-color), rgba(113, 254, 235, 0.4), var(--border-color));
    background-size: 100% 200%;
    animation: wfConnectorFlow 2s ease-in-out infinite;
}
@keyframes wfConnectorFlow {
    0%, 100% { background-position: 0% 0%; }
    50% { background-position: 0% 100%; }
}

/* Animated dot on connector */
.wf-connector::after {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent, #71FEEB);
    left: 50%;
    transform: translateX(-50%);
    animation: wfDotFlow 2.5s ease-in-out infinite;
    box-shadow: 0 0 8px rgba(113, 254, 235, 0.6);
}
@keyframes wfDotFlow {
    0% { top: -3px; opacity: 0; }
    20% { opacity: 1; }
    80% { opacity: 1; }
    100% { top: calc(100% - 3px); opacity: 0; }
}

/* --- Inspector Panel --- */
.wf-inspector {
    background: var(--glass-bg-white, rgba(255,255,255,0.6));
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 200px);
    position: sticky;
    top: 100px;
}
.wf-inspector-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    text-align: center;
    flex: 1;
    min-height: 300px;
}
.wf-inspector-empty p {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin: 0.75rem 0 0;
}
.wf-inspector-header {
    padding: 1.25rem 1.25rem 0;
}
.wf-inspector-header h3 {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 0.75rem;
    color: var(--text-primary);
}
.wf-inspector-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border-color);
}
.wf-inspector-tab {
    padding: 0.5rem 1rem;
    border: none;
    background: transparent;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}
.wf-inspector-tab:hover { color: var(--text-primary); }
.wf-inspector-tab.active {
    color: var(--accent-dark);
    border-bottom-color: var(--accent-dark);
}
.wf-inspector-body {
    padding: 1.25rem;
    overflow-y: auto;
    flex: 1;
}
.wf-inspector-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border-color);
}

/* --- Inspector Form Fields --- */
.wf-field {
    margin-bottom: 1rem;
}
.wf-field:last-child { margin-bottom: 0; }
.wf-field label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin-bottom: 0.375rem;
}
.wf-field input[type="text"],
.wf-field input[type="number"],
.wf-field input[type="url"],
.wf-field input[type="color"],
.wf-field textarea,
.wf-field select {
    width: 100%;
    padding: 0.625rem 0.75rem;
    background: var(--bg-primary, white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.875rem;
    color: var(--text-primary);
    transition: border-color 0.2s ease;
    font-family: inherit;
}
.wf-field input:focus,
.wf-field textarea:focus,
.wf-field select:focus {
    outline: none;
    border-color: var(--accent, #71FEEB);
    box-shadow: 0 0 0 3px rgba(113, 254, 235, 0.1);
}
.wf-field textarea {
    resize: vertical;
    min-height: 80px;
}
.wf-field-row {
    display: flex;
    gap: 0.75rem;
}
.wf-field-row .wf-field { flex: 1; }

.wf-field input[type="color"] {
    width: 48px;
    height: 36px;
    padding: 2px;
    cursor: pointer;
}

/* --- Loading / Skeleton --- */
.wf-skeleton {
    background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--border-color) 50%, var(--bg-secondary) 75%);
    background-size: 200% 100%;
    animation: wfShimmer 1.5s ease-in-out infinite;
    border-radius: 8px;
}
@keyframes wfShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Small button variant */
.btn-sm {
    padding: 0.375rem 0.625rem;
    font-size: 0.75rem;
    line-height: 1;
}

/* --- Creation Modal --- */
.wf-creation-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.wf-creation-panel {
    background: var(--glass-bg-white, rgba(255,255,255,0.95));
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2.5rem;
    max-width: 600px;
    width: 100%;
    position: relative;
    text-align: center;
}
.wf-creation-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}
.wf-creation-card {
    background: var(--bg-primary, white);
    border: 2px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem 1.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}
.wf-creation-card:hover {
    border-color: var(--accent, #71FEEB);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}
.wf-creation-card-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}
.wf-creation-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 0.5rem;
    color: var(--text-primary);
}
.wf-creation-card p {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
}

/* --- Trigger Selector --- */
.wf-trigger-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.wf-trigger-name-field {
    margin-bottom: 1.5rem;
}
.wf-trigger-name-field label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin-bottom: 0.375rem;
}
.wf-trigger-name-field input {
    width: 100%;
    max-width: 400px;
    padding: 0.625rem 0.75rem;
    background: var(--bg-primary, white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.875rem;
    color: var(--text-primary);
    font-family: inherit;
}
.wf-trigger-name-field input:focus {
    outline: none;
    border-color: var(--accent, #71FEEB);
    box-shadow: 0 0 0 3px rgba(113, 254, 235, 0.1);
}
.wf-trigger-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}
.wf-trigger-card {
    background: var(--glass-bg-white, rgba(255,255,255,0.6));
    backdrop-filter: blur(16px);
    border: 2px solid var(--border-color);
    border-radius: 14px;
    padding: 1.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}
.wf-trigger-card:hover {
    border-color: var(--accent-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}
.wf-trigger-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: linear-gradient(135deg, rgba(113, 254, 235, 0.15), rgba(10, 40, 54, 0.08));
    color: var(--accent-dark);
}
.wf-trigger-card h4 {
    font-size: 0.875rem;
    font-weight: 600;
    margin: 0 0 0.25rem;
    color: var(--text-primary);
}
.wf-trigger-card p {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.4;
}

/* --- Pipeline Step Actions (add/remove/reorder) --- */
.wf-step-actions {
    display: flex;
    gap: 0.25rem;
    margin-left: auto;
    opacity: 0;
    transition: opacity 0.15s ease;
}
.wf-step:hover .wf-step-actions {
    opacity: 1;
}
.wf-step-action-btn {
    width: 24px;
    height: 24px;
    border: none;
    background: rgba(0, 0, 0, 0.06);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: all 0.15s ease;
    padding: 0;
}
.wf-step-action-btn:hover {
    background: rgba(0, 0, 0, 0.12);
    color: var(--text-primary);
}
.wf-step-action-btn.danger:hover {
    background: rgba(239, 68, 68, 0.12);
    color: var(--error, #EF4444);
}

/* Add-step button on connector */
.wf-add-step-wrap {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.wf-add-step-btn {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    background: var(--bg-primary, white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: all 0.2s ease;
    padding: 0;
    z-index: 1;
}
.wf-add-step-btn:hover {
    border-color: var(--accent-dark);
    color: var(--accent-dark);
    box-shadow: 0 0 12px rgba(113, 254, 235, 0.3);
    transform: scale(1.1);
}

/* Add-step dropdown */
.wf-add-step-dropdown {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-primary, white);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    padding: 0.375rem;
    z-index: 10;
    min-width: 140px;
    margin-top: 4px;
}
.wf-add-step-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8125rem;
    color: var(--text-primary);
    width: 100%;
    text-align: left;
    transition: background 0.15s ease;
    font-family: inherit;
}
.wf-add-step-option:hover {
    background: rgba(113, 254, 235, 0.1);
}

/* Builder title editable */
.wf-builder-title {
    cursor: pointer;
}
.wf-builder-title:hover {
    text-decoration: underline;
    text-decoration-style: dashed;
    text-underline-offset: 4px;
}

/* ============================================
   Badge
   ============================================ */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.badge-success {
    background: #D1FAE5;
    color: #065F46;
}

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

.badge-error {
    background: #FEE2E2;
    color: #991B1B;
}

.badge-info {
    background: #DBEAFE;
    color: #1E40AF;
}

/* ============================================
   Toggle Switch
   ============================================ */

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--glass-bg-subtle);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    transition: all var(--transition-glass);
    border-radius: 26px;
    border: 1px solid var(--border-glass);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 2px;
    background: var(--white);
    transition: all var(--transition-glass);
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

input:checked + .toggle-slider {
    background: var(--glass-bg-accent);
    border-color: var(--border-accent-glass);
    box-shadow: inset 0 2px 4px rgba(113, 254, 235, 0.1), 0 0 12px rgba(113, 254, 235, 0.2);
}

input:checked + .toggle-slider:before {
    transform: translateX(22px);
    background: linear-gradient(135deg, var(--accent) 0%, #5fe8d8 100%);
    box-shadow: 0 2px 8px rgba(113, 254, 235, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

input:focus + .toggle-slider {
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05), 0 0 0 3px rgba(113, 254, 235, 0.15);
}

/* ============================================
   Table
   ============================================ */

.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 1rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-light);
}

td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.9375rem;
    color: var(--text-primary);
}

tr:last-child td {
    border-bottom: none;
}

tr:hover {
    background: var(--bg-main);
}

/* Table download button */
td .btn-small {
    padding: 0.4rem 0.6rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

td .btn-small svg {
    margin: 0;
}

/* ============================================
   Toast Notifications
   ============================================ */

.toast-container {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.toast {
    background: var(--glass-bg-white);
    backdrop-filter: blur(var(--blur-lg));
    -webkit-backdrop-filter: blur(var(--blur-lg));
    border-radius: 16px;
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow-glass-lg);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 320px;
    border: 1px solid var(--border-glass);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast-success {
    border-left: 4px solid var(--success);
}

.toast-error {
    border-left: 4px solid var(--error);
}

.toast-message {
    flex: 1;
    font-size: 0.875rem;
    color: var(--text-primary);
}

/* ============================================
   Loading Spinner
   ============================================ */

.spinner {
    border: 2px solid var(--border-light);
    border-top: 2px solid var(--accent);
    border-radius: 50%;
    width: 16px;
    height: 16px;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ============================================
   Automation Grid
   ============================================ */

.automations-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

.automation-card {
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    background: var(--glass-bg-white);
    backdrop-filter: blur(var(--blur-lg));
    -webkit-backdrop-filter: blur(var(--blur-lg));
    transition: all var(--transition-glass);
    cursor: pointer;
    box-shadow: var(--shadow-glass);
}

.automation-card:hover {
    border-color: var(--border-accent-glass);
    box-shadow: var(--shadow-glass-glow);
    transform: translateY(-4px);
    background: rgba(255, 255, 255, 0.7);
}

.automation-card-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
    background: var(--glass-bg-accent);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: 1px solid var(--border-accent-glass);
    color: var(--primary);
    transition: all var(--transition-glass);
    box-shadow: var(--shadow-glass-sm);
}

.automation-card:hover .automation-card-icon {
    background: rgba(113, 254, 235, 0.15);
    transform: scale(1.05);
    box-shadow: var(--shadow-glass-glow);
}

.integration-card.integration-unavailable:hover {
    transform: none;
    box-shadow: var(--shadow-glass);
    border-color: var(--border-glass);
}

.integration-card.integration-unavailable .integration-icon {
    filter: grayscale(50%);
}

.integration-card.integration-unavailable .integration-body {
    display: none;
}

.integration-unavailable-overlay {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    text-align: center;
    margin-top: 1rem;
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px dashed var(--border-light);
}

.integration-unavailable-overlay .upgrade-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--warning) 0%, #D97706 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    margin-bottom: 0.75rem;
}

.integration-unavailable-overlay .upgrade-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.integration-unavailable-overlay .upgrade-description {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.integration-unavailable-btn {
    background: var(--bg-secondary) !important;
    color: var(--text-secondary) !important;
    border: 1px dashed var(--border-light) !important;
    cursor: pointer !important;
    transition: all 0.2s ease;
}

.integration-unavailable-btn:hover {
    background: var(--bg-light) !important;
    color: var(--link-color) !important;
    border-color: var(--link-color) !important;
    border-style: solid !important;
}

.integration-header {
    display: flex;
    align-items: center;
    gap: 1rem;
}

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

.integration-icon.amazon {
    background: linear-gradient(135deg, #FF9900 0%, #FFB84D 100%);
    color: white;
}

.integration-icon.shopify {
    background: linear-gradient(135deg, #96BF48 0%, #5C8F23 100%);
    color: white;
}

.integration-icon.slack {
    background: linear-gradient(135deg, #4A154B 0%, #611F69 100%);
    color: white;
}

.integration-info {
    flex: 1;
    min-width: 0;
}

.integration-name {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.integration-description {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.integration-status {
    flex-shrink: 0;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-badge.status-connected {
    background: rgba(16, 185, 129, 0.1);
    color: #10B981;
}

.status-badge.status-connected::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #10B981;
}

.status-badge.status-disconnected {
    background: rgba(107, 114, 128, 0.1);
    color: #6B7280;
}

.status-badge.status-coming-soon {
    background: rgba(139, 92, 246, 0.1);
    color: #8B5CF6;
}

.status-badge.status-pending {
    background: rgba(245, 158, 11, 0.1);
    color: #F59E0B;
}

.status-badge.status-pending::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #F59E0B;
    animation: pulse 1.5s ease-in-out infinite;
}

.status-badge.status-error {
    background: rgba(239, 68, 68, 0.1);
    color: #EF4444;
}

.status-badge.status-error::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #EF4444;
}

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

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

.integration-body {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-glass);
}

.integration-features {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.625rem;
}

.integration-features li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.connection-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.connection-detail {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.detail-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.detail-value {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-primary);
}

.btn-danger {
    background: transparent;
    color: #EF4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: #EF4444;
}

/* ============================================
   Shopify KPI Dashboard Styles
   ============================================ */

/* Pulse animation for status indicator */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.6;
        transform: scale(1.1);
    }
}

/* Hero stat cards */
.shopify-hero-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.shopify-hero-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

/* Stat trend indicators */
.stat-trend {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
}

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

.stat-trend.negative {
    color: var(--error);
}

.stat-trend.neutral {
    color: var(--text-muted);
}

/* Chart period tabs */
.chart-period-tab {
    transition: all 0.2s ease;
}

.chart-period-tab:hover {
    background: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
}

.chart-period-tab.active,
.session-period-tab.active {
    background: var(--primary) !important;
    color: var(--white) !important;
}

.session-period-tab {
    transition: all 0.2s ease;
}

.session-period-tab:hover {
    background: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
}

/* Metric cards */
.metric-card {
    transition: all 0.3s ease;
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glass);
}

/* Quick action cards hover */
.quick-action-card:hover {
    background: var(--bg-light) !important;
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

/* ============================================
   Shopify Dashboard Grid Base Styles
   ============================================ */

/* Hero stats grid - 2 columns on desktop */
.shopify-hero-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

/* Stats grid for Shopify - 4 columns on desktop */
.shopify-stats-grid,
.dashboard-shopify-stats,
#shopify .stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

/* Charts grid - 2fr 1fr on desktop */
.shopify-charts-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Metrics row - 3 columns on desktop */
.shopify-metrics-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

/* Quick actions grid - 4 columns on desktop */
.shopify-quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

/* Dashboard grid - 2 columns on desktop */
.shopify-dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

/* Dashboard header flex layout */
.shopify-dash-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.shopify-header-title {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.shopify-header-actions {
    display: flex;
    gap: 0.75rem;
}

/* NOTE: Responsive overrides are in responsive.css */

/* ============================================
   Shopify Connected Dashboard - Row Layouts
   These are the actual classes used in the HTML
   ============================================ */

/* Hero row - 2 columns on desktop */
.shopify-hero-row {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
    width: 100%;
    box-sizing: border-box;
}

/* Stats row - 4 columns on desktop */
.shopify-stats-row {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    width: 100%;
    box-sizing: border-box;
}

/* Charts row - 2fr 1fr on desktop */
.shopify-charts-row {
    display: grid !important;
    grid-template-columns: 2fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
    width: 100%;
    box-sizing: border-box;
}

/* Hero card styling */
.shopify-hero-card {
    min-width: 0;
    box-sizing: border-box;
}

/* Stat card styling */
.shopify-stat-card {
    min-width: 0;
    box-sizing: border-box;
}

/* Chart card styling */
.shopify-chart-card {
    min-width: 0;
    box-sizing: border-box;
}

/* Top Products List (for Shopify dashboard) */
.top-product-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border-radius: 10px;
    transition: background 0.15s ease;
}

.top-product-item:hover {
    background: var(--bg-light);
}

.product-rank {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
    background: var(--bg-light);
    color: var(--text-secondary);
}

.product-rank.rank-1 { background: linear-gradient(135deg, #FFD700, #FFA500); color: white; }
.product-rank.rank-2 { background: linear-gradient(135deg, #C0C0C0, #A8A8A8); color: white; }
.product-rank.rank-3 { background: linear-gradient(135deg, #CD7F32, #B8860B); color: white; }

.product-info {
    flex: 1;
    min-width: 0;
}

.product-name {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-stats {
    font-size: 0.6875rem;
    color: var(--text-muted);
}

.product-revenue {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--success);
    flex-shrink: 0;
}

/* Utility button styles */
.btn-ghost {
    background: transparent;
    border: 1px solid transparent;
}

.btn-ghost:hover {
    background: var(--bg-light);
}

/* Legacy automation-item styles for compatibility */
.automation-item {
    display: none;
}

/* Modern Icon Styles */
.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.stat-icon.accent {
    background: linear-gradient(135deg, rgba(10, 40, 54, 0.15) 0%, rgba(10, 40, 54, 0.08) 100%);
    color: var(--primary);
}

.stat-icon.primary {
    background: linear-gradient(135deg, rgba(10, 40, 54, 0.1) 0%, rgba(10, 40, 54, 0.05) 100%);
    color: var(--primary);
}

.stat-icon.success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2) 0%, rgba(16, 185, 129, 0.1) 100%);
    color: var(--success);
}

/* ============================================
   Progress Circle
   ============================================ */

.progress-circle {
    position: relative;
    width: 180px;
    height: 180px;
    margin: 0 auto;
}

.progress-circle svg {
    transform: rotate(-90deg);
}

.progress-circle-bg {
    fill: none;
    stroke: var(--border-light);
    stroke-width: 12;
}

.progress-circle-value {
    fill: none;
    stroke: var(--accent-dark);
    stroke-width: 12;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.5s ease;
}

.progress-circle-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.progress-circle-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.progress-circle-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* ============================================
   AI Assistant Chat Interface
   ============================================ */

.ai-chat-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 80px);
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1rem;
    position: relative;
}

.ai-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 2rem 0;
    display: flex;
    flex-direction: column;
}

/* Welcome State */
.ai-chat-welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    text-align: center;
    padding: 2rem;
}

.ai-chat-logo {
    width: 80px;
    height: 80px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-lg);
}

.ai-chat-greeting {
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.ai-chat-hint {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

/* Chat Input Area */
.ai-chat-input-wrapper {
    display: block;
    align-items: flex-end;
    gap: 0.5rem;
    background: var(--bg-main);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    padding: 0.5rem 0.5rem 0.5rem 1rem;
    transition: all 0.2s ease;
}

/* Selected Automation Header */
.ai-selected-automation {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: var(--primary);
    border-radius: 16px 16px 0 0;
    border-bottom: none;
}

.ai-selected-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.ai-selected-icon {
    font-size: 1.25rem;
}

.ai-selected-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--white);
}

.ai-selected-badge {
    padding: 0.2rem 0.5rem;
    background: var(--primary);
    color: var(--white);
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: 600;
}

.ai-selected-clear {
    width: 28px;
    height: 28px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    transition: all 0.2s ease;
}

.ai-selected-clear:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Inline Form Fields */
.ai-inline-form {
    background: var(--glass-bg-white);
    backdrop-filter: blur(var(--blur-lg));
    -webkit-backdrop-filter: blur(var(--blur-lg));
    border: 1px solid var(--border-glass);
    border-top: none;
    padding: 1.25rem;
    max-height: 350px;
    overflow-y: auto;
}

.ai-inline-fields {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.ai-inline-field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.ai-inline-field.full-width {
    grid-column: 1 / -1;
}

.ai-inline-field label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ai-inline-field input,
.ai-inline-field textarea,
.ai-inline-field select {
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--border-glass);
    border-radius: 10px;
    font-size: 0.875rem;
    background: var(--glass-bg-light);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    color: var(--text-primary);
    transition: all var(--transition-glass);
}

.ai-inline-field input:focus,
.ai-inline-field textarea:focus,
.ai-inline-field select:focus {
    outline: none;
    border-color: var(--border-accent-glass);
    background: var(--glass-bg-white);
    box-shadow: 0 0 0 3px rgba(113, 254, 235, 0.15);
}

.ai-inline-field textarea {
    min-height: 70px;
    resize: vertical;
}

.ai-inline-field input.error,
.ai-inline-field textarea.error,
.ai-inline-field select.error {
    border-color: var(--error);
}

/* Adjust input container when form is active */
.ai-chat-input-wrapper.has-form .ai-chat-input-container {
    border-radius: 0 0 16px 16px;
    border-top: none;
}

.ai-chat-input-container {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--glass-bg-white);
    backdrop-filter: blur(var(--blur-lg));
    -webkit-backdrop-filter: blur(var(--blur-lg));
    border: 1px solid var(--border-glass);
    border-radius: 28px;
    box-shadow: var(--shadow-glass);
    transition: all var(--transition-glass);
}

.ai-chat-input-container:focus-within {
    border-color: var(--border-accent-glass);
    background: rgba(255, 255, 255, 0.7);
    box-shadow: var(--shadow-glass-lg), 0 0 0 3px rgba(113, 254, 235, 0.1);
}

.ai-chat-input {
    flex: 1;
    min-width: 0;
    width: 100%;
    border: none;
    outline: none;
    font-size: 1rem;
    background: transparent;
    color: var(--text-primary);
    padding: 0.5rem;
}

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

.ai-input-action {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.ai-input-action:hover {
    background: var(--bg-light);
    color: var(--text-primary);
}

.ai-input-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.ai-input-send {
    width: 40px;
    height: 40px;
    border: none;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    transition: all 0.2s ease;
    box-shadow: var(--shadow-md);
}

.ai-input-send:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
    box-shadow: var(--shadow-lg);
}

.ai-input-send svg {
    stroke: var(--white);
}

.ai-chat-disclaimer {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.75rem;
}

/* Automation Picker Modal */
.ai-picker-modal {
    position: absolute;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 450px;
    max-height: 500px;
    background: var(--glass-bg-white);
    backdrop-filter: blur(var(--blur-xl));
    -webkit-backdrop-filter: blur(var(--blur-xl));
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    box-shadow: var(--shadow-glass-lg);
    z-index: 100;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ai-picker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-glass);
    background: var(--glass-bg-light);
}

.ai-picker-header h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.ai-picker-close {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.ai-picker-close:hover {
    background: var(--bg-light);
    color: var(--text-primary);
}

.ai-picker-search {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--border-glass);
}

.ai-picker-search svg {
    color: var(--text-muted);
    flex-shrink: 0;
}

.ai-picker-search input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 0.9rem;
    background: transparent;
    color: var(--text-primary);
}

.ai-picker-search input::placeholder {
    color: var(--text-muted);
}

.ai-picker-categories {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--border-glass);
    overflow-x: auto;
}

.ai-picker-category {
    padding: 0.4rem 0.9rem;
    border: 1px solid var(--border-glass);
    background: var(--glass-bg-light);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.ai-picker-category:hover {
    border-color: var(--primary);
    color: var(--primary);
}

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

.ai-picker-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

.ai-picker-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 1rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all var(--transition-glass);
}

.ai-picker-item:hover {
    background: var(--glass-bg-light);
}

.ai-picker-item-icon {
    width: 40px;
    height: 40px;
    background: var(--glass-bg-light);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: 1px solid var(--border-glass-subtle);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.ai-picker-item-content {
    flex: 1;
}

.ai-picker-item-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.15rem;
}

.ai-picker-item-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Dynamic Form Container */
.ai-form-container {
    background: var(--glass-bg-white);
    backdrop-filter: blur(var(--blur-lg));
    -webkit-backdrop-filter: blur(var(--blur-lg));
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    margin: 1rem 0;
    overflow: hidden;
    box-shadow: var(--shadow-glass);
}

.ai-form-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-glass);
    background: var(--glass-bg-light);
}

.ai-form-back {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border-glass);
    background: var(--glass-bg-white);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all var(--transition-glass);
}

.ai-form-back:hover {
    background: rgba(255, 255, 255, 0.7);
    border-color: var(--border-glass-strong);
    color: var(--text-primary);
}

.ai-form-title {
    flex: 1;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.ai-form-badge {
    padding: 0.3rem 0.7rem;
    background: var(--primary);
    color: var(--white);
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
}

.ai-form-fields {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.ai-form-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.ai-form-field label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

.ai-form-field input,
.ai-form-field textarea,
.ai-form-field select {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    font-size: 0.9rem;
    background: var(--glass-bg-light);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    color: var(--text-primary);
    transition: all var(--transition-glass);
}

.ai-form-field input:focus,
.ai-form-field textarea:focus,
.ai-form-field select:focus {
    outline: none;
    border-color: var(--border-accent-glass);
    background: var(--glass-bg-white);
    box-shadow: 0 0 0 3px rgba(113, 254, 235, 0.15);
}

.ai-form-field textarea {
    min-height: 100px;
    resize: vertical;
}

.ai-form-field .field-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.ai-form-submit {
    margin-top: 0.5rem;
    padding: 0.875rem 1.5rem;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-md);
}

.ai-form-submit:hover {
    transform: translateY(-2px);
    background: var(--primary-dark);
    box-shadow: var(--shadow-lg);
}

/* Chat Messages */
.ai-message {
    display: flex;
    gap: 1rem;
    padding: 1.5rem;
    margin-bottom: 0.75rem;
    animation: fadeIn 0.3s ease;
    background: var(--glass-bg-white);
    backdrop-filter: blur(var(--blur-md));
    -webkit-backdrop-filter: blur(var(--blur-md));
    border-radius: 16px;
    border: 1px solid var(--border-glass);
    box-shadow: var(--shadow-glass);
}

.ai-message.user {
    background: var(--glass-bg-primary);
    border-color: rgba(255, 255, 255, 0.1);
}

.ai-message.user .ai-message-role,
.ai-message.user .ai-message-text {
    color: var(--white);
}

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

.ai-message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    backdrop-filter: blur(var(--blur-sm));
    -webkit-backdrop-filter: blur(var(--blur-sm));
    border: 1px solid var(--border-glass-subtle);
    box-shadow: var(--shadow-glass-sm);
}

.ai-message-avatar.user {
    background: var(--glass-bg-primary);
    color: var(--white);
    font-weight: 600;
    font-size: 0.875rem;
    border-color: rgba(255, 255, 255, 0.15);
}

.ai-message-avatar.assistant {
    background: var(--glass-bg-accent);
    color: var(--primary);
    border-color: var(--border-accent-glass);
}

.ai-message-content {
    flex: 1;
    max-width: calc(100% - 50px);
}

.ai-message-role {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.ai-message-text {
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text-primary);
}

.ai-message-text p {
    margin-bottom: 0.5rem;
}

.ai-message-text p:last-child {
    margin-bottom: 0;
}

/* Remove empty paragraphs and excessive breaks */
.ai-message-text p:empty,
.ai-message-text br + br {
    display: none;
}

/* Headers in chat messages */
.ai-message-text h1,
.ai-message-text h2,
.ai-message-text h3,
.ai-message-text h4,
.ai-message-text h5,
.ai-message-text h6 {
    color: var(--text-primary);
    font-weight: 600;
    margin-top: 1rem;
    margin-bottom: 0.35rem;
    line-height: 1.3;
}

.ai-message-text h1:first-child,
.ai-message-text h2:first-child,
.ai-message-text h3:first-child,
.ai-message-text h4:first-child,
.ai-message-text h5:first-child,
.ai-message-text h6:first-child {
    margin-top: 0;
}

.ai-message-text h1 { font-size: 1.3rem; }
.ai-message-text h2 { font-size: 1.15rem; }
.ai-message-text h3 { font-size: 1.05rem; }
.ai-message-text h4 { font-size: 1rem; }
.ai-message-text h5 { font-size: 0.95rem; }
.ai-message-text h6 { font-size: 0.9rem; color: var(--text-secondary); }

/* Horizontal rule */
.ai-message-text hr {
    border: none;
    border-top: 1px solid var(--border-light);
    margin: 0.75rem 0;
}

/* Lists */
.ai-message-text ul,
.ai-message-text ol {
    margin: 0.5rem 0;
    padding-left: 1.25rem;
}

.ai-message-text li {
    margin-bottom: 0.25rem;
}

.ai-message-text li:last-child {
    margin-bottom: 0;
}

/* Nested lists */
.ai-message-text li ul,
.ai-message-text li ol {
    margin: 0.25rem 0;
}

/* Code blocks */
.ai-message-text pre {
    background: var(--primary);
    color: var(--bg-light);
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    font-size: 0.85rem;
    margin: 1rem 0;
}

.ai-message-text pre code {
    background: none;
    padding: 0;
    color: inherit;
}

/* Inline code */
.ai-message-text code {
    background: var(--bg-secondary);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

/* Typing Indicator */
.ai-typing {
    display: flex;
    gap: 0.3rem;
    padding: 0.5rem 0;
}

.ai-typing-dot {
    width: 8px;
    height: 8px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out;
}

.ai-typing-dot:nth-child(1) { animation-delay: 0s; }
.ai-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.ai-typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
    0%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-6px); }
}

/* ============================================
   Media Upload Zone (Shopify Product Creator)
   ============================================ */

.media-upload-zone {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--bg-secondary);
}

.media-upload-zone:hover {
    border-color: var(--accent);
    background: rgba(113, 254, 235, 0.05);
}

.media-upload-zone.drag-over {
    border-color: var(--accent);
    background: rgba(113, 254, 235, 0.1);
    transform: scale(1.01);
}

.media-upload-content svg {
    color: var(--text-secondary);
}

.media-upload-browse {
    color: var(--link-color);
    cursor: pointer;
    text-decoration: underline;
}

.media-upload-browse:hover {
    color: var(--link-color-hover);
}

.media-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}

.media-preview-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.media-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-preview-item:first-child {
    border: 2px solid var(--accent);
}

.media-preview-item:first-child::after {
    content: 'Cover';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--accent);
    color: var(--primary-dark);
    font-size: 0.6875rem;
    font-weight: 600;
    text-align: center;
    padding: 2px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.media-preview-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
}

.media-preview-item:hover .media-preview-remove {
    opacity: 1;
}

.media-preview-remove svg {
    width: 12px;
    height: 12px;
    stroke: white;
    stroke-width: 2.5;
}

.media-preview-remove:hover {
    background: rgba(239, 68, 68, 0.9);
}

/* Drag handle for reordering */
.media-preview-item.dragging {
    opacity: 0.5;
    transform: scale(0.95);
}

.media-preview-item.drag-target {
    border: 2px dashed var(--accent);
}

/* Responsive */
@media (max-width: 640px) {
    .ai-chat-greeting {
        font-size: 1.5rem;
    }

    .ai-picker-modal {
        width: 95%;
        bottom: 90px;
    }
}

/* ============================================
   Health Score Components
   ============================================ */

/* Info Icon */
.health-info-icon {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: help;
    color: var(--text-secondary);
    opacity: 0.6;
    transition: all 0.2s ease;
}

.health-info-icon:hover {
    opacity: 1;
    color: var(--accent-dark);
    transform: scale(1.1);
}

/* Tooltip */
.health-tooltip {
    position: absolute;
    background: var(--primary);
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.813rem;
    line-height: 1.5;
    max-width: 300px;
    z-index: 10000;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    word-wrap: break-word;
    text-align: left;
}

.health-tooltip.visible {
    opacity: 1;
}

/* Arrow for tooltip */
.health-tooltip::before {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid var(--primary);
}

/* Score card positioning */
.health-score-card {
    position: relative;
}

/* Responsive adjustments for health tooltips */
@media (max-width: 768px) {
    .health-tooltip {
        max-width: 250px;
        font-size: 0.75rem;
        padding: 0.625rem 0.875rem;
    }
}

/* ============================================
   Info Tooltip (fixed-position, escapes overflow)
   ============================================ */
.info-tooltip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--glass-bg-subtle);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.625rem;
    font-weight: 700;
    cursor: help;
    vertical-align: middle;
    flex-shrink: 0;
}

.info-tooltip-popup {
    position: fixed;
    background: var(--primary);
    color: white;
    padding: 0.6rem 0.75rem;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 400;
    line-height: 1.5;
    white-space: normal;
    width: 240px;
    text-align: left;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
    z-index: 100000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.info-tooltip-popup.visible {
    opacity: 1;
}

.info-tooltip-popup::after {
    content: '';
    position: absolute;
    top: 100%;
    left: var(--arrow-left, 50%);
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--primary);
}

@media (max-width: 768px) {
    .info-tooltip-popup {
        width: 200px;
        font-size: 0.6875rem;
    }
}

/* ============================================
   HTML Preview Styles (for Product Optimizer)
   ============================================ */

.html-preview h1, .html-preview h2, .html-preview h3, .html-preview h4, .html-preview h5, .html-preview h6 {
    color: var(--text-primary);
    margin: 0 0 0.75rem 0;
    font-weight: 600;
}

.html-preview h2 {
    font-size: 1.25rem;
    margin-top: 0;
}

.html-preview h3 {
    font-size: 1.1rem;
}

.html-preview p {
    margin: 0 0 1rem 0;
    color: var(--text-secondary);
    line-height: 1.6;
}

.html-preview ul, .html-preview ol {
    margin: 0 0 1rem 0;
    padding-left: 1.5rem;
    color: var(--text-secondary);
}

.html-preview li {
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.html-preview strong {
    color: var(--text-primary);
    font-weight: 600;
}

.html-preview em {
    font-style: italic;
}

.html-preview a {
    color: var(--accent-dark);
    text-decoration: none;
}

.html-preview a:hover {
    text-decoration: underline;
}

/* Remove last element bottom margin for cleaner spacing */
.html-preview > *:last-child {
    margin-bottom: 0;
}

/* ============================================
   Content Hub Tabs
   ============================================ */

.content-hub-tabs-container {
    margin-bottom: 2rem;
}

.content-hub-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 1.5rem;
    background: transparent;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

.content-hub-tab svg {
    transition: all 0.3s ease;
}

.content-hub-tab:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
}

.content-hub-tab:hover svg {
    transform: scale(1.1);
}

.content-hub-tab.active {
    background: white;
    color: var(--primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.05);
}

.content-hub-tab.active svg {
    color: var(--accent-dark);
}

.content-hub-tab .tab-badge {
    margin-left: 0.5rem;
    padding: 0.25rem 0.65rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.content-hub-tab .tab-badge.manual {
    background: rgba(10, 40, 54, 0.1);
    color: var(--text-secondary);
}

.content-hub-tab .tab-badge.automated {
    background: rgba(113, 254, 235, 0.15);
    color: var(--accent-dark);
}

.content-hub-tab.active .tab-badge.manual {
    background: rgba(10, 40, 54, 0.15);
    color: var(--primary);
}

.content-hub-tab.active .tab-badge.automated {
    background: rgba(113, 254, 235, 0.25);
    color: var(--accent-dark);
}

/* Content Hub Section Animations */
.content-hub-section {
    animation: fadeIn 0.4s ease-in-out;
    transition: opacity 0.3s ease-in-out;
    opacity: 1;
}

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

/* Mobile Responsive */
@media (max-width: 768px) {
    .content-hub-tab {
        font-size: 0.875rem;
        padding: 0.875rem 1rem;
    }

    .content-hub-tab svg {
        width: 16px;
        height: 16px;
        margin-right: 0.375rem;
    }

    .content-hub-tab .tab-badge {
        font-size: 0.688rem;
        padding: 0.188rem 0.5rem;
    }
}

@media (max-width: 480px) {
    .content-hub-tab span:first-of-type {
        display: none; /* Hide text labels on very small screens */
    }

    .content-hub-tab {
        padding: 0.75rem;
    }

    .content-hub-tab svg {
        margin-right: 0;
    }
}

/* ============================================
   Brand Voice Settings
   ============================================ */

.brand-voice-option {
    display: block;
    cursor: pointer;
}

.brand-voice-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.brand-voice-card {
    background: var(--bg-secondary);
    border: 2px solid var(--border-light);
    border-radius: 12px;
    padding: 1rem;
    transition: all 0.2s ease;
}

.brand-voice-option:hover .brand-voice-card {
    background: var(--bg-hover);
    border-color: var(--border-color);
}

.brand-voice-option input[type="radio"]:checked + .brand-voice-card {
    background: rgba(59, 130, 246, 0.08);
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.brand-voice-title {
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.brand-voice-desc {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.brand-voice-option input[type="radio"]:checked + .brand-voice-card .brand-voice-title {
    color: var(--accent-dark);
}

/* Form input styles */
.form-input {
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    font-size: 0.875rem;
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.form-input::placeholder {
    color: var(--text-muted);
}

textarea.form-input {
    font-family: inherit;
    line-height: 1.6;
}

/* ============================================
   Content Hub Calendar
   ============================================ */

/* Calendar card container - prevent grid overflow */
#contentCalendarCard {
    min-width: 0;
    overflow: hidden;
}

#contentCalendarCard .card-body {
    overflow: hidden;
}

/* Content Hub main grid layout fix */
#content-hub > div[style*="grid-template-columns"] > * {
    min-width: 0;
}

.content-calendar {
    width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

.calendar-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-light);
    width: 100%;
    box-sizing: border-box;
}

.calendar-day-header {
    padding: 0.5rem 0.25rem;
    text-align: center;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    min-width: 0;
    overflow: hidden;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    width: 100%;
    box-sizing: border-box;
}

.calendar-day {
    min-height: 56px;
    padding: 0.375rem 0.25rem;
    border-right: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-primary);
    position: relative;
    cursor: pointer;
    transition: background 0.2s;
    min-width: 0;
    overflow: hidden;
    box-sizing: border-box;
}

.calendar-day:nth-child(7n) {
    border-right: none;
}

.calendar-day:hover {
    background: rgba(113, 254, 235, 0.05);
}

.calendar-day.other-month {
    background: var(--bg-secondary);
    opacity: 0.5;
}

.calendar-day.today {
    background: rgba(113, 254, 235, 0.1);
    border: 2px solid var(--accent);
}

.calendar-day.today .calendar-day-number {
    background: var(--accent);
    color: var(--primary);
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6875rem;
}

.calendar-day-number {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.125rem;
}

.calendar-day.other-month .calendar-day-number {
    color: var(--text-muted);
}

.calendar-events {
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow: hidden;
    width: 100%;
    min-width: 0;
}

.calendar-event {
    font-size: 0.625rem;
    padding: 2px 4px;
    border-radius: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: grab;
    transition: transform 0.15s, box-shadow 0.15s;
    max-width: 100%;
    box-sizing: border-box;
}

.calendar-event:hover {
    transform: scale(1.02);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.calendar-event.dragging {
    opacity: 0.8;
    cursor: grabbing;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.calendar-event.blog {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.calendar-event.social {
    background: linear-gradient(135deg, #E1306C 0%, #F77737 100%);
    color: white;
}

.calendar-event.product {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.calendar-day.drag-over {
    background: rgba(113, 254, 235, 0.2);
    border: 2px dashed var(--accent);
}

.calendar-more {
    font-size: 0.625rem;
    color: var(--text-muted);
    text-align: center;
    padding: 2px;
}

/* AI Suggestions */
.ai-suggestion-item {
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.ai-suggestion-item:hover {
    background: white;
    border-color: var(--accent);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(113, 254, 235, 0.2);
}

.ai-suggestion-item:last-child {
    margin-bottom: 0;
}

/* Content Table Status Badges */
.content-status {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
}

.content-status.scheduled {
    background: rgba(102, 126, 234, 0.15);
    color: #667eea;
}

.content-status.draft {
    background: rgba(156, 163, 175, 0.15);
    color: var(--text-muted);
}

.content-status.published {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.content-type-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
}

.content-type-badge.blog {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.content-type-badge.social {
    background: linear-gradient(135deg, #E1306C 0%, #F77737 100%);
    color: white;
}

.content-type-badge.product {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

/* ============================================
   Admin Panel Components
   ============================================ */

/* Stats row grid */
.admin-stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

/* Trend indicator on stat cards */
.stat-card .stat-trend {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 0.25rem;
}
.stat-trend.up { color: #059669; }
.stat-trend.down { color: var(--error); }
.stat-trend.neutral { color: var(--text-muted); }

/* Featured stat card (e.g. MRR) */
.stat-card.stat-card-featured {
    background: linear-gradient(135deg, rgba(167,139,250,0.08) 0%, rgba(255,255,255,0.95) 100%);
    border: 1px solid rgba(167,139,250,0.2);
}
.stat-card.stat-card-featured .stat-value {
    font-size: 2.25rem;
    color: #7C3AED;
}

/* Section header */
.admin-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-light);
}
.admin-section-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}
.admin-section-header .section-badge {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Sub-tabs: horizontal scroll on mobile */
.admin-sub-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
}
.admin-sub-tabs::-webkit-scrollbar { display: none; }

/* Missing badge variants */
.badge-secondary {
    background: #F1F5F9;
    color: #475569;
}
.badge-primary {
    background: #DBEAFE;
    color: #1E40AF;
}

/* Progress ring for percentage stats */
.admin-progress-ring {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.admin-progress-ring svg { transform: rotate(-90deg); }
.admin-progress-ring .ring-bg {
    fill: none;
    stroke: var(--border-light);
    stroke-width: 3;
}
.admin-progress-ring .ring-value {
    fill: none;
    stroke-width: 3;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.5s ease;
}
.admin-progress-ring .ring-text {
    position: absolute;
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Mini usage bar */
.admin-usage-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.admin-usage-bar .bar-track {
    flex: 1;
    height: 6px;
    background: var(--border-light);
    border-radius: 3px;
    overflow: hidden;
    min-width: 40px;
}
.admin-usage-bar .bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
}
.admin-usage-bar .bar-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

/* Status dot (traffic light) */
.status-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 0.375rem;
    vertical-align: middle;
}
.status-dot.healthy {
    background: #10b981;
    box-shadow: 0 0 6px rgba(16,185,129,0.4);
}
.status-dot.warning {
    background: var(--warning);
    box-shadow: 0 0 6px rgba(245,158,11,0.4);
}
.status-dot.error {
    background: var(--error);
    box-shadow: 0 0 6px rgba(239,68,68,0.4);
}

/* Sticky table headers */
.admin-table-sticky thead th {
    position: sticky;
    top: 0;
    background: var(--glass-bg-white);
    z-index: 1;
    box-shadow: 0 1px 0 var(--border-light);
}

/* Striped table rows */
.admin-table-striped tbody tr:nth-child(even) {
    background: rgba(248,250,252,0.6);
}

/* Expandable audit detail row */
.audit-detail-row { display: none; }
.audit-detail-row.expanded { display: table-row; }
.audit-detail-row td {
    background: rgba(248,250,252,0.8);
    padding: 0.75rem 1rem;
    font-size: 0.8125rem;
    border-bottom: 1px solid var(--border-light);
}
.audit-expand-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.audit-expand-btn:hover {
    background: rgba(241,245,249,0.8);
    color: var(--text-primary);
}
.audit-expand-btn svg { transition: transform 0.2s ease; }
.audit-expand-btn.expanded svg { transform: rotate(90deg); }

/* Filter panel */
.admin-filter-panel {
    background: var(--glass-bg-white);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-glass-sm);
}
.admin-filter-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    padding: 0.5rem 0;
    transition: color 0.15s ease;
}
.admin-filter-toggle:hover { color: var(--text-primary); }
.admin-filter-toggle svg { transition: transform 0.2s ease; }
.admin-filter-toggle.open svg { transform: rotate(180deg); }
.admin-filter-body {
    display: none;
    padding-top: 0.75rem;
}
.admin-filter-body.open {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: flex-end;
}

/* Date presets */
.admin-date-presets { display: flex; gap: 0.25rem; }
.admin-date-preset {
    padding: 0.375rem 0.625rem;
    font-size: 0.6875rem;
    font-weight: 500;
    border: 1px solid var(--border-light);
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.15s ease;
    white-space: nowrap;
}
.admin-date-preset:hover {
    background: rgba(241,245,249,0.8);
    color: var(--text-primary);
}
.admin-date-preset.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Filter result count */
.admin-filter-count {
    font-size: 0.75rem;
    color: var(--text-muted);
    padding: 0.25rem 0;
}

/* Page size selector */
.admin-page-size {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}
.admin-page-size select {
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    font-size: 0.75rem;
    background: white;
    min-height: auto;
}

/* 2-column grid */
.admin-grid-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

/* Pagination bar */
.admin-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}
