/* Solargen Dashboard Styles */

:root {
    --primary-color: #3B82F6;
    --primary-dark: #2563EB;
    --secondary-color: #10B981;
    --accent-color: #F59E0B;
    --danger-color: #EF4444;
    --success-color: #10B981;
    --warning-color: #F59E0B;
    
    --text-primary: #E5E7EB;
    --text-secondary: #9CA3AF;
    --text-muted: #6B7280;
    
    --bg-primary: #0B0F14;
    --bg-secondary: #0B1220;
    --bg-tertiary: #111827;
    --bg-card: #0F172A;
    
    --border-color: #1F2937;
    --border-light: #0B1220;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.5);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.6), 0 2px 4px -1px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.6), 0 4px 6px -2px rgba(0, 0, 0, 0.5);
    
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
    position: relative;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(to right, rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 24px 24px;
    z-index: 0;
}

/* Navigation */
.navbar {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: 70px;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.nav-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-md);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    border: 1px solid transparent;
    height: 100%;
}

.nav-brand:hover {
    background-color: var(--bg-tertiary);
    border-color: var(--border-color);
}

.logo {
    height: 36px;
    width: auto;
    transition: transform 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    object-fit: contain;
}

.nav-brand:hover .logo {
    transform: scale(1.05);
}

.logo img {
    height: 100%;
    width: auto;
    object-fit: contain;
    display: block;
    vertical-align: middle;
    margin: auto;
}

.brand-text {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.025em;
}

.nav-menu {
    display: flex;
    align-items: center;
}

.nav-menu-container {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    background: var(--bg-tertiary);
    padding: var(--spacing-xs);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
}

.nav-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--text-secondary);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    position: relative;
    border: 1px solid transparent;
}

.nav-link:hover {
    color: var(--primary-color);
    background-color: var(--bg-primary);
    border-color: var(--border-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.nav-link.active {
    color: var(--text-primary);
    background: rgba(255,255,255,0.04);
    border-color: rgba(59, 130, 246, 0.35);
    box-shadow: none;
    transform: none;
}

.nav-link.active:hover {
    background: rgba(255,255,255,0.06);
}

.nav-link-content {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.nav-link i {
    font-size: 1rem;
    transition: transform 0.2s ease;
}

.nav-link:hover i {
    transform: scale(1.1);
}

.nav-link.active i {
    transform: scale(1.1);
}

.nav-link span {
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.025em;
}

.nav-user {
    display: flex;
    align-items: center;
}

.user-menu {
    position: relative;
    display: flex;
    align-items: center;
}

.user-menu-trigger {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.user-menu-trigger:hover {
    background-color: var(--bg-tertiary);
    border-color: var(--border-color);
}

.user-menu.active .user-menu-trigger {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

.user-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.2;
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.2;
}

.user-menu.active .user-name,
.user-menu.active .user-role {
    color: white;
}

.user-menu-icon {
    font-size: 0.75rem;
    color: var(--text-secondary);
    transition: transform 0.2s ease;
}

.user-menu.active .user-menu-icon {
    color: white;
    transform: rotate(180deg);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color);
    transition: border-color 0.2s ease;
}

.user-menu.active .user-avatar {
    border-color: rgba(255, 255, 255, 0.3);
}

/* Dropdown Styles */
.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    min-width: 280px;
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(0.95);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
}

.user-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Dropdown Header */
.dropdown-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--border-light);
}

.dropdown-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-color);
}

.dropdown-user-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.dropdown-user-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
}

.dropdown-user-email {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.2;
}

/* Dropdown Menu Sections */
.dropdown-menu {
    padding: var(--spacing-sm) 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-sm) var(--spacing-lg);
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
}

.dropdown-item:hover {
    background-color: var(--bg-tertiary);
    color: var(--primary-color);
}

.dropdown-item i {
    width: 16px;
    color: var(--text-secondary);
    transition: color 0.2s ease;
}

.dropdown-item:hover i {
    color: var(--primary-color);
}

.dropdown-item span {
    flex: 1;
}

/* Logout button special styling */
.logout-btn {
    color: var(--danger-color) !important;
}

.logout-btn:hover {
    background-color: #FEF2F2 !important;
    color: var(--danger-color) !important;
}

.logout-btn i {
    color: var(--danger-color) !important;
}

.dropdown-divider {
    height: 1px;
    background-color: var(--border-light);
    margin: var(--spacing-sm) 0;
}

/* Main Content */
.main-content {
    margin-top: 70px;
    padding: var(--spacing-xl);
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
    position: relative;
    z-index: 1;
}

.content-section {
    display: none;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.content-section.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.section-header {
    margin-bottom: var(--spacing-2xl);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-left h1 { margin: 0 0 6px 0; }
.header-left p { margin: 0; color: var(--text-secondary); }

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

.header-actions .btn-primary,
.header-actions .btn-secondary { height: 34px; padding: 0 12px; }

/* Stronger visibility for header buttons */
.header-actions .btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: #fff;
    border-color: rgba(59,130,246,0.8);
    box-shadow: 0 6px 16px -8px rgba(59,130,246,0.6);
}

.header-actions .btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
}

.header-actions .btn-secondary {
    background: rgba(255,255,255,0.06);
    border-color: rgba(59,130,246,0.45);
    color: #E5E7EB;
}

.header-actions .btn-secondary:hover {
    background: rgba(59,130,246,0.12);
    color: #fff;
}

.section-header h1 {
    font-size: 2.75rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.section-header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Dashboard Filters - SIMPLE & CLEAN */
.dashboard-filters {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-xl);
    margin-bottom: var(--spacing-lg);
    padding: var(--spacing-md) var(--spacing-lg);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    flex-wrap: wrap;
    min-height: 60px;
}

.date-selector {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    flex: 1;
}

.filter-presets {
    display: flex;
    gap: var(--spacing-xs);
    flex-wrap: wrap;
}

.filter-preset {
    padding: 8px 18px;
    border: none;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border-radius: 18px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    letter-spacing: 0.02em;
}

.filter-preset:hover {
    background: var(--primary-color);
    color: white;
}

.filter-preset.active {
    background: var(--primary-color);
    color: white;
    font-weight: 700;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}

.custom-date-range {
    margin-top: var(--spacing-sm);
}

.date-inputs-simple {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

.date-inputs-simple input[type="date"] {
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 0.85rem;
    cursor: pointer;
}

.date-inputs-simple span {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.btn-apply {
    padding: 6px 12px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    font-weight: 500;
}

/* Redesigned Period Info - Elegant & Compact */
.period-info-redesigned {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex: 1;
}

.period-main {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.period-title {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.period-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.comparison-compact {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.comparison-switch {
    position: relative;
    display: inline-block;
    width: 32px;
    height: 18px;
}

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

.switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border-color);
    transition: 0.2s;
    border-radius: 18px;
}

.switch-slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: 0.2s;
    border-radius: 50%;
}

.comparison-switch input:checked + .switch-slider {
    background-color: var(--primary-color);
}

.comparison-switch input:checked + .switch-slider:before {
    transform: translateX(14px);
}

.comparison-text {
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.comparison-select-compact {
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
    padding: 0;
    font-weight: 500;
    outline: none;
}

.comparison-select-compact:hover {
    color: var(--text-primary);
}

.btn-refresh-redesigned {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    border: 1px solid transparent;
}

.btn-refresh-redesigned:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.15);
}

.btn-refresh-redesigned:active {
    transform: translateY(0);
}

.btn-refresh-redesigned i {
    font-size: 0.8rem;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-2xl);
}

/* Stat Cards - subtler, flatter */
.stat-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: var(--spacing-lg);
    border: 1px solid var(--border-color);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
    display: grid;
    grid-template-columns: 40px 1fr;
    align-items: center;
    column-gap: var(--spacing-md);
}

.stat-card:hover { transform: none; }

.stat-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.06);
    display: grid;
    place-items: center;
    color: #BFDBFE;
    font-size: 0.95rem;
    box-shadow: none;
}

.stat-content { display: grid; row-gap: 4px; }

.stat-number {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-primary);
}

.stat-label {
    color: var(--text-secondary);
    font-weight: 600;
    margin: 0;
}

.stat-change {
    justify-self: start;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

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

.stat-change.negative {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.stat-change.neutral {
    background: rgba(156, 163, 175, 0.1);
    color: #9ca3af;
}

/* Loading States */
.loading-placeholder {
    background: linear-gradient(90deg, var(--border-color) 25%, rgba(255,255,255,0.1) 50%, var(--border-color) 75%);
    background-size: 200% 100%;
    animation: loading-shimmer 2s infinite;
    border-radius: 4px;
    height: 28px;
    width: 80px;
}

.loading-placeholder.small {
    height: 16px;
    width: 60px;
}

@keyframes loading-shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.stat-number.loading {
    opacity: 0.7;
}

.stat-number:not(.loading) {
    animation: fadeInUp 0.5s ease;
}

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

/* Responsive */
@media (max-width: 1024px) {
    .period-main {
        flex-direction: column;
        gap: var(--spacing-sm);
        padding: 12px 16px;
    }
    
    .period-actions {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .dashboard-filters {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
        gap: var(--spacing-md);
    }
    
    .date-selector {
        order: 1;
    }
    
    .period-info-redesigned {
        order: 2;
        justify-content: center;
    }
    
    .filter-presets {
        justify-content: center;
    }
    
    .date-inputs-simple {
        justify-content: center;
    }
    
    .period-main {
        flex-direction: row;
        gap: var(--spacing-md);
        padding: 8px 12px;
    }
    
    .comparison-compact {
        gap: 6px;
    }
}

.stat-change.positive { color: #86efac; background: rgba(22,163,74,0.12); }
.stat-change.negative { color: #fca5a5; background: rgba(239,68,68,0.12); }

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--spacing-xl);
}

/* Cards */
.dashboard-card {
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
    overflow: hidden;
}

.card-header {
    padding: var(--spacing-md) var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: transparent;
}

.card-header h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.view-all {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.875rem;
    transition: color 0.2s ease;
    position: relative;
}

.view-all::after {
    content: '→';
    margin-left: 6px;
    transition: transform 0.2s ease;
}

.view-all:hover {
    color: #93C5FD;
}

.view-all:hover::after {
    transform: translateX(3px);
}

.card-content {
    padding: var(--spacing-lg);
}

/* Recent lists */
.leads-list {
    display: grid;
}

.leads-list .lead-item,
.quotes-list .quote-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 16px 12px;
    margin: 0 -12px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.lead-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.06);
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 0.9rem;
    color: #E5E7EB;
    border: 1px solid var(--border-color);
}

.lead-info { display: grid; row-gap: 6px; }

.lead-header { display: flex; align-items: center; gap: 10px; }

.lead-info h4 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.lead-sub {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.lead-meta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.meta-item { color: var(--text-secondary); font-size: 0.8rem; display: inline-flex; align-items: center; gap: 6px; }

.leads-list .lead-item:hover,
.quotes-list .quote-item:hover {
    background: rgba(255,255,255,0.03);
    border-radius: 10px;
}

.lead-info p,
.quote-info p {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.lead-actions .btn-sm,
.quote-actions .btn-sm {
    background: transparent;
    border-color: var(--border-color);
    color: var(--text-secondary);
}

.leads-list .lead-item:hover .btn-sm,
.quotes-list .quote-item:hover .btn-sm {
    border-color: rgba(59,130,246,0.35);
    color: #BFDBFE;
}

/* Distinguish status chip vs action */
.status-badge {
    padding: 2px 8px;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border: 1px solid transparent;
}

/* Clickable status badges */
.status-badge.clickable-status {
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.status-badge.clickable-status:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.status-badge.clickable-status:active {
    transform: scale(0.95);
}

.status-badge.clickable-status::after {
    content: "↻";
    position: absolute;
    top: -2px;
    right: -2px;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    border-radius: 50%;
    width: 12px;
    height: 12px;
    font-size: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.status-badge.clickable-status:hover::after {
    opacity: 1;
}

.status-badge.new { background: rgba(59,130,246,0.25); color: #E3F2FF; border-color: rgba(59,130,246,0.35); }
.status-badge.active { background: rgba(16,185,129,0.25); color: #D1FAE5; border-color: rgba(16,185,129,0.35); }
.status-badge.pending { background: rgba(245,158,11,0.25); color: #FEF3C7; border-color: rgba(245,158,11,0.35); }

.lead-actions .btn-sm { border-radius: 8px; }

.btn-link {
    background: transparent;
    border: none;
    color: #93C5FD;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 8px;
    cursor: pointer;
}

.btn-link:hover { background: rgba(59,130,246,0.12); color: #BFDBFE; }

.btn-link i { font-size: 0.85rem; }

/* Quick Actions */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-lg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.action-btn:hover {
    border-color: rgba(59, 130, 246, 0.35);
    color: var(--text-primary);
    transform: translateY(-2px);
}

.action-btn i {
    font-size: 1.25rem;
    color: var(--text-secondary);
}

/* Buttons */
.btn-primary {
    background: rgba(59,130,246,0.14);
    color: #BFDBFE;
    border: 1px solid rgba(59,130,246,0.35);
    padding: calc(var(--spacing-sm) - 2px) calc(var(--spacing-lg) + 2px);
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
    box-shadow: none;
}

.btn-primary:hover {
    background: rgba(59,130,246,0.22);
    transform: translateY(-1px);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: calc(var(--spacing-sm) - 2px) calc(var(--spacing-lg) + 2px);
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: var(--bg-tertiary);
    border-color: rgba(59, 130, 246, 0.35);
    color: var(--text-primary);
}

.btn-sm {
    padding: 6px 10px;
    font-size: 0.8rem;
}

/* Filters */
.filters-bar {
    display: flex;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
    align-items: center;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
}

.filter-select,
.filter-input {
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.875rem;
    min-width: 150px;
}

.filter-select:focus,
.filter-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Tables */
.table-container {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

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

.data-table th {
    background: var(--bg-tertiary);
    padding: var(--spacing-md) var(--spacing-lg);
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
}

.data-table td {
    padding: var(--spacing-md) var(--spacing-lg);
    border-bottom: 1px solid var(--border-light);
    color: var(--text-primary);
}

.data-table tr:hover {
    background: var(--bg-tertiary);
}

.data-table tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.02);
}

/* Status Badges */
.status-badge.contacted {
    background: rgba(245, 158, 11, 0.12);
    color: #FCD34D;
    border-color: rgba(245, 158, 11, 0.25);
}

.status-badge.qualified {
    background: rgba(16, 185, 129, 0.12);
    color: #6EE7B7;
    border-color: rgba(16, 185, 129, 0.25);
}

.status-badge.proposal_sent {
    background: rgba(99, 102, 241, 0.12);
    color: #A5B4FC;
    border-color: rgba(99, 102, 241, 0.25);
}

.status-badge.closed_won {
    background: rgba(16, 185, 129, 0.12);
    color: #34D399;
    border-color: rgba(16, 185, 129, 0.25);
}

.status-badge.closed_lost {
    background: rgba(239, 68, 68, 0.12);
    color: #FCA5A5;
    border-color: rgba(239, 68, 68, 0.25);
}

/* Settings Grid */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: var(--spacing-xl);
}

/* Integration section takes full width */
.settings-grid .dashboard-card:has(.integration-section) {
    grid-column: 1 / -1;
}

.settings-form {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.form-group label {
    font-weight: 500;
    color: var(--text-primary);
}

.form-group input,
.form-group textarea,
.form-group select {
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.875rem;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Custom CSS field styling */
.form-group textarea#embed-custom-css {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.8rem;
    line-height: 1.4;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    resize: vertical;
    min-height: 200px;
}

.form-help {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-xs);
    margin-top: var(--spacing-xs);
    padding: var(--spacing-sm);
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.form-help i {
    color: var(--primary-color);
    margin-top: 2px;
    flex-shrink: 0;
}

.form-help code {
    background: var(--bg-primary);
    padding: 2px 4px;
    border-radius: 3px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.75rem;
    color: var(--text-primary);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-md);
}

.form-actions {
    display: flex;
    gap: var(--spacing-sm);
    justify-content: flex-end;
    margin-top: var(--spacing-lg);
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--border-light);
}

/* Lead Details */
.lead-details {
    max-width: 600px;
}

.detail-section {
    margin-bottom: var(--spacing-xl);
}

.detail-section h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    border-bottom: 1px solid var(--border-light);
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-md);
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.detail-item label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.detail-item span {
    font-size: 1rem;
    color: var(--text-primary);
    font-weight: 500;
}

.detail-actions {
    display: flex;
    gap: var(--spacing-sm);
    justify-content: flex-end;
    margin-top: var(--spacing-xl);
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--border-light);
}

/* Quote Details */
.quote-details {
    max-width: 700px;
}

/* Status badges for quotes */
.status-badge.draft {
    background: rgba(245, 158, 11, 0.12);
    color: #FACC15;
    border-color: rgba(245, 158, 11, 0.25);
}

.status-badge.sent {
    background: rgba(59, 130, 246, 0.12);
    color: #93C5FD;
    border-color: rgba(59, 130, 246, 0.25);
}

.status-badge.viewed {
    background: rgba(99, 102, 241, 0.12);
    color: #A5B4FC;
    border-color: rgba(99, 102, 241, 0.25);
}

.status-badge.accepted {
    background: rgba(16, 185, 129, 0.12);
    color: #34D399;
    border-color: rgba(16, 185, 129, 0.25);
}

.status-badge.rejected {
    background: rgba(239, 68, 68, 0.12);
    color: #FCA5A5;
    border-color: rgba(239, 68, 68, 0.25);
}

/* Reports */
.reports-container {
    max-width: 800px;
}

.report-section {
    margin-bottom: var(--spacing-xl);
}

.report-section h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    border-bottom: 1px solid var(--border-light);
}

.report-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--spacing-md);
}

.report-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    text-align: center;
    transition: all 0.2s ease;
}

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

.report-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: var(--spacing-xs);
}

.report-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.report-summary {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-sm) 0;
    border-bottom: 1px solid var(--border-light);
}

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

.summary-item label {
    font-weight: 500;
    color: var(--text-secondary);
}

.summary-item span {
    font-weight: 600;
    color: var(--text-primary);
}

.report-actions {
    display: flex;
    gap: var(--spacing-sm);
    justify-content: flex-end;
    margin-top: var(--spacing-xl);
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--border-light);
}

/* Switch Toggle */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

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

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border-color);
    transition: 0.4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--primary-color);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.setting-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-md) 0;
    border-bottom: 1px solid var(--border-light);
}

.setting-group:last-child {
    border-bottom: none;
}

/* Subscription Info */
.subscription-info {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.plan-details h4 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
}

.plan-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: var(--spacing-md);
}

.plan-features {
    list-style: none;
    margin-bottom: var(--spacing-lg);
}

.plan-features li {
    padding: var(--spacing-xs) 0;
    color: var(--text-secondary);
}

/* Integration Section Styles */
/* Left Panel - Customization Controls */
.integration-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: 100%;
    box-shadow: var(--shadow-md);
}

.integration-card .card-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: var(--spacing-sm);
    text-align: center;
    flex-shrink: 0;
}

.header-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-xs);
}

.header-content h3 {
    color: white;
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
}

.header-content p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.8rem;
    margin: 0;
}

/* Customization Content Container */
.customization-content {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-sm);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.integration-status {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    background: rgba(255, 255, 255, 0.1);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    backdrop-filter: blur(10px);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10B981;
    animation: pulse 2s infinite;
}

.status-dot.active {
    background: #10B981;
}

.status-text {
    font-size: 0.875rem;
    font-weight: 500;
}

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

/* Page Builder Layout - Integration Section */
.integration-section {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: var(--spacing-md);
    height: calc(100vh - 120px);
    margin-bottom: var(--spacing-lg);
}

/* Left Panel: Customization Controls */
.integration-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: 100%;
    box-shadow: var(--shadow-md);
}

.integration-card .card-header {
    padding: var(--spacing-sm);
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.header-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-xs);
}

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

.header-content p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin: 0;
}

/* Customization Content - Vertical Layout */
.customization-content {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-sm);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

/* Branding Section - L'action principale */
.customization-section {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-sm);
    box-shadow: var(--shadow-sm);
    order: 1;
}

/* Embed Code - Récupérer le code */
.code-section {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: var(--spacing-sm);
    border: 1px solid var(--border-color);
    order: 2;
}

/* Quick Setup - Aide contextuelle */
.quick-setup {
    background: linear-gradient(135deg, #0b1220 0%, #0e1726 100%);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: var(--spacing-sm);
    order: 3;
}

/* Right Panel: Live Preview */
.preview-section {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

/* Quick Setup Section - Ultra Compact */
.quick-setup {
    background: linear-gradient(135deg, #0b1220 0%, #0e1726 100%);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
}

.setup-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-xs);
}

.setup-header i {
    color: var(--primary-color);
    font-size: 0.9rem;
}

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

.setup-steps {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.step {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-xs);
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.step:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.step-number {
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.7rem;
    flex-shrink: 0;
}

.step-content h5 {
    color: var(--text-primary);
    font-weight: 600;
    margin: 0;
    font-size: 0.8rem;
}

.step-content p {
    display: none;
}

/* Code Section */
.code-section {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    border: 1px solid var(--border-color);
    margin-bottom: var(--spacing-xl);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
}

.section-header h4 {
    color: var(--text-primary);
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.section-header h4::before {
    content: "💻";
    font-size: 1.2em;
}

.btn-copy {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-weight: 500;
}

.btn-copy:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.code-container {
    position: relative;
    background: #1E293B;
    border-radius: var(--radius-md);
    border: 1px solid #334155;
    overflow: hidden;
    transition: all 0.2s ease;
}

.code-container:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-lg);
}

.code-textarea {
    width: 100%;
    min-height: 120px;
    padding: var(--spacing-lg);
    background: transparent;
    border: none;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    line-height: 1.5;
    color: #E2E8F0;
    resize: vertical;
    outline: none;
}

.help-text {
    margin-top: var(--spacing-md);
    color: var(--text-secondary);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.help-text i {
    color: var(--primary-color);
}

/* Customization Section - Ultra Compact */
.customization-section {
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    padding: var(--spacing-sm);
    border: 1px solid var(--border-color);
    margin-bottom: var(--spacing-sm);
}

.section-tabs {
    display: flex;
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-xs);
}

.tab-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
}

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

.tab-btn:hover:not(.active) {
    background: var(--bg-tertiary);
    border-color: var(--primary-color);
    color: var(--text-primary);
}

.tab-content {
    display: none;
    margin-top: var(--spacing-xs);
}

.tab-content.active {
    display: block;
}

.customization-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-sm);
}

/* Branding Sections - Ultra Compact */
.branding-sections {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.branding-section {
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    padding: var(--spacing-xs);
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.branding-section:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.branding-section h5 {
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: 0.8rem;
}

.branding-section h5 i {
    color: var(--primary-color);
}

.branding-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-xs);
}

.branding-grid .form-group {
    background: var(--bg-secondary);
    padding: var(--spacing-xs);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.branding-grid .form-group:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.branding-grid .form-group label {
    display: block;
    margin-bottom: var(--spacing-xs);
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.7rem;
}

.branding-grid .form-group {
    position: relative;
}

.branding-grid .form-group input[type="color"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 1;
}

.color-preview {
    width: 100%;
    height: 24px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    position: relative;
    background: var(--color-value, #ffffff);
    pointer-events: none;
}

.color-preview:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-sm);
}

.color-preview::after {
    content: "🎨";
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.7rem;
    opacity: 0.7;
}

.action-buttons {
    display: flex;
    gap: var(--spacing-xs);
    margin-top: var(--spacing-xs);
}

.action-buttons .btn-primary,
.action-buttons .btn-secondary {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-xs) var(--spacing-sm);
    font-weight: 500;
    font-size: 0.75rem;
}

/* Right Panel - Live Preview */
.preview-section {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.preview-controls {
    display: flex;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm);
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.preview-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    padding: var(--spacing-xs);
    border-radius: 9999px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-secondary);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

.preview-btn.active {
    background: rgba(59,130,246,0.2);
    color: #E5E7EB;
    border-color: rgba(59,130,246,0.5);
    box-shadow: none;
}

.preview-btn:hover:not(.active) {
    background: var(--bg-tertiary);
    border-color: rgba(59, 130, 246, 0.35);
    color: var(--text-primary);
}

.preview-container {
    flex: 1;
    padding: var(--spacing-sm);
    overflow: hidden;
}

.preview-frame {
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    overflow: hidden;
    position: relative;
    height: 100%;
    width: 100%;
}

.preview-frame::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    z-index: 1;
}

/* Device Preview Styles */
.preview-frame.device-desktop {
    width: 100%;
    height: 100%;
    border-radius: var(--radius-sm);
}

.preview-frame.device-tablet {
    width: 768px;
    height: 1024px;
    max-width: 90%;
    max-height: 90%;
    margin: 0 auto;
    border-radius: 12px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

.preview-frame.device-mobile {
    width: 375px;
    height: 667px;
    max-width: 90%;
    max-height: 90%;
    margin: 0 auto;
    border-radius: 20px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

/* Device frame styling */
.preview-frame.device-tablet::after,
.preview-frame.device-mobile::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #333;
    border-radius: 50%;
    z-index: 2;
}

.preview-frame.device-tablet::after {
    width: 8px;
    height: 8px;
    top: 20px;
}

.preview-frame.device-mobile::after {
    width: 6px;
    height: 6px;
    top: 15px;
}

.card-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: var(--spacing-xs);
    font-weight: normal;
}

/* Integration header override – tone down gradient block */
.dashboard-card:has(.integration-section) .card-header {
    background: transparent;
    color: var(--text-primary);
    padding: var(--spacing-lg);
    border-radius: 0;
    margin: 0;
}

.dashboard-card:has(.integration-section) .card-header h3::before {
    content: '🔗';
    font-size: 1.1rem;
    margin-right: 8px;
}

.dashboard-card:has(.integration-section) .card-subtitle {
    color: var(--text-secondary);
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: var(--spacing-xs);
    border-radius: var(--radius-sm);
    transition: background-color 0.2s ease;
}

.modal-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.modal-content {
    padding: var(--spacing-lg);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
    
    .settings-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .nav-menu {
        display: none;
    }
    
    .main-content {
        padding: var(--spacing-lg);
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .quick-actions {
        grid-template-columns: 1fr;
    }
    
    .filters-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group {
        width: 100%;
    }
    
    .filter-select,
    .filter-input {
        width: 100%;
    }

    /* Mobile user menu adjustments */
    .user-menu-trigger {
        padding: var(--spacing-xs) var(--spacing-sm);
    }

    .user-info {
        display: none;
    }

    .user-menu-icon {
        display: none;
    }

    .user-dropdown {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        min-width: auto;
        border-radius: 0;
        border-left: none;
        border-right: none;
        max-height: calc(100vh - 70px);
        overflow-y: auto;
    }

    .dropdown-header {
        padding: var(--spacing-md);
    }

    .dropdown-item {
        padding: var(--spacing-md) var(--spacing-lg);
    }
}

/* Tablet responsive adjustments */
@media (max-width: 1024px) and (min-width: 769px) {
    .nav-menu-container {
        gap: var(--spacing-xs);
    }
    
    .nav-link {
        padding: var(--spacing-xs) var(--spacing-sm);
    }
    
    .nav-link span {
        font-size: 0.8rem;
    }
    
    .nav-link i {
        font-size: 0.9rem;
    }
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--border-color);
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Empty States */
.empty-state {
    text-align: center;
    padding: var(--spacing-2xl);
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-md);
    min-height: 200px;
}

/* Specific styling for table empty states */
.data-table .empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 4rem 2rem;
    min-height: 200px;
    width: 100%;
}

/* Ensure colspan works properly */
.data-table td[colspan] {
    text-align: center !important;
    width: 100% !important;
}

/* More specific selector for empty states */
.data-table tr td[colspan].empty-state {
    text-align: center !important;
    width: 100% !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
}

/* Force centering for all empty state elements */
.data-table .empty-state {
    text-align: center !important;
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Override any table cell alignment */
.data-table td {
    text-align: inherit !important;
}

.data-table td.empty-state {
    text-align: center !important;
}

/* SUPER SPECIFIC override for empty state cells */
.data-table tr td[colspan].empty-state {
    text-align: center !important;
    width: 100% !important;
    display: table-cell !important;
    vertical-align: middle !important;
}

.data-table tr td[colspan].empty-state > div {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    min-height: 200px !important;
}

.data-table .empty-state i {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    opacity: 0.5;
    color: var(--text-secondary);
    display: block;
}

.data-table .empty-state h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    font-weight: 600;
    display: block;
}

.data-table .empty-state p {
    font-size: 1rem;
    color: var(--text-secondary);
    margin: 0;
    display: block;
    line-height: 1.5;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: var(--spacing-lg);
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.25rem;
    margin-bottom: var(--spacing-sm);
    color: var(--text-primary);
}

.empty-state p {
    margin-bottom: var(--spacing-lg);
} 

/* Sticky right Actions column for Simulations table */
.simulations-table th:last-child,
.simulations-table td:last-child {
    position: sticky;
    right: 0;
    background: var(--bg-card);
    z-index: 1;
}

.simulations-table th:last-child {
    background: var(--bg-tertiary);
    z-index: 2;
}

.simulations-table td:last-child {
    border-left: 1px solid var(--border-light);
    box-shadow: -6px 0 12px rgba(0, 0, 0, 0.12);
} 

/* Profile page refinements */
#profile .settings-form { max-width: 760px; }
#profile .form-row { grid-template-columns: 1fr 1fr; }
#profile .form-group input[disabled] {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    cursor: not-allowed;
}
#profile .card-content { padding: var(--spacing-lg); }
#profile .dropdown-avatar { width: 64px; height: 64px; }
#profile #profile-avatar-preview { border-color: var(--border-color); }
#profile .setting-group { align-items: center; }
#profile #email-form .form-row { grid-template-columns: 1fr auto; align-items: end; }
#profile #email-form .btn-secondary { height: 38px; }
#profile #mfa-section .action-buttons .btn-primary,
#profile #mfa-section .action-buttons .btn-secondary { height: 34px; } 

#profile .email-row { grid-template-columns: 1fr 1fr auto; }
#profile .form-actions { justify-content: flex-start; }
#profile .dashboard-card .card-content { padding-top: var(--spacing-md); }
#profile .dashboard-card { margin-bottom: var(--spacing-lg); } 

/* Profile layout width and distribution */
#profile .dashboard-card { max-width: 960px; margin: 0 auto var(--spacing-lg); }
#profile .settings-form { width: 100%; max-width: 900px; margin: 0 auto; }
#profile .form-row { gap: var(--spacing-md); }
#profile .email-row { grid-template-columns: minmax(260px,1fr) minmax(260px,1fr) auto; }
#profile .email-row .form-group:last-child { display: flex; align-items: flex-end; }
#profile .form-actions { justify-content: flex-start; padding-top: var(--spacing-md); }

@media (max-width: 900px) {
  #profile .dashboard-card { max-width: 100%; margin: 0 var(--spacing-sm) var(--spacing-lg); }
  #profile .settings-form { max-width: 100%; }
  #profile .form-row, #profile .email-row { grid-template-columns: 1fr; }
  #profile .email-row .form-group:last-child { align-items: center; }
  #profile .email-row .btn-secondary { width: 100%; }
} 

/* ===== BILLING SECTION - STYLE ULTRA-SIMPLE ===== */

/* Table invoices */
#billing .data-table td, #billing .data-table th { 
    padding: 12px 14px; 
}
#billing .data-table a { 
    color: #60a5fa; 
}

/* Plans - Style ultra-simple et robuste */
#billing .plan-grid {
    display: flex;
    gap: 20px;
    margin: 20px 0;
    align-items: flex-start;
}

#billing .plan-grid .dashboard-card {
    flex: 1 !important;
    border: 2px solid var(--border-color) !important;
    border-radius: 12px !important;
    background: var(--bg-secondary) !important;
    padding: 24px !important;
    position: relative !important;
    display: flex !important;
    flex-direction: column !important;
    height: 358px !important;
    max-height: 358px !important;
    min-height: 358px !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* Plan actuel - Mise en avant renforcée */
#billing .plan-grid .dashboard-card.current {
    border-color: #60a5fa !important;
    border-width: 3px !important;
    background: rgba(96, 165, 250, 0.15) !important;
    box-shadow: 0 0 20px rgba(96, 165, 250, 0.3) !important;
    transform: scale(1.02) !important;
    position: relative !important;
    z-index: 10 !important;
}

#billing .plan-grid .dashboard-card.current::before {
    content: "✓ CURRENT PLAN" !important;
    position: absolute !important;
    top: -8px !important;
    right: -8px !important;
    background: #60a5fa !important;
    color: white !important;
    font-size: 0.8rem !important;
    font-weight: bold !important;
    padding: 8px 16px !important;
    border-radius: 8px !important;
    z-index: 20 !important;
    pointer-events: none !important;
    box-shadow: 0 4px 12px rgba(96, 165, 250, 0.4) !important;
    border: 2px solid white !important;
}

/* Headers - Surcharge des styles génériques */
#billing .plan-grid .card-header {
    padding: 0 !important;
    border-bottom: none !important;
    display: block !important;
    align-items: unset !important;
    justify-content: unset !important;
}

#billing .plan-grid .card-header h3 {
    margin: 0 0 16px 0;
    font-size: 1.5rem;
    color: var(--text-primary);
}

/* Prix */
#billing .plan-grid .plan-price {
    font-size: 1.8rem;
    font-weight: bold;
    color: #60a5fa;
    margin: 0 0 20px 0;
}

/* Contenu - Surcharge des styles génériques */
#billing .plan-grid .card-content {
    padding: 0 !important;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Surcharge du style générique qui affecte les cartes */
#billing .plan-grid .card-content > div {
    margin-bottom: 0 !important;
}

/* Features */
#billing .plan-grid .plan-features {
    margin: 0 0 24px 0;
    padding-left: 0;
    list-style: none;
    flex: 1;
}

#billing .plan-grid .plan-features li {
    padding: 8px 0;
    color: var(--text-primary);
    position: relative;
    padding-left: 24px;
}

#billing .plan-grid .plan-features li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #10b981;
    font-weight: bold;
}

/* Boutons */
#billing .plan-grid .btn-primary {
    width: 100%;
    padding: 12px 20px;
    font-weight: 600;
    border-radius: 8px;
    background: #60a5fa;
    color: white;
    border: none;
    cursor: pointer;
    transition: background 0.2s ease;
    height: 48px !important;
    min-height: 48px !important;
    max-height: 48px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    white-space: nowrap !important;
}

#billing .plan-grid .btn-primary:hover {
    background: #3b82f6;
}

/* Bouton plan actuel - Mise en avant renforcée */
#billing .plan-grid .dashboard-card.current .btn-primary {
    background: #60a5fa !important;
    color: white !important;
    border: 2px solid #60a5fa !important;
    cursor: default !important;
    font-weight: bold !important;
    box-shadow: 0 4px 12px rgba(96, 165, 250, 0.3) !important;
}

#billing .plan-grid .dashboard-card.current .btn-primary:hover {
    background: #60a5fa !important;
    transform: none !important;
}

/* Plan en attente de paiement - Style adouci */
#billing .plan-grid .dashboard-card.pending-payment {
    border-color: #f59e0b !important;
    border-width: 2px !important;
    background: rgba(245, 158, 11, 0.08) !important;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.2) !important;
    transform: scale(1.01) !important;
    position: relative !important;
    z-index: 5 !important;
}

#billing .plan-grid .dashboard-card.pending-payment::before {
    content: "⚠️ PENDING" !important;
    position: absolute !important;
    top: 8px !important;
    right: 8px !important;
    background: #f59e0b !important;
    color: white !important;
    font-size: 0.7rem !important;
    font-weight: bold !important;
    padding: 4px 8px !important;
    border-radius: 4px !important;
    z-index: 10 !important;
    pointer-events: none !important;
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.3) !important;
}

#billing .plan-grid .dashboard-card.pending-payment .btn-primary {
    background: #60a5fa !important;
    color: white !important;
    border: 2px solid #60a5fa !important;
    cursor: pointer !important;
    font-weight: bold !important;
    box-shadow: 0 2px 6px rgba(96, 165, 250, 0.3) !important;
}

#billing .plan-grid .dashboard-card.pending-payment .btn-primary:hover {
    background: #3b82f6 !important;
    transform: translateY(-1px) !important;
}

/* Team table refinements */
#team .data-table td, #team .data-table th { 
    padding: 14px 16px; 
    vertical-align: middle;
}

#team .data-table .role-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#team .data-table .role-badge.role-owner {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

#team .data-table .role-badge.role-admin {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

#team .data-table .role-badge.role-member {
    background: rgba(156, 163, 175, 0.2);
    color: #9ca3af;
    border: 1px solid rgba(156, 163, 175, 0.3);
}

/* Clickable role badges */
#team .data-table .role-badge.role-clickable {
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

#team .data-table .role-badge.role-clickable:hover {
    background: var(--primary-color) !important;
    color: white !important;
    border-color: var(--primary-color) !important;
    transform: translateY(-1px);
}

#team .data-table .role-badge.role-clickable:active {
    transform: translateY(0);
}

#team .data-table .status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#team .data-table .status-badge.status-active {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

#team .data-table .status-badge.status-pending {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

#team .data-table .status-badge.status-current-user {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

#team .data-table .action-buttons {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

#team .data-table .btn-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

#team .data-table .btn-icon:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--border-light);
} 

#plan-modal .plan-grid .dashboard-card.current { outline: 2px solid #60a5fa; }
#plan-modal .plan-grid .dashboard-card.current .btn-primary { background: #1f2937; color: #60a5fa; cursor: default; } 

/* Toast notifications */
.toast {
  position: fixed;
  top: 16px;
  right: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(17,24,39,0.92);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 10px 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  z-index: 3000;
  min-width: 260px;
}
.toast.success { border-color: #16a34a; }
.toast.error { border-color: #dc2626; }
.toast .toast-icon { font-size: 14px; }
.toast .toast-message { font-weight: 500; }
.toast .toast-close { background: transparent; border: none; color: var(--text-secondary); cursor: pointer; } 

/* Danger Zone */
.btn-danger { background: #7f1d1d; color: #fff; border: 1px solid #b91c1c; border-radius: 8px; padding: 10px 14px; cursor:pointer; transition: transform .05s ease, box-shadow .15s ease, background-color .15s ease, border-color .15s ease; display:inline-flex; align-items:center; justify-content:center; }
.btn-danger:hover { background: #991b1b; box-shadow: 0 6px 18px rgba(185,28,28,0.25); }
.btn-danger:active { transform: translateY(1px) scale(0.995); background:#7f1d1d; box-shadow: 0 2px 10px rgba(185,28,28,0.2); }
.btn-danger:focus-visible { outline:none; box-shadow: 0 0 0 4px rgba(239,68,68,0.25); }
.danger-input { width: 100%; background: var(--bg-tertiary); color: var(--text-primary); border: 1px solid var(--border-color); border-radius: 8px; padding: 10px; margin-top: 8px; } 

#profile-danger .dashboard-card { max-width: 960px; margin: 0 auto var(--spacing-lg); }
#profile-danger .dashboard-card .card-content { padding: var(--spacing-lg); } 

.btn-sm { padding: 6px 10px; border-radius: 8px; font-size: 12.5px; } 

/* Profile grid layout */
.profile-grid { display:grid; grid-template-columns: 160px 1fr; gap: var(--spacing-xl); align-items: start; }
.profile-avatar { display:flex; flex-direction: column; gap: 8px; }
.profile-fields { display:flex; flex-direction: column; gap: var(--spacing-md); }

/* Button sizes */
.btn-md { padding: 10px 14px; font-size: 0.95rem; }
.btn-lg { padding: 12px 16px; font-size: 1rem; }

@media (max-width: 800px) {
  .profile-grid { grid-template-columns: 1fr; gap: var(--spacing-lg); }
} 

/* Subscription top bar - REMOVED DUPLICATE */ 

/* Fixed subscription top bar above header */
.topbar-fixed { position: fixed; top: 0; left: 0; right: 0; z-index: 1200; border-radius: 0; }
/* When topbar is present, push navbar and content down */
body.has-topbar .navbar { top: 44px; }
body.has-topbar .main-content { margin-top: calc(70px + 44px); }
/* Remove previous fallback to avoid double spacing */
.topbar-fixed + .navbar { margin-top: 0; }
/* Topbar visuals: dark background, amber text, amber button */
.topbar-warning { background: #0f172a; border-bottom: 1px solid #1f2937; }

/* Hide subscription topbar by default for members */
.topbar-warning.hidden-by-default {
    display: none !important;
}

/* Disabled button styles with tooltip */
.btn-primary.disabled,
.btn-secondary.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: var(--bg-tertiary) !important;
    color: var(--text-secondary) !important;
    border-color: var(--border-color) !important;
    position: relative; /* Required for tooltip positioning */
}

.btn-primary.disabled:hover,
.btn-secondary.disabled:hover {
    background-color: var(--bg-tertiary) !important;
    color: var(--text-secondary) !important;
    border-color: var(--border-color) !important;
    transform: none !important;
}

/* Simple tooltip for disabled buttons */
.btn-primary[title]:hover::after,
.btn-secondary[title]:hover::after {
    content: attr(title);
    position: absolute;
    background: #1F2937;
    color: #E5E7EB;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: normal;
    max-width: 250px;
    word-wrap: break-word;
    text-align: center;
    z-index: 1000;
    border: 1px solid #374151;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    pointer-events: none;
    
    /* Smart positioning - try bottom first, then top if not enough space */
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 8px;
}

/* For topbar buttons, show tooltip below instead of above */
.topbar-actions .btn-primary[title]:hover::after {
    bottom: auto;
    top: 100%;
    margin-bottom: 0;
    margin-top: 8px;
}

.btn-primary[title]:hover::before,
.btn-secondary[title]:hover::before {
    content: '';
    position: absolute;
    border: 4px solid transparent;
    z-index: 1000;
    pointer-events: none;
    
    /* Default arrow pointing up (for tooltip above) */
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-top-color: #1F2937;
    margin-bottom: 4px;
}

/* For topbar buttons, arrow pointing down (for tooltip below) */
.topbar-actions .btn-primary[title]:hover::before {
    bottom: auto;
    top: 100%;
    border-top-color: transparent;
    border-bottom-color: #1F2937;
    margin-bottom: 0;
    margin-top: 4px;
}
.topbar-inner { display:flex; align-items:center; justify-content: space-between; padding: 10px 16px; color:#f59e0b; }
.topbar-inner span { color:#f59e0b; display:flex; align-items:center; gap:8px; font-weight:700; }
.topbar-actions .btn-primary { 
    background: #f59e0b; 
    border-color: #f59e0b; 
    color:#0b1220; 
    box-shadow:none; 
    position: relative; /* Required for tooltip positioning */
}
.topbar-actions .btn-primary:hover { filter: brightness(1.05); }
.topbar-actions .btn-primary:active { filter: brightness(0.97); } 

/* Help & Support redesign */
.help-hero { background: linear-gradient(135deg, rgba(59,130,246,0.12), rgba(17,24,39,0.6)); border:1px solid var(--border-color); border-radius: 12px; padding: var(--spacing-xl); margin-bottom: var(--spacing-md); }
.help-hero h1 { margin: 0 0 6px 0; }
.help-hero-actions { display:flex; gap: 10px; margin-top: 8px; }

.help-grid { display:grid; grid-template-columns: repeat(4, 1fr); gap: var(--spacing-md); margin-bottom: var(--spacing-md); }
.help-card { display:flex; gap:12px; align-items:center; padding: var(--spacing-md); border:1px solid var(--border-color); background: var(--bg-card); border-radius: 12px; color: var(--text-primary); text-decoration:none; transition: border .15s, transform .15s; }
.help-card i { color:#93C5FD; font-size: 1.1rem; }
.help-card:hover { border-color: rgba(59,130,246,0.5); transform: translateY(-1px); }
.help-card h4 { margin:0; }
.help-card p { margin: 2px 0 0; color: var(--text-secondary); }

.faq-columns { display:grid; grid-template-columns: repeat(2, 1fr); gap: var(--spacing-md); }
#help .card-header i { margin-right: 8px; color:#93C5FD; }
#help details { background: rgba(255,255,255,0.02); border:1px solid var(--border-color); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; }
#help summary { cursor: pointer; font-weight: 600; }
#help summary::-webkit-details-marker { display:none; }

@media (max-width: 1000px) {
  .help-grid { grid-template-columns: repeat(2, 1fr); }
  .faq-columns { grid-template-columns: 1fr; }
} 

/* Help Center (new) */
.help-center { display: grid; gap: var(--spacing-xl); }
.help-hero-new { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 12px; padding: calc(var(--spacing-xl) + 4px); display: grid; gap: 14px; }
.help-hero-new h1 { font-size: 2.25rem; margin: 0; }
.help-hero-sub { color: var(--text-secondary); }
.help-searchbar { display:flex; align-items:center; gap:10px; background: #0b1220; border:1px solid var(--border-color); padding: 10px 14px; border-radius: 10px; }
.help-searchbar i { color: var(--text-muted); }
.help-searchbar input { flex:1; background: transparent; border:none; outline: none; color: var(--text-primary); font-size: 0.95rem; }
.help-actions { display:flex; gap:8px; justify-content:center; }

/* Single column centered */
.help-layout { display:grid; grid-template-columns: 1fr; }
.help-main { display:grid; gap: var(--spacing-md); max-width: 960px; margin: 0 auto; width: 100%; }
.help-panel { }
.help-panel .card-content { padding-top: 6px; }
.help-accordion details { border-bottom: 1px solid var(--border-light); padding: 10px 0; }
.help-accordion summary { cursor: pointer; font-weight: 600; list-style: none; }
.help-accordion p { color: var(--text-secondary); margin-top: 8px; }

/* Remove sidebar styles (no longer used) */
.help-sidebar, .help-sidebar-group { display: none; }

/* Refined contact card */
.help-contact { max-width: 960px; margin: var(--spacing-md) auto 0; }
.help-contact .card-header h3 { display:flex; align-items:center; gap:8px; }
.help-contact code { padding: 4px 8px; background: rgba(255,255,255,0.04); border: 1px solid var(--border-color); border-radius: 6px; }

.contact-row { display:flex; align-items:center; justify-content: space-between; gap:12px; flex-wrap:wrap; }
.contact-left { display:flex; align-items:center; gap:8px; }
.contact-right { display:flex; gap:8px; }

@media (max-width: 1024px) {
  .help-main { max-width: 100%; }
} 

/* Help section polish */
#help .dashboard-card { background: #0b1220; border-color: #141e2f; }
#help .card-header h3 { font-size: 1.15rem; font-weight: 800; letter-spacing: -0.01em; }
#help .card-header i { color:#93C5FD; }

/* Accordion: container and rows */
#help .help-accordion details { background: #0d1526; border: 1px solid #1c2a41; border-radius: 12px; margin-bottom: 12px; overflow: hidden; transition: border-color .15s ease, background .15s ease; }
#help .help-accordion details:hover { border-color: rgba(59,130,246,0.4); }
#help .help-accordion summary { display:flex; align-items:center; justify-content: space-between; gap: 12px; padding: 14px 16px; cursor: pointer; font-size: 1.05rem; font-weight: 700; color: #e5e7eb; list-style: none; }
#help .help-accordion summary::-webkit-details-marker { display:none; }
#help .help-accordion summary:focus-visible { outline: 2px solid rgba(59,130,246,.6); outline-offset: 2px; border-radius: 10px; }
/* Chevron */
#help .help-accordion summary::after { content: "\25BC"; /* ▼ */ color: #7aa2ff; font-size: .9rem; transition: transform .2s ease; }
#help .help-accordion details[open] summary::after { transform: rotate(180deg); }
/* Body */
#help .help-accordion details > *:not(summary) { padding: 12px 16px 14px; background: #0b1220; border-top: 1px solid #1c2a41; color: #9ca3af; }
#help .help-accordion p { margin: 0; }

/* Buttons inside help: stronger, no underline */
#help .btn-primary, #help a.btn-primary { text-decoration: none !important; background: linear-gradient(135deg, #1e3a8a, #1d4ed8); border-color: rgba(29,78,216,0.7); color: #e5e7eb; box-shadow: 0 6px 16px -8px rgba(30,58,138,0.6); }
#help .btn-primary:hover { filter: brightness(1.05); }
#help .btn-secondary, #help a.btn-secondary { text-decoration: none !important; background: rgba(255,255,255,0.04); border-color: #1f2a3c; color: #c7d2fe; }
#help .btn-secondary:hover { background: rgba(255,255,255,0.07); color: #e5e7eb; border-color: rgba(59,130,246,0.35); }

/* Contact layout tweaks */
.help-contact .contact-row { align-items: center; }
.help-contact .contact-right .btn-primary, .help-contact .contact-right .btn-secondary { height: 38px; } 

/* Help section – subtle dark overrides */
#help .card-header i { color: #9ca3af; }
#help .dashboard-card { background: #0b1220; border-color: #161f2e; }
#help .help-accordion details { background: #0d1520; border-color: #223045; }
#help .help-accordion details:hover { border-color: #2a3650; }
#help .help-accordion summary:focus-visible { outline-color: #2a3650; }
#help .help-accordion summary::after { color: #a1a1aa; }
#help .help-accordion details > *:not(summary) { background: #0b101a; border-top-color: #223045; color: #9ca3af; }

#help .btn-primary, #help a.btn-primary { text-decoration: none !important; background: linear-gradient(135deg, #151c28, #1e293b); border-color: #273244; color:#e5e7eb; box-shadow: none; }
#help .btn-primary:hover { background: linear-gradient(135deg, #171f2c, #202f45); }
#help .btn-secondary, #help a.btn-secondary { text-decoration: none !important; background: rgba(255,255,255,0.03); border-color:#273244; color:#cbd5e1; }
#help .btn-secondary:hover { background: rgba(255,255,255,0.05); border-color:#2a3650; color:#e5e7eb; }

#help .help-subtitle { margin: 14px 0 8px; padding-top: 6px; color: #a3a3a3; font-size: .85rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; border-top: 1px solid #1f2a3c; }

/* Billing layout polish */
#billing .dashboard-card + .dashboard-card { margin-top: var(--spacing-md); }
#billing .table-container { padding-top: 8px; }
#billing .data-table { width: 100%; border-collapse: separate; border-spacing: 0; }
#billing .data-table th, #billing .data-table td { padding: 10px 12px; }
#billing .card-content > div { margin-bottom: 4px; }

/* Upcoming invoice breakdown */
.upcoming-breakdown-list {
  margin-top: 8px;
  padding: 10px 12px;
  background: var(--card-bg, #111827);
  border: 1px solid var(--border-color, #1f2937);
  border-radius: 8px;
}
.upcoming-breakdown-list .breakdown-period {
  font-size: 12px;
  color: var(--muted, #9ca3af);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin: 6px 0 4px;
}
.upcoming-breakdown-list .breakdown-row,
.upcoming-breakdown-list .breakdown-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  border-top: 1px dashed var(--border-color, #1f2937);
}
.upcoming-breakdown-list .breakdown-row:first-of-type {
  border-top: none;
}
.upcoming-breakdown-list .breakdown-desc { color: var(--text, #e5e7eb); }
.upcoming-breakdown-list .breakdown-amt { font-weight: 600; }
.upcoming-breakdown-list .breakdown-total { font-weight: 700; }

/* Email sending wizard (Company Information) */
.email-card { background: var(--bg-tertiary); border:1px solid var(--border-color); border-radius:12px; padding:14px; display:grid; gap:14px; }
.email-card-head { display:flex; justify-content:space-between; align-items:center; }
.email-card .title { font-weight:600; color: var(--text-primary); letter-spacing:.01em; }
.pill { padding:4px 10px; border-radius:999px; font-size:12px; }
.pill-neutral { background: rgba(148,163,184,.15); color:#94a3b8; border:1px solid rgba(148,163,184,.25); }
.pill.success { background: rgba(34,197,94,.15); color:#22c55e; border:1px solid rgba(34,197,94,.25); }
.pill.warning { background: rgba(250,204,21,.15); color:#facc15; border:1px solid rgba(250,204,21,.25); }
.email-row { display:grid; grid-template-columns:28px 1fr; gap:12px; align-items:flex-start; }
.email-step { width:28px; height:28px; border-radius:50%; background: var(--bg-primary); color:#fff; display:flex; align-items:center; justify-content:center; font-weight:700; font-size:12px; margin-top:2px; border:1px solid var(--border-color); }
.email-content input[type="email"] { width:100%; background: var(--bg-primary); color: var(--text-primary); border:1px solid var(--border-color); border-radius:8px; padding:10px 12px; }
.email-label { font-weight:600; color: var(--text-primary); display:block; margin-bottom:6px; }
.muted { color: var(--text-secondary); font-size:12px; }
.dns-table { display:grid; gap:6px; }
.dns-head, .dns-item { display:grid; grid-template-columns:70px 1fr 1fr 60px; gap:10px; align-items:center; }
.dns-head { color: var(--text-secondary); font-size:12px; }
.dns-item code { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; display:inline-block; max-width:100%; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size:12px; }
.btn-xs { padding:6px 8px; border:1px solid var(--border-color); background: var(--bg-primary); color: var(--text-primary); border-radius:6px; cursor:pointer; font-size:12px; }
.email-actions { display:flex; gap:10px; align-items:center; }

/* Status Select (inline lead status control) */
.status-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background: transparent;
    border: 1px solid var(--border-light);
    color: var(--text-primary);
    padding: 4px 28px 4px 10px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    cursor: pointer;
    position: relative;
}

.status-select:focus {
    outline: none;
    border-color: rgba(59,130,246,0.4);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}

/* Dropdown caret */
.status-select {
    background-image: linear-gradient(45deg, transparent 50%, #93C5FD 50%), linear-gradient(135deg, #93C5FD 50%, transparent 50%);
    background-position: calc(100% - 14px) calc(1em + 2px), calc(100% - 9px) calc(1em + 2px);
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
}

/* Per-status coloring consistent with .status-badge */
.status-select.new {
    background-color: rgba(59,130,246,0.12);
    border-color: rgba(59,130,246,0.35);
    color: #E3F2FF;
}

.status-select.contacted {
    background-color: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.25);
    color: #FCD34D;
}

.status-select.qualified {
    background-color: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.25);
    color: #6EE7B7;
}

.status-select.proposal_sent {
    background-color: rgba(99, 102, 241, 0.12);
    border-color: rgba(99, 102, 241, 0.25);
    color: #A5B4FC;
}

.status-select.closed_won {
    background-color: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.25);
    color: #34D399;
}

.status-select.closed_lost {
    background-color: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.25);
    color: #FCA5A5;
}

/* Options dropdown: keep readable on dark backgrounds */
.status-select option {
    color: var(--text-primary);
    background: var(--bg-primary);
}

/* Generic List styles for detail modals (used by Simulations in Lead view) */
.list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
}

.list-header {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr 1fr auto;
    gap: 12px;
    padding: 8px 12px;
    color: var(--text-secondary);
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.list-row {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: 10px;
}

.list-row:hover {
    border-color: rgba(59,130,246,0.35);
    background: rgba(59,130,246,0.04);
}

.list-cell { min-width: 0; }

.list-title { color: var(--text-primary); font-weight: 700; }
.list-sub { color: var(--text-secondary); font-size: 0.85rem; margin-top: 2px; }

.metric { color: var(--text-primary); font-weight: 800; font-size: 0.95rem; }
.metric-sub { color: var(--text-secondary); font-size: 0.75rem; margin-top: 2px; }

.list-actions { text-align: right; white-space: nowrap; }

/* Responsive collapse for small screens */
@media (max-width: 720px) {
    .list-header { display: none; }
    .list-row {
        grid-template-columns: 1fr auto;
        row-gap: 6px;
    }
    .list-cell:nth-child(2),
    .list-cell:nth-child(3),
    .list-cell:nth-child(4) { display: none; }
}

/* Permission-based UI restrictions */
.disabled {
    opacity: 0.6;
    cursor: not-allowed !important;
    background-color: rgba(107, 114, 128, 0.1) !important;
    border-color: rgba(107, 114, 128, 0.2) !important;
}

.disabled:hover {
    background-color: rgba(107, 114, 128, 0.1) !important;
    border-color: rgba(107, 114, 128, 0.2) !important;
}

.disabled:focus {
    outline: none !important;
    box-shadow: none !important;
}

/* Read-only notices */
.read-only-notice {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 16px;
    padding: 12px 16px;
    border-radius: 8px;
    border-left: 4px solid;
}

.read-only-notice i {
    font-size: 16px;
}

/* Permission-specific notice styles */
.read-only-notice.info {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    border-left-color: #3b82f6;
}

.read-only-notice.warning {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
    border-left-color: #f59e0b;
}

.read-only-notice.error {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border-left-color: #ef4444;
}

/* Disabled form elements */
input:disabled,
select:disabled,
textarea:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: rgba(107, 114, 128, 0.1);
    border-color: rgba(107, 114, 128, 0.2);
    color: rgba(107, 114, 128, 0.8);
}

input:disabled::placeholder,
select:disabled::placeholder,
textarea:disabled::placeholder {
    color: rgba(107, 114, 128, 0.5);
}

/* Disabled buttons */
button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: rgba(107, 114, 128, 0.1) !important;
    border-color: rgba(107, 114, 128, 0.2) !important;
    color: rgba(107, 114, 128, 0.8) !important;
}

button:disabled:hover {
    background-color: rgba(107, 114, 128, 0.1) !important;
    border-color: rgba(107, 114, 128, 0.2) !important;
    color: rgba(107, 114, 128, 0.8) !important;
    transform: none !important;
}

/* Hidden elements */
.hidden-by-permission {
    display: none !important;
}

/* Permission indicators */
.permission-indicator {
    position: relative;
}

.permission-indicator::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #ef4444;
    border: 2px solid #1f2937;
}

.permission-indicator.read-only::after {
    background-color: #3b82f6;
}

.permission-indicator.warning::after {
    background-color: #f59e0b;
}

/* Tooltip for disabled elements - REMOVED DUPLICATE */

/* Section headers with permission status */
.section-header-with-permissions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.permission-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 500;
}

.permission-status.read-only {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.permission-status.restricted {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.permission-status.hidden {
    background: rgba(107, 114, 128, 0.1);
    color: #6b7280;
}

/* Quote System Styles */
.quote-modal {
    background: #f8f9fa;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    margin-top: 80px;
    max-height: calc(100vh - 160px);
    overflow-y: auto;
    border: 1px solid #dee2e6;
}

.quote-modal .modal-header {
    background: #3b82f6;
    border-bottom: 1px solid #2563eb;
    padding: 16px 20px;
    border-radius: 12px 12px 0 0;
    position: sticky;
    top: 0;
    z-index: 10;
}

.quote-modal .modal-header h3 {
    color: #ffffff;
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.quote-modal .modal-content {
    padding: 20px;
    background: #f8f9fa;
}

.quote-section {
    margin-bottom: 16px;
    padding: 16px;
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.quote-section h4 {
    margin: 0 0 12px 0;
    color: #1f2937;
    font-size: 15px;
    font-weight: 600;
}

.quote-header-section {
    background: #dbeafe;
    border: 1px solid #93c5fd;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}

/* Main Quote Section with 3 Columns */
.quote-main-section {
    margin-bottom: 16px;
}

.quote-columns {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.quote-column {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 16px;
    border: 1px solid #e9ecef;
}

.quote-column h4 {
    margin: 0 0 16px 0;
    color: #1f2937;
    font-size: 15px;
    font-weight: 600;
    padding-bottom: 8px;
    border-bottom: 2px solid #3b82f6;
}

.quote-items-container {
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.quote-items-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.quote-items-table th {
    background: #f3f4f6;
    color: #374151;
    font-weight: 600;
    padding: 12px;
    text-align: left;
    border-bottom: 2px solid #e5e7eb;
}

.quote-items-table td {
    padding: 12px;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: top;
}

.quote-items-table tbody tr:hover {
    background: #f9fafb;
}

.quote-items-table input,
.quote-items-table textarea {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    background: #ffffff;
    color: #1f2937;
    font-size: 13px;
}

.quote-items-table input:focus,
.quote-items-table textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.quote-items-table .quantity-input {
    width: 60px;
    text-align: center;
}

.quote-items-table .price-input {
    width: 100px;
    text-align: right;
}

.quote-items-table .total-cell {
    text-align: right;
    font-weight: 600;
    color: #1f2937;
}

.quote-totals {
    background: #f9fafb;
}

.quote-totals td {
    padding: 12px;
    border-bottom: 1px solid #e5e7eb;
    color: #374151;
}

.quote-totals .text-right {
    text-align: right;
}

.total-row {
    background: #3b82f6;
    color: white;
}

.total-row td {
    color: white;
    font-weight: 700;
    font-size: 14px;
}

.total-row span {
    color: white;
}

.quote-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding: 16px 0;
    border-top: 1px solid #e5e7eb;
    margin-top: 16px;
}

.quote-actions button {
    min-width: 100px;
    padding: 8px 16px;
    font-size: 14px;
}

.btn-remove-item {
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 11px;
    transition: background-color 0.2s;
    min-width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-remove-item:hover {
    background: #dc2626;
}

.btn-remove-item i {
    font-size: 10px;
}

/* Style spécifique pour le bouton VAT */
.quote-totals .btn-remove-item {
    background: #6b7280;
    color: white;
    border: none;
    border-radius: 3px;
    padding: 3px 6px;
    cursor: pointer;
    font-size: 10px;
    transition: background-color 0.2s;
    min-width: 20px;
    height: 20px;
}

.quote-totals .btn-remove-item:hover {
    background: #4b5563;
}

/* Quote Preview Styles */
.quote-preview-modal {
    background: white;
    color: #333;
}

.quote-preview-content {
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.quote-preview-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e5e7eb;
}

.quote-preview-header h1 {
    color: #1f2937;
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 8px 0;
}

.quote-preview-header .quote-number {
    color: #6b7280;
    font-size: 16px;
    font-weight: 500;
}

.quote-preview-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.quote-preview-customer,
.quote-preview-installer {
    background: #f9fafb;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.quote-preview-customer h3,
.quote-preview-installer h3 {
    color: #1f2937;
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 16px 0;
}

.quote-preview-customer p,
.quote-preview-installer p {
    margin: 8px 0;
    color: #374151;
    line-height: 1.5;
}

.quote-preview-installation {
    margin-bottom: 40px;
}

.quote-preview-installation h3 {
    color: #1f2937;
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 16px 0;
}

.quote-preview-installation p {
    color: #374151;
    line-height: 1.6;
    margin: 0;
}

.quote-preview-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 40px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

.quote-preview-table th {
    background: #3b82f6;
    color: white;
    font-weight: 600;
    padding: 16px;
    text-align: left;
}

.quote-preview-table td {
    padding: 16px;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: top;
}

.quote-preview-table tbody tr:nth-child(even) {
    background: #f9fafb;
}

.quote-preview-table .text-right {
    text-align: right;
}

.quote-preview-table .total-row {
    background: #1f2937;
    color: white;
    font-weight: 700;
}

.quote-preview-table .total-row td {
    color: white;
}

.quote-preview-payment {
    margin-bottom: 40px;
}

.quote-preview-payment h3 {
    color: #1f2937;
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 16px 0;
}

.quote-preview-payment ul {
    margin: 0;
    padding-left: 20px;
    color: #374151;
    line-height: 1.6;
}

.quote-preview-payment li {
    margin-bottom: 8px;
}

.quote-preview-terms {
    margin-bottom: 40px;
}

.quote-preview-terms h3 {
    color: #1f2937;
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 16px 0;
}

.quote-preview-terms p {
    color: #374151;
    line-height: 1.6;
    margin: 0;
}

.quote-preview-signature {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-top: 60px;
    padding-top: 40px;
    border-top: 2px solid #e5e7eb;
}

.quote-preview-signature .signature-box {
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 20px;
    min-height: 120px;
}

.quote-preview-signature .signature-box h4 {
    color: #1f2937;
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 16px 0;
}

.quote-preview-signature .signature-line {
    border-bottom: 1px solid #d1d5db;
    height: 40px;
    margin-top: 20px;
}

.preview-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    padding: 20px 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .quote-modal {
        width: 98%;
        margin: 10px;
        margin-top: 60px;
    }
    
    .quote-columns {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 16px;
    }
    
    .quote-column {
        padding: 12px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .quote-preview-info {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .quote-preview-signature {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .quote-preview-content {
        padding: 20px;
    }
    
    .quote-actions {
        flex-direction: column;
        gap: 8px;
    }
    
    .quote-actions button {
        width: 100%;
    }
    
    /* Compact mobile styling */
    .quote-section {
        padding: 12px;
        margin-bottom: 12px;
    }
    
    .quote-header-section {
        padding: 12px;
        margin-bottom: 12px;
    }
    
    .form-group {
        margin-bottom: 8px;
    }
    
    .form-group label {
        font-size: 11px;
        margin-bottom: 2px;
    }
    
    .form-group input,
    .form-group textarea {
        padding: 5px 8px;
        font-size: 12px;
    }
    
    .quote-items-table {
        font-size: 11px;
    }
    
    .quote-items-table th,
    .quote-items-table td {
        padding: 6px 8px;
    }
    
    .quote-items-table input,
    .quote-items-table textarea {
        padding: 4px 6px;
        font-size: 11px;
    }
    
    .quote-items-table .quantity-input {
        width: 50px;
    }
    
    .quote-items-table .price-input {
        width: 80px;
    }
}

/* Form styles */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

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

.form-group {
    margin-bottom: 12px;
}

.form-group label {
    display: block;
    margin-bottom: 4px;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 600;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #ffffff;
    color: #1f2937;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* VAT rate input styling */
#vat-rate {
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 3px;
    color: #1f2937;
    font-weight: 600;
    text-align: center;
}

#vat-rate:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Compact form styling */
.quote-modal .form-group {
    margin-bottom: 10px;
}

.quote-modal .form-group label {
    margin-bottom: 3px;
    font-size: 12px;
    color: var(--text-primary);
    font-weight: 600;
}

.quote-modal .form-group input,
.quote-modal .form-group textarea {
    padding: 6px 10px;
    font-size: 13px;
    background: #ffffff;
    color: #1f2937;
    border: 1px solid #d1d5db;
}

.quote-modal .form-group textarea {
    resize: vertical;
    min-height: 60px;
}

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

.section-header-with-actions h4 {
    margin: 0;
    color: #1f2937;
    font-weight: 600;
}

/* Quote Modal Specific Button Styles */
.quote-modal .btn-primary {
    background: #3b82f6;
    color: #ffffff;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    font-size: 14px;
}

.quote-modal .btn-primary:hover {
    background: #2563eb;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.quote-modal .btn-secondary {
    background: #6b7280;
    color: #ffffff;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    font-size: 14px;
}

.quote-modal .btn-secondary:hover {
    background: #4b5563;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

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

/* Quote PDF Preview Styles - Professional A4 Format */
.quote-pdf-container {
    background: white;
    color: #000;
    font-family: 'Arial', sans-serif;
    line-height: 1.2;
    width: 210mm; /* A4 width */
    min-height: 297mm; /* A4 height */
    margin: 0 auto;
    padding: 15mm;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    box-sizing: border-box;
}

/* Preview Modal Specific Styles */
.quote-preview-modal .modal {
    max-width: 250mm; /* Slightly larger than A4 to accommodate margins */
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
    background: white;
}

.quote-preview-modal .modal-content {
    padding: 0;
    background: white;
}

#quote-preview-content {
    background: white;
    padding: 0;
    margin: 0;
}

#quote-preview-content .quote-pdf-container {
    box-shadow: none;
    margin: 0;
    padding: 20mm;
    width: 210mm;
    min-height: 297mm;
    background: white;
}

/* Header */
.quote-pdf-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
    border-bottom: 1px solid #3b82f6;
    padding-bottom: 10px;
}

.quote-pdf-logo h1 {
    font-size: 24px;
    font-weight: bold;
    color: #1f2937;
    margin: 0 0 5px 0;
}

.company-slogan {
    font-size: 14px;
    color: #6b7280;
    font-style: italic;
    margin: 0;
}

.quote-pdf-details {
    text-align: right;
}

.quote-number-box h2 {
    font-size: 28px;
    font-weight: bold;
    color: #3b82f6;
    margin: 0 0 10px 0;
    text-transform: uppercase;
}

.quote-number {
    font-size: 18px;
    font-weight: bold;
    color: #1f2937;
    margin: 5px 0;
}

.quote-date, .quote-validity {
    font-size: 12px;
    color: #6b7280;
    margin: 2px 0;
}

/* Info Section */
.quote-pdf-info-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 15px;
}

.quote-pdf-company, .quote-pdf-customer {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
    border-left: 4px solid #3b82f6;
}

.quote-pdf-company h3, .quote-pdf-customer h3 {
    font-size: 16px;
    font-weight: bold;
    color: #1f2937;
    margin: 0 0 10px 0;
    text-transform: uppercase;
}

.quote-pdf-company p, .quote-pdf-customer p {
    margin: 5px 0;
    font-size: 13px;
    color: #374151;
}

/* Installation Description */
.quote-pdf-installation {
    margin-bottom: 30px;
    padding: 15px;
    background: #f0f9ff;
    border-radius: 5px;
    border-left: 4px solid #0ea5e9;
}

.quote-pdf-installation h3 {
    font-size: 16px;
    font-weight: bold;
    color: #1f2937;
    margin: 0 0 10px 0;
    text-transform: uppercase;
}

.quote-pdf-installation p {
    margin: 0;
    font-size: 14px;
    color: #374151;
}

/* Table */
.quote-pdf-table-container {
    margin-bottom: 30px;
}

.quote-pdf-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.quote-pdf-table th {
    background: #3b82f6;
    color: white;
    padding: 12px 8px;
    text-align: left;
    font-weight: bold;
    border: 1px solid #2563eb;
}

.quote-pdf-table td {
    padding: 10px 8px;
    border: 1px solid #e5e7eb;
    vertical-align: top;
}

.quote-pdf-table tbody tr:nth-child(even) {
    background: #f9fafb;
}

.quote-pdf-table tbody tr:hover {
    background: #f3f4f6;
}

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

.text-right {
    text-align: right;
}

/* Totals */
.quote-pdf-totals {
    margin-bottom: 30px;
}

.quote-pdf-totals-table {
    width: 300px;
    margin-left: auto;
    border-collapse: collapse;
    font-size: 14px;
}

.quote-pdf-totals-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #e5e7eb;
}

.total-label {
    font-weight: 600;
    color: var(--text-primary);
}

.total-value {
    text-align: right;
    font-weight: 600;
    color: #1f2937;
}

.total-final {
    border-top: 2px solid #3b82f6 !important;
    background: #f0f9ff;
}

.total-final .total-label,
.total-final .total-value {
    font-weight: bold;
    font-size: 16px;
    color: #1f2937;
}

/* Payment Terms */
.quote-pdf-payment {
    margin-bottom: 30px;
    padding: 15px;
    background: #fef3c7;
    border-radius: 5px;
    border-left: 4px solid #f59e0b;
}

.quote-pdf-payment h3 {
    font-size: 16px;
    font-weight: bold;
    color: #1f2937;
    margin: 0 0 10px 0;
    text-transform: uppercase;
}

.payment-terms {
    font-size: 13px;
    color: #374151;
    line-height: 1.5;
}

/* Terms and Notes */
.quote-pdf-terms, .quote-pdf-notes {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 5px;
    border-left: 4px solid #6b7280;
}

.quote-pdf-terms h3, .quote-pdf-notes h3 {
    font-size: 16px;
    font-weight: bold;
    color: #1f2937;
    margin: 0 0 10px 0;
    text-transform: uppercase;
}

.quote-pdf-terms p, .quote-pdf-notes p {
    font-size: 13px;
    color: #374151;
    margin: 0;
    line-height: 1.5;
}

/* Signature Section */
.quote-pdf-signature {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin: 40px 0;
}

.signature-box {
    text-align: center;
    padding: 20px;
    border: 2px solid #e5e7eb;
    border-radius: 5px;
    background: #f9fafb;
}

.signature-box h4 {
    font-size: 14px;
    font-weight: bold;
    color: #1f2937;
    margin: 0 0 15px 0;
    text-transform: uppercase;
}

.signature-line {
    height: 2px;
    background: #374151;
    margin: 20px 0;
}

.signature-box p {
    font-size: 12px;
    color: #6b7280;
    margin: 5px 0;
}

.signature-note {
    font-weight: bold;
    color: #1f2937 !important;
    margin-top: 10px !important;
}

/* Footer */
.quote-pdf-footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
    text-align: center;
    font-size: 11px;
    color: #6b7280;
}

.quote-pdf-footer p {
    margin: 5px 0;
}

/* Print Styles */
@media print {
    .quote-pdf-container {
        box-shadow: none;
        margin: 0;
        padding: 15mm;
        max-width: none;
    }
    
    .quote-pdf-header {
        page-break-inside: avoid;
    }
    
    .quote-pdf-table {
        page-break-inside: avoid;
    }
    
    .quote-pdf-signature {
        page-break-inside: avoid;
    }
    
    /* Ensure proper page breaks */
    .quote-pdf-container > div {
        page-break-inside: avoid;
    }
}

/* Responsive adjustments for preview */
@media (max-width: 768px) {
    .quote-pdf-container {
        padding: 10mm;
        margin: 10px;
        width: auto;
        min-height: auto;
    }
    
    .quote-pdf-info-section {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .quote-pdf-signature {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .quote-pdf-totals-table {
        width: 100%;
    }
    
    .quote-preview-modal .modal {
        width: 98%;
        max-width: none;
    }
}

/* Ensure proper display in preview modal */
.quote-preview-modal {
    background: rgba(0, 0, 0, 0.5);
}

.quote-preview-modal .modal {
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.preview-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding: 20px;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
}

/* Status dropdown menu */
.status-dropdown {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 180px;
    animation: dropdownFadeIn 0.2s ease;
}

.status-dropdown-content {
    padding: var(--spacing-sm);
}

.status-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-sm);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background-color 0.2s ease;
    margin-bottom: 2px;
}

.status-option:hover {
    background: var(--bg-tertiary);
}

.status-option.current {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.current-indicator {
    color: var(--primary-color);
    font-weight: bold;
    font-size: 0.8rem;
}

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

/* Logo upload specific styles */
.logo-actions label.btn-secondary {
    opacity: 1 !important;
    cursor: pointer !important;
    background-color: transparent !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
    transition: all 0.2s ease;
}

.logo-actions label.btn-secondary:hover {
    background-color: var(--bg-tertiary) !important;
    border-color: rgba(59, 130, 246, 0.35) !important;
    transform: translateY(-1px);
}

.logo-actions label.btn-secondary:active {
    transform: translateY(0);
}

/* Disabled button styles */
.btn.disabled,
button.disabled,
.btn-primary.disabled,
.btn-secondary.disabled {
    opacity: 0.6;
    cursor: not-allowed !important;
    background-color: var(--bg-tertiary) !important;
    color: var(--text-secondary) !important;
    border-color: var(--border-color) !important;
    pointer-events: auto; /* Allow hover for tooltip */
}

.btn.disabled:hover,
button.disabled:hover,
.btn-primary.disabled:hover,
.btn-secondary.disabled:hover {
    opacity: 0.6;
    transform: none !important;
    background-color: var(--bg-tertiary) !important;
    color: var(--text-secondary) !important;
    border-color: var(--border-color) !important;
}

/* Team Section Specific Styles */
#team .dashboard-card {
    margin-bottom: var(--spacing-lg);
}

#team .dashboard-card:last-of-type {
    margin-bottom: 0;
}

/* Team invite form spacing */
#team-invite-form {
    display: flex;
    gap: var(--spacing-md);
    align-items: center;
    flex-wrap: wrap;
}

#team-invite-form .filter-input {
    flex: 1;
    min-width: 200px;
}

#team-invite-form .filter-select {
    min-width: 120px;
}

#team-invite-form .btn-primary {
    white-space: nowrap;
}

/* Team table improvements */
#team .table-container {
    margin-top: var(--spacing-md);
}

#team .data-table th:last-child,
#team .data-table td:last-child {
    text-align: right;
    width: 120px;
}

/* Action buttons styling */
.action-buttons {
    display: flex;
    gap: var(--spacing-sm);
    justify-content: flex-end;
    align-items: center;
}

.action-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: var(--spacing-xs);
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
}

.action-btn:hover {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

.action-btn.edit {
    color: var(--primary-color);
}

.action-btn.edit:hover {
    background-color: rgba(59, 130, 246, 0.1);
}

.action-btn.delete {
    color: var(--danger-color);
}

.action-btn.delete:hover {
    background-color: rgba(239, 68, 68, 0.1);
}

.action-btn.resend {
    color: var(--accent-color);
}

.action-btn.resend:hover {
    background-color: rgba(245, 158, 11, 0.1);
}

.action-btn.cancel {
    color: var(--text-muted);
}

.action-btn.cancel:hover {
    background-color: var(--bg-tertiary);
    color: var(--text-secondary);
}

/* Status badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-badge.active {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

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

/* Role badges */
.role-badge {
    display: inline-flex;
    align-items: center;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: capitalize;
}

.role-badge.owner {
    background-color: rgba(59, 130, 246, 0.1);
    color: var(--primary-color);
}

.role-badge.admin {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.role-badge.member {
    background-color: rgba(156, 163, 175, 0.1);
    color: var(--text-secondary);
}

/* Empty state improvements */
.empty-state {
    text-align: center;
    padding: var(--spacing-2xl) var(--spacing-lg);
    color: var(--text-muted);
}

.empty-state i {
    font-size: 2rem;
    margin-bottom: var(--spacing-md);
    opacity: 0.5;
}

.empty-state h3 {
    margin-bottom: var(--spacing-sm);
    color: var(--text-secondary);
}

.empty-state p {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #team-invite-form {
        flex-direction: column;
        align-items: stretch;
    }
    
    #team-invite-form .filter-input,
    #team-invite-form .filter-select,
    #team-invite-form .btn-primary {
        width: 100%;
    }
    
    .action-buttons {
        flex-direction: column;
        gap: var(--spacing-xs);
    }
    
    .action-btn {
        width: 24px;
        height: 24px;
    }
}