/* style.css - The Lime Agency CRM Styles */

/* ============================================
   SIDEBAR LAYOUT - MUST LOAD FIRST
   ============================================ */

/* Force hide old layout immediately */
.header,
.nav,
.admin-dropdown {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    overflow: hidden !important;
    opacity: 0 !important;
}

/* Force body to use flex layout */
html, body {
    margin: 0 !important;
    padding: 0 !important;
    height: 100% !important;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif !important;
    display: flex !important;
    min-height: 100vh !important;
    background: #f9fafb !important;
}

/* NAVY BLUE SIDEBAR - PART OF PAGE FLOW */
.sidebar {
    width: 20% !important;
    min-width: 220px !important;
    max-width: 280px !important;
    background: #1e3a5f !important;
    color: white !important;
    display: flex !important;
    flex-direction: column !important;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.15) !important;
}

.sidebar-header {
    padding: 2rem 1.5rem !important;
    text-align: center !important;
    background: rgba(0, 0, 0, 0.15) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.sidebar-logo {
    width: 120px !important;
    height: 120px !important;
    margin: 0 auto 1rem !important;
    background: white !important;
    border-radius: 12px !important;
    padding: 1rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.sidebar-logo img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
}

.sidebar-title {
    font-size: 1.25rem !important;
    font-weight: 700 !important;
    margin: 0 0 0.25rem 0 !important;
    color: white !important;
}

.sidebar-subtitle {
    font-size: 0.875rem !important;
    color: rgba(255, 255, 255, 0.7) !important;
    margin: 0 !important;
}

.sidebar-nav {
    padding: 1rem 0 !important;
}

.sidebar-item-wrapper {
    position: relative !important;
}

.sidebar-item {
    display: block !important;
    padding: 0.75rem 1.5rem !important;
    color: rgba(255, 255, 255, 0.9) !important;
    text-decoration: none !important;
    cursor: pointer !important;
    border-left: 4px solid transparent !important;
    font-size: 1rem !important;
    font-weight: 500 !important;
    transition: all 0.2s ease !important;
}

.sidebar-item:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    border-left-color: #8BC34A !important;
    color: white !important;
}

.sidebar-item.active {
    background: rgba(139, 195, 74, 0.2) !important;
    border-left-color: #8BC34A !important;
    color: #8BC34A !important;
    font-weight: 600 !important;
}

/* Hide all icons except submenu toggles */
.sidebar-item i:not(.sidebar-submenu-toggle i),
.sidebar-submenu-item i,
.sidebar-user i {
    display: none !important;
}

.sidebar-item-highlight {
    background: linear-gradient(90deg, rgba(139, 195, 74, 0.3), transparent) !important;
    color: #8BC34A !important;
    font-weight: 600 !important;
}

.sidebar-item-danger {
    color: #fca5a5 !important;
}

.sidebar-item-danger:hover {
    background: rgba(239, 68, 68, 0.2) !important;
    color: #ef4444 !important;
}

.sidebar-submenu-toggle {
    position: absolute !important;
    right: 1rem !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 32px !important;
    height: 32px !important;
    padding: 0 !important;
    background: rgba(255, 255, 255, 0.1) !important;
    border: none !important;
    border-radius: 4px !important;
    color: white !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.sidebar-submenu-toggle:hover {
    background: rgba(255, 255, 255, 0.2) !important;
}

.sidebar-submenu-toggle i {
    display: block !important;
    width: 18px !important;
    height: 18px !important;
}

.sidebar-submenu {
    display: none !important;
    background: rgba(0, 0, 0, 0.2) !important;
    border-left: 4px solid rgba(139, 195, 74, 0.3) !important;
}

.sidebar-submenu-item {
    display: block !important;
    padding: 0.625rem 1.5rem 0.625rem 2.5rem !important;
    color: rgba(255, 255, 255, 0.8) !important;
    text-decoration: none !important;
    font-size: 0.9375rem !important;
    transition: all 0.2s !important;
}

.sidebar-submenu-item:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #8BC34A !important;
}

.sidebar-submenu-item.active {
    background: rgba(139, 195, 74, 0.2) !important;
    color: #8BC34A !important;
    font-weight: 600 !important;
}

.sidebar-section-header {
    color: rgba(255, 255, 255, 0.95) !important;
    font-size: 1.0625rem !important;
    font-weight: 600 !important;
    padding: 0.75rem 1.5rem 0.375rem !important;
    margin-top: 0.375rem !important;
    text-transform: none !important;
    letter-spacing: normal !important;
}

.sidebar-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
    padding: 0.5rem 0 !important;
    background: rgba(0, 0, 0, 0.15) !important;
}

.sidebar-user {
    display: block !important;
    padding: 1rem 1.5rem !important;
    color: rgba(255, 255, 255, 0.9) !important;
    font-size: 0.9375rem !important;
    font-weight: 500 !important;
    border-top: 1px solid rgba(255, 255, 255, 0.05) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
}

.mobile-menu-toggle {
    display: none !important;
}

/* FORCE main content to move right */
.main-wrapper {
    flex: 1 !important;
    padding: 2rem !important;
    background: #f9fafb !important;
    min-height: 100vh !important;
}

.main-content {
    padding: 2rem !important;
    background: white !important;
    border-radius: 12px !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
    margin: 0 auto !important;
    max-width: 1400px !important;
}

/* Override container for sidebar layout */
.main-wrapper .container {
    max-width: 100% !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Mobile */
@media (max-width: 768px) {
    body {
        flex-direction: column !important;
    }
    
    .sidebar {
        width: 100% !important;
        max-width: 100% !important;
    }
    
    .mobile-menu-toggle {
        display: none !important;
    }
    
    .main-wrapper {
        padding: 1rem !important;
    }
    
    .main-content {
        padding: 1.5rem !important;
    }
}

/* ============================================
   END SIDEBAR LAYOUT
   ============================================ */

/* Original styles below - most will be overridden */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f3f4f6;
    color: #1f2937;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Header */
.header {
    background: linear-gradient(135deg, #8BC34A 0%, #9CCC65 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

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

.logo-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo {
    font-size: 2rem;
    background: white;
    color: #8BC34A;
    width: 50px;
    height: 50px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header h1 {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.header p {
    font-size: 0.875rem;
    opacity: 0.9;
}

.user-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Navigation */
.nav {
    background: white;
    border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.nav-btn {
    padding: 1rem 1.5rem;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-weight: 500;
    color: #6b7280;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

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

.nav-btn:hover {
    color: #1f2937;
}

.nav-btn.active {
    color: #8BC34A;
    border-bottom-color: #8BC34A;
}

/* Main Content */
.main-content {
    padding: 2rem 0;
}

.tab-content {
    display: none;
}

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

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

/* Cards */
.card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 1.5rem;
}

.card h3 {
    margin-bottom: 1rem;
}

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

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

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    transition: transform 0.3s, box-shadow 0.3s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

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

.stat-card.blue .stat-icon {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
}

.stat-card.green .stat-icon {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.stat-card.purple .stat-icon {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
}

.stat-card.orange .stat-icon {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}

.stat-icon svg {
    width: 24px;
    height: 24px;
}

.stat-content {
    flex: 1;
}

.stat-content h3 {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0 0 0.5rem 0;
    font-weight: 500;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: bold;
    margin: 0 0 0.5rem 0;
    color: #1f2937;
}

.stat-change {
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin: 0;
}

.stat-change.positive {
    color: #10b981;
}

.stat-change.negative {
    color: #ef4444;
}

.stat-change svg {
    width: 14px;
    height: 14px;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
}

/* Time Selector */
.time-selector {
    display: flex;
    gap: 0.5rem;
    background: #f9fafb;
    padding: 0.25rem;
    border-radius: 8px;
}

.time-btn {
    padding: 0.5rem 1rem;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    color: #6b7280;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

.time-btn:hover {
    color: #1f2937;
    background: rgba(139, 195, 74, 0.1);
}

.time-btn.active {
    background: white;
    color: #8BC34A;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

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

.card-header-flex h3 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-header-flex h3 svg {
    width: 20px;
    height: 20px;
    color: #8BC34A;
}

.text-link {
    font-size: 0.875rem;
    color: #8BC34A;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.text-link:hover {
    color: #7CB342;
}

/* Chart Legend */
.chart-legend {
    display: flex;
    gap: 1.5rem;
    font-size: 0.875rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

/* Activity Widget */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.activity-item {
    display: flex;
    gap: 1rem;
    padding: 0.75rem;
    background: #f9fafb;
    border-radius: 8px;
    transition: background 0.3s;
}

.activity-item:hover {
    background: #f3f4f6;
}

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

.activity-icon svg {
    width: 20px;
    height: 20px;
    color: white;
}

.activity-icon.blue { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.activity-icon.green { background: linear-gradient(135deg, #10b981, #059669); }
.activity-icon.purple { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }
.activity-icon.orange { background: linear-gradient(135deg, #f59e0b, #d97706); }

.activity-content {
    flex: 1;
}

.activity-content strong {
    display: block;
    color: #1f2937;
    margin-bottom: 0.25rem;
}

.activity-content p {
    margin: 0;
    color: #6b7280;
    font-size: 0.875rem;
}

.activity-time {
    font-size: 0.75rem;
    color: #9ca3af;
    display: block;
    margin-top: 0.25rem;
}

/* Campaign Widget */
.campaign-widget {
    padding: 1rem;
    background: #f9fafb;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.campaign-widget:last-child {
    margin-bottom: 0;
}

.campaign-metrics {
    display: flex;
    gap: 1rem;
    margin: 0.75rem 0;
    font-size: 0.75rem;
    color: #6b7280;
}

.metric-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.metric-item svg {
    width: 14px;
    height: 14px;
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: #8BC34A;
    border-radius: 3px;
    transition: width 0.6s ease;
}

/* Pipeline Stage Widget */
.pipeline-stage-widget {
    padding: 1rem;
    background: #f9fafb;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.pipeline-stage-widget:last-child {
    margin-bottom: 0;
}

/* List Items */
.list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: #f9fafb;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

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

.data-table th {
    background: #f9fafb;
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #e5e7eb;
}

.data-table td {
    padding: 1rem 0.75rem;
    border-bottom: 1px solid #e5e7eb;
}

.data-table tr:hover {
    background: #f9fafb;
}

/* Buttons */
.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: #1f2937;
    background: #e5e7eb;
}

.btn svg {
    width: 16px;
    height: 16px;
}

.btn:hover {
    background: #d1d5db;
    transform: translateY(-1px);
}

.btn-primary {
    background: #8BC34A;
    color: white;
}

.btn-primary:hover {
    background: #7CB342;
}

.btn-small {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

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

/* Integration Icons */
.integration-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.integration-icon svg {
    width: 24px;
    height: 24px;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    background: #e5e7eb;
    color: #6b7280;
}

.badge svg {
    width: 12px;
    height: 12px;
}

.badge-blue { background: #dbeafe; color: #1e40af; }
.badge-green { background: #dcfce7; color: #16a34a; }
.badge-purple { background: #f3e8ff; color: #7e22ce; }
.badge-yellow { background: #fef3c7; color: #d97706; }

/* Pipeline */
.pipeline {
    display: flex;
    gap: 1rem;
    overflow-x: visible;
    padding-bottom: 1rem;
}

.pipeline-column {
    flex: 1;
    min-width: 180px;
    max-width: 280px;
    background: #f9fafb;
    border-radius: 8px;
    padding: 0.875rem;
}

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

.pipeline-header h3 {
    font-size: 0.9375rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pipeline-value {
    font-size: 0.8125rem;
    color: #6b7280;
    margin-bottom: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pipeline-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 0.625rem;
    margin-bottom: 0.625rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    font-size: 0.875rem;
}

.pipeline-card strong {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pipeline-card p {
    margin: 0;
    color: #6b7280;
    font-size: 0.8125rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pipeline-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
    font-size: 0.8125rem;
}

/* Lost Column Styling */
.pipeline-column-lost {
    background: #fef2f2 !important;
    border: 2px dashed #ef4444 !important;
}

.pipeline-column-lost .pipeline-header h3 {
    color: #dc2626;
}

.pipeline-column-lost .pipeline-card {
    border-color: #fca5a5;
    background: #fff5f5;
}

/* Drag and Drop States */
.pipeline-card[draggable="true"] {
    cursor: move;
    transition: opacity 0.2s, box-shadow 0.2s;
}

.pipeline-card[draggable="true"]:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.pipeline-column.drag-over {
    background: #dcfce7;
    border: 2px dashed #8BC34A;
}

/* Lost Reason Modal Radio Styling */
#lostReasonModal label:hover {
    border-color: #8BC34A !important;
    background: #f9fafb;
}

#lostReasonModal input[type="radio"]:checked + span {
    color: #8BC34A;
    font-weight: 600;
}

#lostReasonModal input[type="radio"]:checked {
    accent-color: #8BC34A;
}

/* Campaigns Grid */
.campaigns-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

/* Accounting */
.accounting-nav {
    margin-bottom: 1.5rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.accounting-view {
    display: none;
}

.accounting-view.active {
    display: block;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid #e5e7eb;
}

.summary-item.total {
    border-top: 2px solid #e5e7eb;
    font-weight: 600;
    margin-top: 0.5rem;
}

.summary-item.final {
    border-top: 3px solid #1f2937;
    font-size: 1.125rem;
    padding: 1rem 0;
    margin-top: 1rem;
}

.summary-item.green { background: #dcfce7; padding: 0.75rem; border-radius: 4px; }
.summary-item.red { background: #fee2e2; padding: 0.75rem; border-radius: 4px; }
.summary-item.blue { background: #dbeafe; padding: 0.75rem; border-radius: 4px; border-bottom: none; }

.info-box {
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 1rem;
    margin: 1rem 0;
}

.info-box h4 {
    margin-bottom: 0.5rem;
}

.info-box ul {
    margin-left: 1.5rem;
}

.contractor-1099 {
    display: flex;
    justify-content: space-between;
    align-items: start;
    padding: 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.amount-1099 {
    font-size: 1.5rem;
    font-weight: bold;
    color: #16a34a;
}

/* Integrations */
.integrations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.integration-card {
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid #e5e7eb;
}

.integration-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.12);
}

.integration-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #f3f4f6;
}

/* Login Page */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #8BC34A 0%, #9CCC65 100%);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 1rem;
}

.login-box {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header .logo {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.login-header h1 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: #1f2937;
}

.login-header p {
    color: #6b7280;
    font-size: 0.875rem;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #374151;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 1rem;
}

.form-group input:focus {
    outline: none;
    border-color: #8BC34A;
    box-shadow: 0 0 0 3px rgba(139, 195, 74, 0.1);
}

.error-message {
    background: #fee2e2;
    color: #dc2626;
    padding: 0.75rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.login-hint {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.875rem;
    color: #6b7280;
}

/* Responsive */
@media (max-width: 1400px) {
    .pipeline-column {
        min-width: 150px;
    }
    
    .pipeline-header h3 {
        font-size: 0.875rem;
    }
    
    .pipeline-card {
        font-size: 0.8125rem;
    }
}

@media (max-width: 1024px) {
    .pipeline {
        overflow-x: auto;
    }
    
    .pipeline-column {
        flex: 0 0 200px;
        min-width: 200px;
    }
}

@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .pipeline {
        flex-direction: column;
        overflow-x: visible;
    }
    
    .pipeline-column {
        flex: 1;
        max-width: 100%;
        min-width: auto;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .nav-btn {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }
}

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

.modal {
    display: none;
    position: fixed !important;
    z-index: 99999 !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background-color: rgba(0, 0, 0, 0.5) !important;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s;
    overflow-y: auto;
}

.modal[style*="display: flex"] {
    display: flex !important;
}

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

.modal-content {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.1);
    animation: slideIn 0.3s;
    position: relative;
    margin: auto;
}

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

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: #1f2937;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: #6b7280;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.3s;
}

.modal-close:hover {
    background: #f3f4f6;
    color: #1f2937;
}

.modal-content form {
    padding: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

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

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #374151;
    font-size: 0.875rem;
}

.required {
    color: #ef4444;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 1rem;
    transition: all 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #8BC34A;
    box-shadow: 0 0 0 3px rgba(139, 195, 74, 0.1);
}

.modal-footer {
    border-top: 1px solid #e5e7eb;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

.btn-secondary {
    background: #6b7280;
    color: white;
}

.btn-secondary:hover {
    background: #4b5563;
}

/* Table Action Buttons */
.action-buttons {
    display: flex;
    gap: 0.5rem;
}

.btn-icon {
    padding: 0.5rem;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-edit {
    background: #dbeafe;
    color: #2563eb;
}

.btn-edit:hover {
    background: #2563eb;
    color: white;
}

.btn-delete {
    background: #fee2e2;
    color: #dc2626;
}

.btn-delete:hover {
    background: #dc2626;
    color: white;
}

/* Success Alert */
.success-alert {
    animation: slideInRight 0.3s;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ===================================
   ADMIN PANEL STYLES
   =================================== */

.btn-icon-only {
    padding: 0.5rem;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.admin-tabs {
    display: flex;
    gap: 0.5rem;
    padding: 1.5rem 1.5rem 0 1.5rem;
    border-bottom: 2px solid #e5e7eb;
}

.admin-tab-btn {
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-weight: 500;
    color: #6b7280;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.admin-tab-btn:hover {
    color: #1f2937;
    background: #f9fafb;
}

.admin-tab-btn.active {
    color: #8BC34A;
    border-bottom-color: #8BC34A;
    background: #f0f7e8;
}

.admin-tab-content {
    display: none;
    padding: 2rem;
}

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

.admin-tab-content h4 {
    margin-bottom: 1.5rem;
    color: #1f2937;
    font-size: 1.25rem;
}

/* Badge Variations */
.badge-orange {
    background: #fed7aa;
    color: #c2410c;
}

.badge-gray {
    background: #e5e7eb;
    color: #4b5563;
}

.badge-green {
    background: #dcfce7;
    color: #166534;
}

/* Stats Grid for Integrations */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

/* Custom Field Drag Handle (for future sorting) */
.drag-handle {
    cursor: move;
    color: #9ca3af;
}

.drag-handle:hover {
    color: #4b5563;
}

/* Form Elements in Modals */
.form-group input[type="checkbox"] {
    width: auto;
    margin-right: 0.5rem;
}

.form-group small {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.875rem;
}

/* Password Strength Indicator (future enhancement) */
.password-strength {
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    margin-top: 0.5rem;
    overflow: hidden;
}

.password-strength-bar {
    height: 100%;
    transition: all 0.3s;
}

.strength-weak { background: #ef4444; width: 33%; }
.strength-medium { background: #f59e0b; width: 66%; }
.strength-strong { background: #10b981; width: 100%; }

/* Responsive Admin Panel */
@media (max-width: 768px) {
    .admin-tabs {
        flex-direction: column;
        gap: 0;
    }
    
    .admin-tab-btn {
        border-bottom: none;
        border-left: 3px solid transparent;
        justify-content: flex-start;
    }
    
    .admin-tab-btn.active {
        border-bottom: none;
        border-left-color: #8BC34A;
    }
    
    .modal-content {
        max-width: 95% !important;
    }
}

/* ===================================
   SUPER AGGRESSIVE MODAL STYLES
   =================================== */

/* Force modal to work even with conflicts */
#adminModal,
#leadModal,
#customFieldModal {
    box-sizing: border-box !important;
    -webkit-box-sizing: border-box !important;
}

#adminModal[style*="display: flex"],
#adminModal[style*="display:flex"] {
    display: flex !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 999999 !important;
    background-color: rgba(0, 0, 0, 0.5) !important;
    align-items: center !important;
    justify-content: center !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    overflow-y: auto !important;
    padding: 1rem !important;
}

#adminModal .modal-content,
#leadModal .modal-content,
#customFieldModal .modal-content {
    position: relative !important;
    z-index: 999999 !important;
    display: block !important;
    margin: auto !important;
}

/* Ensure modal is above EVERYTHING */
body > #adminModal {
    position: fixed !important;
    z-index: 2147483647 !important; /* Maximum z-index value */
}

/* ===================================
   SEMI-TRANSPARENT MODAL VARIATIONS
   =================================== */

/* If you want MORE transparent (more see-through): */
/*
.modal-content {
    background-color: rgba(255, 255, 255, 0.85) !important;
}
*/

/* If you want LESS transparent (more solid): */
/*
.modal-content {
    background-color: rgba(255, 255, 255, 0.98) !important;
}
*/

/* For a darker semi-transparent background: */
/*
.modal-content {
    background-color: rgba(240, 240, 240, 0.95) !important;
}
*/

/* For colored tinted glass effect: */
/*
.modal-content {
    background-color: rgba(139, 195, 74, 0.15) !important;
    backdrop-filter: blur(20px) brightness(1.1);
}
*/

/* ===================================
   ADMIN DROPDOWN MENU
   =================================== */

.admin-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    z-index: 9999;
    overflow: hidden;
    animation: dropdownSlide 0.2s ease-out;
}

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

.admin-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem;
    color: #1f2937;
    text-decoration: none;
    transition: background-color 0.2s;
    border-bottom: 1px solid #f3f4f6;
    font-size: 0.9375rem;
}

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

.admin-dropdown-item:hover {
    background-color: #f9fafb;
    color: #8BC34A;
}

.admin-dropdown-item:active {
    background-color: #f3f4f6;
}

.admin-dropdown-item i {
    color: #6b7280;
    flex-shrink: 0;
}

.admin-dropdown-item:hover i {
    color: #8BC34A;
}

/* Arrow pointer on top */
.admin-dropdown::before {
    content: '';
    position: absolute;
    top: -6px;
    right: 12px;
    width: 12px;
    height: 12px;
    background: white;
    transform: rotate(45deg);
    box-shadow: -2px -2px 4px rgba(0, 0, 0, 0.05);
}
/* ===================================
   LEFT SIDEBAR NAVIGATION - FIXED
   =================================== */

/* Reset body layout */
body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    display: flex;
    min-height: 100vh;
    background: #f9fafb;
}

/* Sidebar container - Part of page flow */
.sidebar {
    width: 20%;
    min-width: 220px;
    max-width: 280px;
    background: #1e3a5f;
    color: white;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
}

/* Sidebar header with logo */
.sidebar-header {
    padding: 2rem 1.5rem;
    text-align: center;
    background: rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-logo {
    width: 120px;
    height: 120px;
    margin: 0 auto 1rem;
    background: white;
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.sidebar-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 0.25rem 0;
    color: white;
    line-height: 1.3;
}

.sidebar-subtitle {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
    font-weight: 400;
}

/* Navigation section */
.sidebar-nav {
    padding: 1rem 0;
}

/* Menu item wrapper (for items with submenus) */
.sidebar-item-wrapper {
    position: relative;
}

/* Sidebar menu item - NO ICONS */
.sidebar-item {
    display: block;
    padding: 1rem 1.5rem;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    border-left: 4px solid transparent;
    font-size: 1rem;
    font-weight: 500;
    position: relative;
}

.sidebar-item:hover {
    background: rgba(255, 255, 255, 0.1);
    border-left-color: #8BC34A;
    color: white;
}

.sidebar-item.active {
    background: rgba(139, 195, 74, 0.2);
    border-left-color: #8BC34A;
    color: #8BC34A;
    font-weight: 600;
}

/* Hide icon elements */
.sidebar-item i,
.sidebar-submenu-item i {
    display: none !important;
}

/* Highlighted item (AI Agent) */
.sidebar-item-highlight {
    background: linear-gradient(90deg, rgba(139, 195, 74, 0.3), transparent);
    color: #8BC34A !important;
    font-weight: 600;
}

.sidebar-item-highlight:hover {
    background: linear-gradient(90deg, rgba(139, 195, 74, 0.4), transparent);
}

/* Danger item (Logout) */
.sidebar-item-danger {
    color: #fca5a5 !important;
}

.sidebar-item-danger:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444 !important;
}

/* Submenu toggle button */
.sidebar-submenu-toggle {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    padding: 0;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 4px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.sidebar-submenu-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
}

.sidebar-submenu-toggle i {
    display: block !important;
    width: 18px;
    height: 18px;
    transition: transform 0.2s;
}

/* Submenu */
.sidebar-submenu {
    display: none;
    background: rgba(0, 0, 0, 0.2);
    border-left: 4px solid rgba(139, 195, 74, 0.3);
}

.sidebar-submenu-item {
    display: block;
    padding: 0.875rem 1.5rem 0.875rem 2.5rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.2s;
    font-size: 0.9375rem;
    font-weight: 400;
}

.sidebar-submenu-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #8BC34A;
}

/* Sidebar footer */
.sidebar-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.5rem 0;
    background: rgba(0, 0, 0, 0.1);
}

.sidebar-user {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9375rem;
    font-weight: 500;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-user i {
    display: none !important;
}

/* Mobile menu toggle */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1100;
    width: 48px;
    height: 48px;
    background: #8BC34A;
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.mobile-menu-toggle i {
    width: 24px;
    height: 24px;
}

/* Main content wrapper - Flex item */
.main-wrapper {
    flex: 1;
    padding: 2rem;
    background: #f9fafb;
    min-height: 100vh;
}

.main-content {
    padding: 2rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin: 0 auto;
    max-width: 1400px;
}

/* Container adjustment */
.container {
    max-width: 100%;
    width: 100%;
    padding: 0;
    margin: 0;
}

/* Mobile responsive */
@media (max-width: 768px) {
    body {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        max-width: 100%;
    }
    
    .main-wrapper {
        padding: 1rem;
    }
    
    .main-content {
        padding: 1.5rem;
    }
}

/* Hide old header/nav styles */
.header,
.nav {
    display: none !important;
}

.admin-dropdown {
    display: none !important;
}
/* ===================================
   COMPLETE SIDEBAR RESET - FORCE WORKING
   =================================== */

/* Force body layout */
html, body {
    margin: 0 !important;
    padding: 0 !important;
    height: 100% !important;
    overflow-x: hidden !important;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}

/* FORCE sidebar to appear as navy blue box */
.sidebar {
    position: fixed !important;
    left: 0 !important;
    top: 0 !important;
    width: 280px !important;
    height: 100vh !important;
    background: #1e3a5f !important;
    color: white !important;
    z-index: 10000 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.15) !important;
}

/* Logo section */
.sidebar-header {
    padding: 2rem 1.5rem !important;
    text-align: center !important;
    background: rgba(0, 0, 0, 0.15) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.sidebar-logo {
    width: 120px !important;
    height: 120px !important;
    margin: 0 auto 1rem !important;
    background: white !important;
    border-radius: 12px !important;
    padding: 1rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.sidebar-logo img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
}

.sidebar-title {
    font-size: 1.25rem !important;
    font-weight: 700 !important;
    margin: 0 0 0.25rem 0 !important;
    color: white !important;
}

.sidebar-subtitle {
    font-size: 0.875rem !important;
    color: rgba(255, 255, 255, 0.7) !important;
    margin: 0 !important;
}

/* Navigation */
.sidebar-nav {
    padding: 1rem 0 !important;
}

.sidebar-item-wrapper {
    position: relative !important;
}

.sidebar-item {
    display: block !important;
    padding: 1rem 1.5rem !important;
    color: rgba(255, 255, 255, 0.9) !important;
    text-decoration: none !important;
    cursor: pointer !important;
    border-left: 4px solid transparent !important;
    font-size: 1rem !important;
    font-weight: 500 !important;
    transition: all 0.2s ease !important;
}

.sidebar-item:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    border-left-color: #8BC34A !important;
    color: white !important;
}

.sidebar-item.active {
    background: rgba(139, 195, 74, 0.2) !important;
    border-left-color: #8BC34A !important;
    color: #8BC34A !important;
    font-weight: 600 !important;
}

/* Hide ALL icons */
.sidebar-item i:not(.sidebar-submenu-toggle i),
.sidebar-submenu-item i,
.sidebar-user i {
    display: none !important;
}

/* Submenu toggle */
.sidebar-submenu-toggle {
    position: absolute !important;
    right: 1rem !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 32px !important;
    height: 32px !important;
    padding: 0 !important;
    background: rgba(255, 255, 255, 0.1) !important;
    border: none !important;
    border-radius: 4px !important;
    color: white !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.sidebar-submenu-toggle:hover {
    background: rgba(255, 255, 255, 0.2) !important;
}

.sidebar-submenu-toggle i {
    display: block !important;
    width: 18px !important;
    height: 18px !important;
}

/* Submenu */
.sidebar-submenu {
    display: none !important;
    background: rgba(0, 0, 0, 0.2) !important;
    border-left: 4px solid rgba(139, 195, 74, 0.3) !important;
}

.sidebar-submenu-item {
    display: block !important;
    padding: 0.875rem 1.5rem 0.875rem 2.5rem !important;
    color: rgba(255, 255, 255, 0.8) !important;
    text-decoration: none !important;
    font-size: 0.9375rem !important;
    transition: all 0.2s !important;
}

.sidebar-submenu-item:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #8BC34A !important;
}

/* Highlighted items */
.sidebar-item-highlight {
    background: linear-gradient(90deg, rgba(139, 195, 74, 0.3), transparent) !important;
    color: #8BC34A !important;
    font-weight: 600 !important;
}

.sidebar-item-danger {
    color: #fca5a5 !important;
}

.sidebar-item-danger:hover {
    background: rgba(239, 68, 68, 0.2) !important;
    color: #ef4444 !important;
}

/* Footer */
.sidebar-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
    padding: 0.5rem 0 !important;
    background: rgba(0, 0, 0, 0.15) !important;
}

.sidebar-user {
    display: block !important;
    padding: 1rem 1.5rem !important;
    color: rgba(255, 255, 255, 0.9) !important;
    font-size: 0.9375rem !important;
    font-weight: 500 !important;
    border-top: 1px solid rgba(255, 255, 255, 0.05) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
}

/* Mobile toggle */
.mobile-menu-toggle {
    display: none !important;
    position: fixed !important;
    top: 1rem !important;
    left: 1rem !important;
    z-index: 10001 !important;
    width: 48px !important;
    height: 48px !important;
    background: #8BC34A !important;
    border: none !important;
    border-radius: 8px !important;
    color: white !important;
    cursor: pointer !important;
}

/* FORCE main content to move right */
.main-wrapper {
    margin-left: 280px !important;
    width: calc(100% - 280px) !important;
    min-height: 100vh !important;
    background: #f9fafb !important;
    padding: 0 !important;
}

.main-content {
    padding: 2rem !important;
    max-width: 100% !important;
}

.container {
    max-width: 100% !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* FORCE hide old layout */
.header,
.nav,
.admin-dropdown {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
}

/* Mobile */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%) !important;
    }
    
    .sidebar.sidebar-open {
        transform: translateX(0) !important;
    }
    
    .mobile-menu-toggle {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    .main-wrapper {
        margin-left: 0 !important;
        width: 100% !important;
    }
}
