/* Reset and Base Styles */
    * { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; }
    body { background: radial-gradient(circle at top left, #0c0e24, #02030a 80%); color: #ffffff; display: flex; height: 100vh; overflow: hidden; }
    
    /* Gradients & Colors */
    .text-gradient { background: linear-gradient(90deg, #4ba3ff, #ff57d8); -webkit-background-clip: text; -webkit-text-fill-color: transparent; text-shadow: 0px 2px 10px rgba(255, 87, 216, 0.2); }
    .bg-gradient { background: linear-gradient(90deg, #4ba3ff, #ff57d8); color: white; border: none; transition: 0.3s; box-shadow: 0 4px 15px rgba(255, 87, 216, 0.3); }
    .bg-gradient:hover { box-shadow: 0 6px 20px rgba(255, 87, 216, 0.6); transform: translateY(-2px); }

    /* High-Gloss Glassmorphism */
    .glass-panel { background: rgba(10, 15, 30, 0.45); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); border: 1px solid rgba(255, 255, 255, 0.05); border-top: 1px solid rgba(255, 255, 255, 0.15); border-left: 1px solid rgba(255, 255, 255, 0.1); box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.05); }

    /* Sidebar Styles */
    .sidebar { width: 250px; height: 100%; padding: 20px 0; display: flex; flex-direction: column; z-index: 1000; background: rgba(5, 7, 15, 0.6); backdrop-filter: blur(20px); border-right: 1px solid rgba(255, 255, 255, 0.08); }
    .agent-title { padding: 0 20px; font-size: 24px; font-weight: 900; margin-bottom: 30px; letter-spacing: 1px; word-break: break-all; }
    .menu-group { margin-bottom: 25px; }
    .menu-title { padding: 0 20px; font-size: 14px; font-weight: bold; margin-bottom: 10px; color: #7a7d94; text-transform: uppercase; letter-spacing: 1px; }
    .menu-item { padding: 12px 20px; display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 15px; transition: 0.3s; color: #d1d1d1; text-decoration: none; }
    .menu-item:hover, .menu-item.active { color: #ffffff; background: rgba(255, 87, 216, 0.1); border-right: 3px solid #ff57d8; }
    .menu-item.active { border-left: 3px solid #ff57d8; border-right: none; background-color: rgba(255, 87, 216, 0.15); font-weight: bold; }
    .logout { margin-top: auto; }

    /* Main Content Styles - Using Flex Column for easy layout reordering */
    .main-content { flex: 1; padding: 30px; overflow-y: auto; position: relative; display: flex; flex-direction: column; }
    .order-header { order: 1; }
    .order-controls { order: 2; }
    .order-metrics-top { order: 3; }
    .order-leads { order: 4; }
    .order-map { order: 5; }
    .order-metrics-bottom { order: 6; }

    .top-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
    .dashboard-title { display: flex; align-items: center; gap: 10px; font-size: 32px; font-weight: bold; font-style: italic; }
    .menu-toggle { font-size: 30px; cursor: pointer; display: none; transition: 0.2s; text-shadow: 0 2px 10px rgba(255,87,216,0.5); }
    .menu-toggle:hover { color: #ff57d8; }
    .controls-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; }
    .subtitle { color: #9ba0b5; font-size: 14px; font-style: italic; text-transform: uppercase; letter-spacing: 1px; }
    .actions { display: flex; gap: 15px; align-items: center; }
    .search-bar { border-radius: 20px; display: flex; align-items: center; padding: 8px 15px; border: 1px solid rgba(255, 87, 216, 0.4); background: rgba(0, 0, 0, 0.4); box-shadow: inset 0 2px 5px rgba(0,0,0,0.5); }
    .search-bar input { background: transparent; border: none; color: white; outline: none; width: 150px; font-size: 14px; }
    .search-bar input::placeholder { color: #7a7d94; }
    .btn-add { padding: 10px 22px; border-radius: 20px; font-weight: bold; cursor: pointer; display: flex; align-items: center; gap: 5px; font-size: 14px; }

    /* Summary Grids */
    .summary-grid { display: grid; gap: 20px; margin-bottom: 30px; }
    .top-grid { grid-template-columns: repeat(4, 1fr); }
    .bottom-grid { grid-template-columns: repeat(3, 1fr); margin-top: 30px; }
    .summary-card { border-radius: 12px; padding: 20px; display: flex; align-items: center; gap: 15px; transition: 0.3s; position: relative; }
    .summary-card:hover { border-color: rgba(255, 87, 216, 0.5); box-shadow: 0 8px 25px rgba(0,0,0,0.5), 0 0 10px rgba(255,87,216,0.2); transform: translateY(-3px); }
    .summary-icon { font-size: 28px; width: 45px; height: 45px; display: flex; justify-content: center; align-items: center; border-radius: 10px; background: rgba(0,0,0,0.4); border: 1px solid rgba(255,255,255,0.05); }
    .summary-info { flex: 1; display: flex; flex-direction: column; }
    .summary-title { font-size: 11px; font-weight: bold; color: #9ba0b5; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 3px; }
    .summary-value { font-size: 26px; font-weight: bold; line-height: 1; margin-bottom: 3px; }
    .summary-sub { font-size: 11px; color: #7a7d94; }
    .summary-chevron { position: absolute; right: 20px; font-size: 18px; color: #7a7d94; transition: 0.2s; }
    .summary-card:hover .summary-chevron { color: #ff57d8; transform: translateX(3px); }

    /* Section Styles */
    .section-container { border-radius: 16px; padding: 25px; margin-bottom: 30px; }
    .section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; flex-wrap: wrap; gap: 10px; }
    .section-title { font-size: 20px; font-style: italic; font-weight: bold; letter-spacing: 1px; color: #4ba3ff; }
    .section-controls { display: flex; gap: 10px; }
    .dropdown-btn, .details-btn { background-color: rgba(0, 0, 0, 0.5); color: #ffffff; border: 1px solid rgba(255,255,255,0.15); padding: 8px 15px; border-radius: 15px; cursor: pointer; font-size: 13px; backdrop-filter: blur(10px); outline: none; transition: 0.3s; }
    .dropdown-btn:hover { border-color: rgba(255,255,255,0.3); background-color: rgba(0, 0, 0, 0.7); }
    .dropdown-btn option { background-color: #0c0e24; color: white; }
    .details-btn { background: linear-gradient(90deg, #8760ff, #ff57d8); border: none; box-shadow: 0 2px 10px rgba(255, 87, 216, 0.3); }

    /* Empty States */
    .empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%; padding: 40px; text-align: center; }
    .empty-icon { font-size: 50px; margin-bottom: 15px; opacity: 0.6; filter: drop-shadow(0 0 10px rgba(255,87,216,0.3)); }
    .empty-title { font-size: 18px; font-weight: bold; margin-bottom: 5px; color: #ffffff; }
    .empty-sub { font-size: 13px; color: #7a7d94; }

    /* Leads Scroll List */
    .leads-list { display: flex; gap: 20px; overflow-x: auto; padding-bottom: 20px; padding-top: 5px; scrollbar-width: thin; scrollbar-color: #ff57d8 rgba(0,0,0,0.3); scroll-behavior: smooth; min-height: 180px; }
    .leads-list::-webkit-scrollbar { height: 8px; }
    .leads-list::-webkit-scrollbar-track { background: rgba(0,0,0,0.3); border-radius: 4px; box-shadow: inset 0 1px 3px rgba(0,0,0,0.5); }
    .leads-list::-webkit-scrollbar-thumb { background: linear-gradient(90deg, #4ba3ff, #ff57d8); border-radius: 4px; }
    .lead-card { border-radius: 14px; padding: 18px; min-width: 320px; display: flex; gap: 15px; position: relative; cursor: pointer; transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s; }
    .lead-card:hover { transform: translateY(-8px); box-shadow: 0 15px 30px rgba(0, 0, 0, 0.6), 0 0 15px rgba(255, 87, 216, 0.3); border-color: rgba(255, 87, 216, 0.5); }
    .lead-media-section { display: flex; flex-direction: column; gap: 10px; width: 85px; flex-shrink: 0; }
    .lead-img-placeholder { width: 100%; height: 85px; background: linear-gradient(180deg, #e0e0e0 60%, #8bc34a 40%); border-radius: 10px; box-shadow: inset 0 0 10px rgba(0,0,0,0.5), 0 4px 10px rgba(0,0,0,0.4); background-size: cover; background-position: top center; background-repeat: no-repeat; }
    .lead-action-btns { display: flex; flex-direction: column; gap: 8px; width: 100%; }
    .card-btn { background: linear-gradient(90deg, #8760ff, #ff57d8); border: none; color: white; border-radius: 15px; padding: 6px; font-size: 11px; font-weight: bold; cursor: pointer; width: 100%; box-shadow: 0 3px 8px rgba(0,0,0,0.4); transition: 0.2s; }
    .card-btn:hover { transform: scale(1.05); }
    .lead-info { flex: 1; }
    .lead-status { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: bold; margin-bottom: 5px; text-shadow: 0 1px 3px rgba(0,0,0,0.8); }
    .business-name { font-size: 13px; color: #e0e0e0; margin-bottom: 15px; font-weight: 500; }
    .google-rating { font-size: 12px; margin-bottom: 5px; color: #9ba0b5; }
    .rating-score { font-size: 22px; font-weight: bold; display: flex; align-items: center; gap: 5px; }
    .date-visited { font-size: 11px; color: #7a7d94; margin-top: 20px; font-style: italic; }
    .status-icon-large { position: absolute; bottom: 10px; right: 15px; font-size: 45px; opacity: 0.5; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5)); }

    /* Map Embedded Container */
    .map-wrapper { width: 100%; height: 350px; border-radius: 12px; overflow: hidden; border: 1px solid rgba(255, 255, 255, 0.1); border-top: 1px solid rgba(255, 255, 255, 0.2); box-shadow: 0 10px 30px rgba(0,0,0,0.5); }
    .map-wrapper iframe { width: 100%; height: 100%; border: none; }

    /* Modal / Popup Styles */
    .modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.85); display: none; justify-content: center; align-items: center; z-index: 2000; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
    .modal-content { padding: 35px; border-radius: 18px; width: 600px; max-width: 95%; max-height: 90vh; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #ff57d8 rgba(0,0,0,0.4); }
    .modal-title { margin-bottom: 25px; font-size: 26px; font-weight: bold; }
    .form-group { margin-bottom: 18px; }
    .form-group label { display: block; margin-bottom: 8px; font-size: 14px; color: #d1d1d1; font-weight: 500; }
    .form-group input, .form-group select, .form-group textarea { width: 100%; padding: 12px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.15); background-color: rgba(0, 0, 0, 0.5); color: white; font-family: inherit; outline: none; transition: 0.3s; box-shadow: inset 0 2px 4px rgba(0,0,0,0.4); }
    .form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: #ff57d8; background-color: rgba(0, 0, 0, 0.7); box-shadow: inset 0 2px 4px rgba(0,0,0,0.4), 0 0 8px rgba(255, 87, 216, 0.3); }
    .form-group input::placeholder, .form-group textarea::placeholder { color: #7a7d94; }
    .form-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 30px; }
    .btn-cancel { background: rgba(255, 255, 255, 0.05); color: white; border: 1px solid rgba(255,255,255,0.2); padding: 10px 22px; border-radius: 20px; cursor: pointer; transition: 0.3s; font-weight: 500; }
    .btn-cancel:hover { background: rgba(255, 255, 255, 0.15); border-color: rgba(255,255,255,0.4); }
    .btn-submit { padding: 10px 22px; border-radius: 20px; cursor: pointer; font-weight: bold; border: none; }
    
    .data-table { width: 100%; border-collapse: collapse; margin-top: 15px; }
    .data-table th, .data-table td { padding: 14px 10px; text-align: left; border-bottom: 1px solid rgba(255,255,255,0.08); font-size: 14px; }
    .data-table th { color: #4ba3ff; font-weight: bold; text-transform: uppercase; letter-spacing: 1px; font-size: 12px; }
    .data-table tr:hover { background-color: rgba(255, 255, 255, 0.03); }
    
    .notification-msg, .note-item { background: rgba(0, 0, 0, 0.5); padding: 18px; border-radius: 12px; border-left: 4px solid #4ba3ff; margin-bottom: 15px; border-top: 1px solid rgba(255,255,255,0.05); border-right: 1px solid rgba(255,255,255,0.05); border-bottom: 1px solid rgba(255,255,255,0.05); box-shadow: 0 4px 10px rgba(0,0,0,0.3); }
    .note-item { border-left-color: #ff57d8; }
    .note-meta { font-size: 12px; color: #9ba0b5; margin-bottom: 8px; font-style: italic; }
    .create-links { display: flex; flex-direction: column; gap: 15px; }
    .create-link-btn { display: block; padding: 16px; border-radius: 12px; text-align: center; text-decoration: none; font-weight: bold; font-size: 16px; border: 1px solid rgba(255, 87, 216, 0.3); transition: 0.3s; letter-spacing: 0.5px; }
    .create-link-btn:hover { background: rgba(255, 87, 216, 0.15); transform: translateY(-2px); box-shadow: 0 5px 15px rgba(255, 87, 216, 0.2); border-color: rgba(255, 87, 216, 0.6); }

    /* Responsive Mobile Design */
    @media (max-width: 1024px) {
        .top-grid { grid-template-columns: repeat(2, 1fr); }
        .bottom-grid { grid-template-columns: repeat(2, 1fr); }
    }
    
    /* Order shifting for 900px */
    @media (max-width: 900px) {
        .menu-toggle { display: block; }
        .sidebar { position: fixed; left: -280px; width: 280px; background: rgba(5, 7, 15, 0.95); transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1); box-shadow: 5px 0 25px rgba(0,0,0,0.7); }
        .sidebar.active { left: 0; }
        .controls-row { flex-direction: column; align-items: flex-start; gap: 20px; }
        .actions { width: 100%; justify-content: space-between; }
        .search-bar input { width: 130px; }
        .dashboard-title { font-size: 24px; }
        
        /* Layout Reorder */
        .order-metrics-top { order: 5; margin-bottom: 0; }
        .order-metrics-bottom { order: 6; margin-top: 15px; }
        .order-leads { order: 3; }
        .order-map { order: 4; }
    }
    
    /* Ultimate Condensed Mobile Layout */
    @media (max-width: 600px) {
        .main-content { padding: 20px 15px; }
        
        /* Condensing the summary cards into an app-tile grid */
        .summary-grid { gap: 12px; margin-bottom: 0; }
        .top-grid { grid-template-columns: repeat(2, 1fr); }
        .bottom-grid { grid-template-columns: repeat(2, 1fr); margin-top: 12px; margin-bottom: 25px; }
        
        .summary-card { 
            flex-direction: column; 
            text-align: center; 
            padding: 15px 10px; 
            gap: 8px;
        }
        .summary-info { align-items: center; }
        .summary-icon { font-size: 22px; width: 40px; height: 40px; }
        .summary-title { font-size: 10px; }
        .summary-value { font-size: 22px; }
        .summary-sub { display: none; } /* Hid extra text to save space */
        .summary-chevron { display: none; }
        
        /* Make the 3rd bottom card full width to fit perfectly */
        .bottom-grid .summary-card:nth-child(3) {
            grid-column: span 2;
            flex-direction: row;
            text-align: left;
        }
        .bottom-grid .summary-card:nth-child(3) .summary-info { align-items: flex-start; }
        .bottom-grid .summary-card:nth-child(3) .summary-chevron { display: block; }
        .bottom-grid .summary-card:nth-child(3) .summary-sub { display: block; }

        .actions { flex-direction: column; align-items: stretch; }
        .search-bar { width: 100%; justify-content: space-between; }
        .search-bar input { width: 100%; }
        .section-header { flex-direction: column; align-items: flex-start; margin-bottom: 10px; }
        .section-container { padding: 15px; margin-bottom: 20px; }
        .modal-content { padding: 20px; }
        .lead-card { min-width: 260px; padding: 15px; }
        .lead-img-placeholder { height: 75px; }
        .map-wrapper { height: 250px; }
    }
