/* === CSS For Seller Hunter (Based on Provided Styles) === */

:root {
    --primary-color: #4361ee; /* Blu primario */
    --accent-color: #facc15;  /* Giallo accento */
    --secondary-color: #6b7280; /* Grigio medio */
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;

    --bs-body-bg: #010409;
    --bs-body-color: #c9d1d9;
    --card-bg: #0d1117;
    --banner-bg: #161b22;
    --banner-text: #e6edf3;
    --menu-bg: rgba(22, 27, 34, 0.9);
    --menu-text: #c9d1d9;
    --menu-hover-bg: rgba(173, 186, 199, 0.1);
    --heading-text: #e6edf3;
    --light-text: #8b949e;
    --bs-border-color: #30363d;
    --border-color-2: #4b5563;
    --input-bg: #010409;
    --input-border: #30363d;
    --input-text: #c9d1d9;
    --input-placeholder: #6e7681;
    --bs-link-color: #60a5fa;
    --bs-link-hover-color: #82b5fb;
    --text-inverted: #111827;
    --banner-height: 80px;
    --subnav-height: 50px;
    --border-radius: 0.5rem;
    --border-radius-lg: 12px;
    --transition-speed: 0.25s;
    --transition-timing: ease-in-out;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.15);
    --shadow-md: 0 3px 5px rgba(0,0,0,0.2);
    --shadow-lg: 0 5px 15px rgba(0, 0, 0, 0.07);
}

body.light-mode {
    --primary-color: #4361ee;
    --accent-color: #f59e0b;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #3b82f6;

    --bs-body-bg: #f8f9fa;
    --bs-body-color: #212529;
    --card-bg: #ffffff;
    --banner-bg: #ffffff;
    --banner-text: #212529;
    --menu-bg: rgba(255, 255, 255, 0.9);
    --menu-text: #495057;
    --menu-hover-bg: #e9ecef;
    --heading-text: #000000;
    --light-text: #6c757d;
    --bs-border-color: #dee2e6;
    --border-color-2: #d1d5db;
    --input-bg: #ffffff;
    --input-border: #ced4da;
    --input-text: #212529;
    --input-placeholder: #6c757d;
    --bs-link-color: #0d6efd;
    --bs-link-hover-color: #0a58ca;
    --text-inverted: #333;

    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 2px 4px rgba(0,0,0,0.06);
    --shadow-lg: 0 5px 15px rgba(0, 0, 0, 0.04);
}

/* === BASE STYLES === */
* { box-sizing: border-box; margin: 0; padding: 0; font-family: "Poppins", sans-serif; }
html { height: 100%; overflow-y: hidden; }

body {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    background-color: var(--bs-body-bg);
    color: var(--bs-body-color);
    font-size: 14px;
    line-height: 1.6;
    transition: background-color var(--transition-speed), color var(--transition-speed);
}
a { color: var(--bs-link-color); text-decoration: none; transition: color var(--transition-speed); }
a:hover { text-decoration: none; color: var(--bs-link-hover-color); }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: color-mix(in srgb, var(--card-bg) 50%, transparent); }
::-webkit-scrollbar-thumb { background-color: var(--secondary-color); border-radius: 10px; border: 2px solid transparent; background-clip: content-box;}
::-webkit-scrollbar-thumb:hover { background-color: var(--primary-color); }

#authContainer.hidden, #appWrapper.hidden { display: none !important; }

/* === AUTH SCREEN STYLES === */
body.auth-active {
    background-color: #f0f2f5;
    display: flex;
    align-items: center; /* Vertically centers the content */
    justify-content: center; /* Horizontally centers the content */
    min-height: 100vh;
    padding: 20px;
}

/* (styles.css) - Replace the existing rule with this one */

#authContainer .container.auth {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    width: 100%; /* This now correctly fills its parent */
    padding: 40px;
}
/* (styles.css) - Add this new rule */

#authContainer {
    width: 100%;
    max-width: 500px; /* The container's width is now controlled here */
}
#authContainer .app-logo {
    max-width: 270px;
    margin-bottom: 25px; /* Refined spacing */
}
.logo-credit-container {
    border: 1px solid #d1d5db;
    border-radius: 8px; 
    padding: 12px; 
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 30px; 
    cursor: pointer;
    transition: background-color 0.2s ease;
}
.logo-credit-container:hover {
    background-color: #f9fafb;
}

.logo-credit-container img {
    height: 34px; /* Change from 20px */
    width: auto;
}
#authContainer .form-group {
    margin-bottom: 20px;
}

#authContainer .form-group label {
    font-weight: 600;
    font-size: 14px;
    color: #374151;
    margin-bottom: 8px;
}

#authContainer .form-group input {
    padding: 12px 15px; /* Base padding for height consistency */
    border-radius: 8px; /* Unified border radius */
    width: 100%;
    background-color: #ffffff; /* Add this line */
    border: 1px solid #d1d5db;  /* Add this line */
    color: #111827;           /* Add this line */
}
.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}
/* Ensure password input with icon has correct padding */
.password-wrapper input {
    padding-right: 40px !important;
}

.password-wrapper .toggle-password {
    position: absolute;
    right: 15px;
    color: #9ca3af;
    cursor: pointer;
}

.forgot-password-link {
    display: block;
    text-align: right;
    margin-top: -12px;
    margin-bottom: 25px; /* Refined spacing */
    font-size: 14px;
    color: #6366f1;
    font-weight: 500;
}

#authContainer .btn-full {
    width: 100%;
    padding: 12px; /* Unified padding for same height as inputs */
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px; /* Unified border radius */
}

#authContainer .switch-view {
    margin-top: 30px; /* Refined spacing */
    font-size: 15px;
    color: #6b7280;
    text-align: center;
}

#authContainer .switch-view a {
    color: #6366f1;
    font-weight: 600;
}

/* Hide unused elements from old design */
#authContainer .google-signin-btn,
#authContainer .separator,
#authContainer h1.title {
    display: none;
}
.container.auth.hidden { display: none; }
.app-logo { display: block; margin: 0 auto 30px; max-width: 170px; height: auto; }
.container.auth h1.title { font-size: 26px; font-weight: 700; text-align: center; margin-bottom: 30px; color: var(--heading-text); }
.google-signin-btn { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; padding: 12px; border: 1px solid var(--input-border); border-radius: var(--border-radius, 8px); background: var(--input-bg); color: var(--input-text); font-weight: 500; font-size: 15px; margin-bottom: 25px; cursor: pointer; transition: background-color var(--transition-speed), box-shadow var(--transition-speed); }
.google-signin-btn:hover { background-color: var(--menu-hover-bg); box-shadow: 0 2px 5px rgba(0,0,0,0.1); }
.google-signin-btn img { width: 18px; height: 18px; }
.separator { display: flex; align-items: center; color: var(--light-text); font-size: 13px; margin: 0 5px 25px; }
.separator::before, .separator::after { content: ""; flex: 1; height: 1px; background: var(--border-color-2); }
.separator span { margin: 0 15px; font-weight: 500; text-transform: uppercase; font-size: 12px; }
.form-group { margin-bottom: 22px; position: relative; }
.form-group label { display: block; font-size: 14px; font-weight: 600; color: var(--bs-body-color); margin-bottom: 8px; }
.form-group input { width: 100%; padding: 12px 15px; border: 1px solid var(--input-border); border-radius: var(--border-radius, 8px); background-color: var(--input-bg); color: var(--input-text); font-size: 15px; transition: border-color var(--transition-speed), box-shadow var(--transition-speed); }
.form-group input:focus { outline: none; border-color: var(--primary-color); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary-color) 25%, transparent); }
.btn { border-radius: 6px; padding: 0.4rem 0.9rem; font-size: 0.85rem; font-weight: 500; cursor: pointer; transition: all var(--transition-speed) ease; border: 1px solid transparent; line-height: 1.4; text-align: center; vertical-align: middle; display: inline-flex; align-items: center; justify-content: center; white-space: nowrap; }
.btn.btn-primary { background-color: var(--primary-color); color: white; }
.switch-view { text-align: center; font-size: 14px; color: var(--light-text); margin-top: 15px; }
.switch-view a { color: var(--bs-link-color); font-weight: 600; }

/* === APP SHELL STYLES === */
#appWrapper { display: flex; flex-direction: column; width: 100%; height: 100vh; overflow: hidden; }
#top-header {
    width: 100%; height: var(--banner-height); background-color: var(--banner-bg);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 1.5rem; border-bottom: 1px solid var(--bs-border-color);
    flex-shrink: 0; box-shadow: var(--shadow-sm); z-index: 1030;
}
#header-logo-img {
    height: 85px;
    width: auto;
    transform: translateY(-15px); /* Add this line to move the logo up */
}
#app-name-header { font-size: 1.5rem; font-weight: 600; color: var(--heading-text); margin-left: .5rem; }
#top-header .header-right { display: flex; align-items: center; gap: 1rem; }
.user-menu-container { position: relative; }
#profile-icon-btn, .action-btn { font-size: 1.2rem; color: var(--light-text); cursor: pointer; padding: 0.5rem; background: none; border: none; border-radius: 50%; width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; transition: background-color var(--transition-speed), color var(--transition-speed); }
#profile-icon-btn:hover, .action-btn:hover { background-color: var(--menu-hover-bg); color: var(--banner-text); }
#profile-icon-btn { font-size: 1.4rem; }
.user-menu-dropdown { display: none; position: absolute; top: calc(100% + 8px); right: 0; z-index: 1050; min-width: 250px; background-color: var(--card-bg); border: 1px solid var(--bs-border-color); border-radius: var(--border-radius); box-shadow: var(--shadow-lg); padding: .5rem 0;}
.user-menu-dropdown.active { display: block; }
.user-menu-nav-link { display: block; width: 100%; padding: .6rem 1rem; color: var(--bs-body-color); background: none; border:none; font-size:.9rem; text-align: left; display: flex; align-items: center; gap: .75rem;}
.user-menu-nav-link:hover { background-color: var(--menu-hover-bg); color: var(--heading-text); }
.user-menu-nav-link .fa-fw { width: 1.2em; text-align: center; }
.theme-switch-wrapper { display: flex; align-items: center; }
.theme-switch { position: relative; display: inline-block; width: 56px; height: 30px; cursor: pointer; }
.theme-switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background-color: var(--input-bg); border: 1px solid var(--bs-border-color); border-radius: 34px; transition: background-color var(--transition-speed); }
.slider:before { position: absolute; content: ""; height: 22px; width: 22px; left: 3px; bottom: 3px; background-color: var(--card-bg); border: 1px solid var(--bs-border-color); border-radius: 50%; transition: transform var(--transition-speed); box-shadow: var(--shadow-sm); }
.slider .icon { position: absolute; top: 50%; transform: translateY(-50%); font-size: 14px; color: var(--accent-color); transition: opacity 0.15s ease-in-out; z-index: 1; }
.slider .sun { left: 7px; opacity: 0; } .slider .moon { right: 7px; opacity: 1; }
input:checked + .slider { background-color: var(--primary-color); border-color: var(--primary-color); }
input:checked + .slider:before { transform: translateX(26px); background-color: white; border-color: transparent; }
input:checked + .slider .sun { opacity: 1; color: white; } input:checked + .slider .moon { opacity: 0; }

/* === HORIZONTAL NAV BAR === */
#horizontal-navbar {
    display: flex; gap: 0.5rem; padding: 0 1.5rem; background-color: var(--banner-bg);
    border-bottom: 1px solid var(--bs-border-color);
    height: var(--subnav-height); flex-shrink: 0; align-items: center; z-index: 1020;
}
#horizontal-navbar .nav-link {
    padding: 0 1rem; height: 100%; display: inline-flex; align-items: center;
    font-size: 0.95rem; font-weight: 500; color: var(--light-text);
    background: none; border: none; border-bottom: 3px solid transparent;
    cursor: pointer; transition: color 0.2s ease, border-color 0.2s ease;
}
#horizontal-navbar .nav-link:hover { color: var(--heading-text); }
#horizontal-navbar .nav-link.active { color: var(--primary-color); border-bottom-color: var(--primary-color); font-weight: 600; }

/* === MAIN CONTENT AREA === */
#main-content-area {
    flex-grow: 1; overflow: hidden; position: relative;
}
#main-content-area > div { /* All direct children are dashboard pages */
    display: none; height: 100%; overflow-y: auto; 
    padding: 1.5rem; background-color: var(--bs-body-bg);
}
#main-content-area > div.active-tab-content { display: block; }
        
/* === GENERIC COMPONENT STYLES === */
.card {
    background-color: var(--card-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    transition: background-color var(--transition-speed), border-color var(--transition-speed), box-shadow 0.3s ease;
}
.kpi-card { padding: 1.5rem; text-align: center; }
.kpi-card h3 { font-size: 0.9rem; color: var(--light-text); margin-bottom: 0.5rem; text-transform: uppercase; }
.kpi-card .value { font-size: 2rem; font-weight: 600; color: var(--heading-text); margin-bottom: 0.25rem; }
.chart-container h4, .table-container h4, .panel-container h4 {
    font-size: 1.1rem; color: var(--heading-text); margin: 0 0 1rem 0;
    padding-bottom: 0.5rem; border-bottom: 1px solid var(--border-color-2);
}
.styled-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.styled-table th { padding: 0.8rem 1rem; text-align: left; font-weight: 600; color: var(--heading-text); background-color: color-mix(in srgb, var(--card-bg) 80%, var(--bs-body-bg)); border-bottom: 2px solid var(--bs-border-color); white-space: nowrap; }
.styled-table td { padding: 0.9rem 1rem; border-bottom: 1px solid var(--bs-border-color); vertical-align: middle; color: var(--bs-body-color); }
.styled-table tbody tr:hover { background-color: var(--menu-hover-bg); }
.status-badge { display: inline-block; padding: .35em .65em; font-size: .75em; font-weight: 600; line-height: 1; text-align: center; white-space: nowrap; vertical-align: middle; border-radius: var(--border-radius); text-transform: capitalize; }
.status-badge.status-running { background-color: var(--success-color); color: white; }
.status-badge.status-draft { background-color: var(--secondary-color); color: white; }
.status-badge.status-completed { background-color: var(--info-color); color: white; }
.status-badge.status-paused { background-color: var(--warning-color); color: var(--text-inverted); }


/* === NEW: Seller Hunter Specific Styles === */

/* --- Overview Dashboard --- */
#overviewGrid {
    display: grid;
    grid-template-columns: repeat(12, 1fr); /* 12-column grid */
    grid-auto-rows: min-content;
    gap: 1.5rem;
}
#kpi-container {
    grid-column: span 12;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}
#heatmap-container { grid-column: 1 / -1; min-height: 400px; }
#activity-feed-container { grid-column: 1 / -1; }
#funnel-chart-container { grid-column: 1 / -1; }
#ai-alerts-container { grid-column: 1 / -1; }

@media(min-width: 992px){
    #overview-campaign-kanban-container { /* <-- ID FIXED from #heatmap-container */
    grid-column: 1 / 9;
}
    #activity-feed-container { grid-column: 9 / 13; }
  #score-distribution-container { /* <--- TO THIS */
        grid-column: 1 / 9; 
    }
    #ai-alerts-container { 
        grid-column: 9 / 13;
        display: flex; 
        flex-direction: column;
    }
}

.sh-heatmap-placeholder {
    width: 100%; height: 100%;
    background: repeating-conic-gradient(var(--card-bg) 0% 25%, var(--bs-body-bg) 0% 50%) 50% / 30px 30px;
    display: flex; align-items: center; justify-content: center;
    color: var(--light-text); font-style: italic; border-radius: var(--border-radius);
}

.sh-activity-feed { list-style: none; padding: 0; max-height: 400px; overflow-y: auto;}
.sh-activity-item { display: flex; align-items: flex-start; gap: 1rem; padding: .75rem 0; border-bottom: 1px solid var(--border-color-2); }
.sh-activity-item:last-child { border-bottom: none; }
.sh-activity-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 5px; flex-shrink: 0; }
.dot-green { background-color: var(--success-color); }
.dot-blue { background-color: var(--info-color); }
.dot-orange { background-color: var(--accent-color); }
.sh-activity-content p { margin:0; line-height: 1.4; font-size: 0.9rem; }
.sh-activity-content .time { font-size: 0.75rem; color: var(--light-text); }
.sh-ai-alerts-panel .alert-item { padding: .75rem; border-radius: var(--border-radius); margin-bottom: .75rem; background-color: color-mix(in srgb, var(--primary-color) 15%, transparent); }

/* --- Lead Explorer Dashboard --- */
#explorer-grid { display: grid; grid-template-columns: 280px 1fr; gap: 1.5rem; height: 100%; }
#explorer-sidebar { overflow-y: auto; padding: 1.5rem; }
#explorer-main-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    min-height: 0; /* A key fix for flexbox inside a grid */
}

#explorer-map-container { flex-grow: 1; min-height: 300px; }
#explorer-data-grid {
    height: 40%; /* Use a firm height instead of max-height */
    flex-shrink: 0; /* Prevent this container from shrinking */
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
#explorer-data-grid .table-container { flex-grow: 1; overflow-y: auto; padding: 1rem; }
.filter-group h5 { font-size: .9rem; text-transform: uppercase; color: var(--light-text); margin: 1.5rem 0 .75rem 0; }
.form-control { width: 100%; background: var(--input-bg); border: 1px solid var(--input-border); color: var(--input-text); padding: .5rem .75rem; border-radius: var(--border-radius);}
.form-range { width: 100%; accent-color: var(--primary-color); }
.form-check { display: flex; align-items: center; gap: .5rem; }

/* --- Sliding Drawer for Lead Detail --- */
#lead-detail-drawer {
    position: fixed; top: 0; right: -450px; /* Start off-screen */
    width: 420px; height: 100vh; background: var(--card-bg);
    z-index: 1040; box-shadow: var(--shadow-lg);
    border-left: 1px solid var(--bs-border-color);
    transition: right .35s ease-in-out;
    display: flex; flex-direction: column;
}
#lead-detail-drawer.open { right: 0; }
.drawer-header { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.5rem; background: var(--banner-bg); flex-shrink: 0; border-bottom: 1px solid var(--bs-border-color); }
.drawer-header h4 { margin:0; font-size: 1.2rem; }
.drawer-content { padding: 1.5rem; overflow-y: auto; flex-grow: 1; }
.drawer-footer { padding: 1rem 1.5rem; border-top: 1px solid var(--bs-border-color); display: flex; gap: .75rem; }

/* --- Reporting & Admin Dashboard --- */
.settings-card.modern { background-color: var(--card-bg); border: 1px solid var(--bs-border-color); border-radius: var(--border-radius-lg); padding: 2rem; margin-bottom: 2rem; }
.settings-card-title { font-size: 1.25rem; font-weight: 600; color: var(--heading-text); margin-bottom: 1.8rem; display: flex; align-items: center; padding-bottom: 0.8rem; border-bottom: 1px solid var(--border-color-2); }
.settings-card-title i { color: var(--primary-color); font-size: 1.1em; margin-right: 0.75rem; }
.token-usage-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.token-usage-card { border: 1px solid var(--border-color-2); border-radius: 10px; padding: 1.3rem; }
.token-usage-card h5 { font-size: .95rem; margin-bottom: .8rem; }
.token-count { font-size: 1.2rem; font-weight: 600; margin-bottom: .6rem; }
.progress-bar-wrapper { background: var(--input-bg); border-radius: 8px; padding: 3px; margin-top: .5rem; }
.progress-bar-inner { height: 10px; border-radius: 5px; background-color: var(--primary-color); transition: width .5s ease; }
.sh-data-health-list { display: flex; flex-direction: column; gap: .5rem; }
.sh-data-health-item { display: flex; align-items: center; justify-content: space-between; padding: .75rem 0; border-bottom: 1px solid var(--border-color-2); }
.sh-data-health-item:last-child { border-bottom: none; }
.health-status-dot { width: 12px; height: 12px; border-radius: 50%; }
/* === D3.js Funnel Chart Styles === */


/* Tooltip style */
.d3-tooltip {
    position: absolute;
    visibility: hidden;
    padding: 10px;
    background-color: var(--card-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: var(--border-radius);
    color: var(--bs-body-color);
    font-size: 0.9em;
    pointer-events: none;
    box-shadow: var(--shadow-md);
    line-height: 1.4;
}

.d3-tooltip small {
    color: var(--light-text);
}
/* ADDED: Styles for Navbar Toggle Functionality */
#top-header .header-left {
    flex-shrink: 0;
}

#top-header .header-center {
    flex-grow: 1;
    min-width: 0;
}

#horizontal-navbar {
    transition: max-height 0.35s ease-in-out, padding 0.35s ease-in-out, opacity 0.3s ease-in-out, border-width 0.35s ease-in-out;
    max-height: 50px; /* Explicitly set max-height for transition */
    overflow: hidden;
    opacity: 1;
}

#horizontal-navbar.navbar-collapsed {
    max-height: 0;
    opacity: 0;
    padding-top: 0;
    padding-bottom: 0;
    border-bottom-width: 0;
}
/* (Existing code in styles.css...) */


/* (Existing code in styles.css...) */


/* === ADD THESE NEW AND UPDATED STYLES AT THE END OF THE FILE === */
/* === ENHANCED STYLES FOR OVERVIEW CARDS === */

/* --- 1. AI Alerts Panel Improvements --- */

/* Make the panel a flex container to manage its children */
/* (styles.css) - Add these new styles to the end of the file */

/* === Enhanced Announcement Styles (with Scrolling) === */

#announcements-container .sh-ai-alerts-panel {
    padding: 0;
    gap: 0;
    display: block;    /* Keeps the block layout for the announcement items */
    flex-grow: 1;      /* Allows this panel to grow and fill available space */
    overflow-y: auto;  /* Adds a vertical scrollbar ONLY when content overflows */
    min-height: 0;     /* A crucial fix for scrolling inside a flex container */
}

/* Style each individual alert item */
.sh-ai-alerts-panel .alert-item {
    padding: .85rem 1.1rem;
    border-radius: var(--border-radius);
    /* Use a semi-transparent version of the primary color for the background */
    background-color: color-mix(in srgb, var(--primary-color) 10%, transparent);
    /* Add a subtle border that matches the background */
    border: 1px solid color-mix(in srgb, var(--primary-color) 25%, transparent);
    display: flex;
    align-items: center; /* Vertically align icon and text */
    gap: 1rem; /* Space between icon and text */
    transition: background-color var(--transition-speed), border-color var(--transition-speed);
}

/* Add a hover effect to make alerts feel interactive */
.sh-ai-alerts-panel .alert-item:hover {
    background-color: color-mix(in srgb, var(--primary-color) 20%, transparent);
    border-color: color-mix(in srgb, var(--primary-color) 40%, transparent);
}

/* Style the icon within the alert */
.alert-item .alert-icon {
    font-size: 1.2rem;
    color: var(--primary-color);
    flex-shrink: 0; /* Prevent the icon from shrinking */
}

/* Style the text content of the alert */
.alert-item p {
    margin: 0;
    line-height: 1.4;
    font-size: 0.9rem;
}

/* Make the bolded text within an alert stand out more */
.alert-item p strong {
    color: var(--heading-text);
    font-weight: 600;
}


/* --- 2. Recent Activity Feed Improvements --- */

/* Make the list a flex container */
.sh-activity-feed {
    list-style: none;
    padding: 0;
    max-height: 400px; /* Keep the max height for scrolling */
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem; /* Add consistent space between activity items */
}

/* Style each individual activity item */
.sh-activity-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: .75rem; /* Add padding to create space inside the item */
    border-radius: var(--border-radius); /* Add rounded corners */
    border-bottom: none; /* Remove the old bottom border */
    transition: background-color var(--transition-speed);
}

/* Add a hover effect for interactivity */
.sh-activity-item:hover {
    background-color: var(--menu-hover-bg);
}

/* No need to change the dot or content styles, they work well with the new container */
.sh-activity-item:last-child {
    border-bottom: none;
}
/* Add padding to panel and chart containers for better spacing */
.panel-container,
.chart-container {
    padding: 1.5rem;
}
/* === CAMPAIGNS PAGE STYLES === */

/* --- Page Header --- */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap; /* Allows wrapping on smaller screens */
    gap: 1rem;
}

.page-header-left {
    display: flex;
    align-items: baseline;
    gap: 1rem;
}

.page-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--heading-text);
    margin: 0;
}

.breadcrumb {
    font-size: 0.9rem;
    color: var(--light-text);
}

.breadcrumb span:first-child {
    font-weight: 500;
    color: var(--bs-body-color);
}

#newCampaignBtn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    padding: 0.6rem 1.2rem;
}

/* --- KPI Ribbon --- */
#campaigns-kpi-ribbon {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

#campaigns-kpi-ribbon .kpi-card {
    background-color: var(--card-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: var(--border-radius);
    padding: 1rem 1.5rem;
    text-align: left; /* Align text to the left for this version */
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

#campaigns-kpi-ribbon .kpi-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

#campaigns-kpi-ribbon .kpi-card h3 {
    font-size: 0.85rem;
    font-weight: 500;
}

#campaigns-kpi-ribbon .kpi-card .value {
    font-size: 2.2rem;
    line-height: 1.2;
}

/* --- Responsive Adjustments --- */
@media(max-width: 768px) {
    .page-title {
        font-size: 1.5rem;
    }

    #campaigns-kpi-ribbon {
        /* On mobile, this will naturally stack the cards which is good behavior */
        gap: 1rem;
    }
    
    #campaigns-kpi-ribbon .kpi-card .value {
        font-size: 1.8rem;
    }
}
/* === CAMPAIGN WIZARD MODAL === */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 1100; /* Higher than other elements */
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.wizard-container {
    background-color: var(--card-bg);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--bs-border-color);
    box-shadow: var(--shadow-lg);
    width: 90%;
    max-width: 800px;
    height: 90vh;
    max-height: 700px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(1);
    transition: transform 0.3s ease;
}

.modal-overlay.hidden .wizard-container {
    transform: scale(0.95);
}

.wizard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--bs-border-color);
    flex-shrink: 0;
}

.wizard-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--heading-text);
}

.wizard-progress-bar {
    display: flex;
    justify-content: space-around;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--bs-border-color);
    background-color: var(--bs-body-bg);
    flex-shrink: 0;
}

.wizard-progress-bar .step {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--light-text);
    position: relative;
    padding: 0 0.5rem;
}
.wizard-progress-bar .step strong {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--bs-border-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}
.wizard-progress-bar .step.active strong {
    border-color: var(--primary-color);
    color: var(--primary-color);
}
.wizard-progress-bar .step.complete strong {
    border-color: var(--success-color);
    background-color: var(--success-color);
    color: white;
}
.wizard-progress-bar .step.active span, .wizard-progress-bar .step.complete span {
    color: var(--heading-text);
    font-weight: 500;
}

.wizard-steps-container {
    flex-grow: 1;
    padding: 2rem;
    overflow-y: auto;
}

.wizard-step-content {
    display: none;
}
.wizard-step-content.active {
    display: block;
}

.wizard-footer {
    display: flex;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--bs-border-color);
    background-color: var(--banner-bg);
    flex-shrink: 0;
}

@media(max-width: 768px) {
    .wizard-progress-bar .step span {
        display: none; /* Hide text label on mobile to save space */
    }
    .wizard-container {
        width: 100vw;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }
}
/* === WIZARD: STEP-SPECIFIC & FORM STYLES === */

.wizard-step-content .step-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color-2);
}
.step-header h4 {
    font-size: 1.5rem;
    color: var(--heading-text);
    margin: 0;
}
.step-header p {
    font-size: 1rem;
    color: var(--light-text);
    margin: 0.25rem 0 0 0;
}

/* --- Form Groups & Inputs --- */
.form-group {
    margin-bottom: 1.5rem;
}
.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
}
.form-control, select.form-control {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    color: var(--input-text);
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius);
    font-size: 1rem;
}
select.form-control:invalid {
    color: var(--input-placeholder);
}


/* --- Preview Box --- */
.preview-box {
    background-color: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-top: 1rem;
}
.preview-box h5 {
    font-size: 1rem;
    text-transform: uppercase;
    color: var(--light-text);
    margin: 0 0 1rem 0;
}
.preview-box p { margin: 0.25rem 0; }
.preview-box ul {
    list-style-type: none;
    padding-left: 0;
    margin: 0.5rem 0;
    color: var(--light-text);
}
.preview-box a {
    font-weight: 600;
    font-size: 0.9rem;
    margin-top: 1rem;
    display: inline-block;
}

/* --- Validation Banners --- */
.validation-banner {
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    margin-top: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    font-weight: 500;
}
.validation-banner.hidden { display: none; }
.validation-banner.warning {
    background-color: color-mix(in srgb, var(--warning-color) 15%, transparent);
    color: var(--warning-color);
    border: 1px solid var(--warning-color);
}
.validation-banner.error {
    background-color: color-mix(in srgb, var(--danger-color) 15%, transparent);
    color: var(--danger-color);
    border: 1px solid var(--danger-color);
}

/* --- Step 2: Channel Toggles --- */
.channel-toggles {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}
.channel-toggle-item {
    flex-grow: 1;
    text-align: center;
    padding: 1rem;
    border: 2px solid var(--bs-border-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}
.channel-toggle-item:has(input:checked) {
    border-color: var(--primary-color);
    background-color: color-mix(in srgb, var(--primary-color) 10%, transparent);
    color: var(--primary-color);
}
.channel-toggle-item i { font-size: 1.5rem; display: block; margin-bottom: 0.5rem; }
.channel-toggle-item span { font-weight: 600; }
.channel-toggle-item input {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
}

/* --- Step 3: Content Tabs --- */
.content-tabs {
    display: flex;
    border-bottom: 1px solid var(--bs-border-color);
    margin-bottom: 1.5rem;
}
.content-tab {
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    color: var(--light-text);
    font-weight: 600;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease;
}
.content-tab:hover {
    color: var(--heading-text);
}
.content-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}
.content-panel { display: none; }
.content-panel.active { display: block; }

/* --- Step 4: Radios & Checkboxes --- */
.radio-group { display: flex; gap: 1.5rem; }
.simple-checkbox, .radio-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    cursor: pointer;
}
.simple-checkbox input, .radio-group input {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
}

/* --- Step 5: Review Summary --- */
.review-summary {
    background-color: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
}
.review-summary p {
    font-size: 1rem;
    margin-bottom: 0.75rem;
    color: var(--light-text);
}
.review-summary p strong {
    color: var(--heading-text);
    width: 100px;
    display: inline-block;
}
#review-error-list ul {
    margin: 0.5rem 0 0 1rem;
    padding: 0;
    list-style-type: disc;
}

/* --- Wizard Footer --- */
.wizard-footer {
    justify-content: space-between;
    display: flex;
    align-items: center;
}
.wizard-footer .btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}
/* === ENHANCED CAMPAIGN TABLE STYLES === */

/* Make the whole row clickable and a container for the progress bar */
.styled-table tbody tr {
    position: relative;
    cursor: pointer;
    transition: background-color var(--transition-speed);
}

/* Remove default table borders and add a single line between rows */
.styled-table td, .styled-table th {
    border: none;
    border-bottom: 1px solid var(--bs-border-color);
    padding: 1.25rem 1rem; /* Increase padding for more space */
}

/* Style the top-level name and sub-level creation date */
.campaign-name-title {
    font-weight: 600;
    font-size: 1rem;
    color: var(--heading-text);
    margin-bottom: 0.25rem;
}
.campaign-creation-date {
    font-size: 0.8rem;
    color: var(--light-text);
}

/* Container for the channel icons */
.channel-icon-list {
    display: flex;
    gap: 0.75rem;
    font-size: 1.1rem;
    color: var(--light-text);
}

/* Base style for all status badges */
.status-badge {
    display: inline-block;
    padding: 0.3rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 30px; /* Pill shape */
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Specific colors for each status */
.status-badge.status-active {
    background-color: color-mix(in srgb, var(--success-color) 20%, transparent);
    color: var(--success-color);
}
.status-badge.status-completed {
    background-color: color-mix(in srgb, var(--primary-color) 20%, transparent);
    color: var(--primary-color);
}
.status-badge.status-draft {
    background-color: color-mix(in srgb, var(--secondary-color) 25%, transparent);
    color: var(--secondary-color);
}
.status-badge.status-paused {
    background-color: color-mix(in srgb, var(--warning-color) 20%, transparent);
    color: var(--warning-color);
}


/* Styling for the progress bar at the bottom of each row */
.progress-bar-container {
    padding: 0 !important; /* Remove padding from the cell itself */
}

.campaign-progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background-color: var(--bs-border-color);
}

.campaign-progress-bar .progress-bar-fill {
    height: 100%;
    background-color: var(--success-color);
    border-radius: 0 2px 2px 0;
    transition: width 0.8s ease-in-out;
}

/* Make the header consistent with the new cell padding */
.styled-table th {
    padding-top: 0.8rem;
    padding-bottom: 0.8rem;
    text-transform: uppercase;
    font-size: 0.8rem;
    color: var(--light-text);
}
/* === PROFESSIONAL ICONS & LIGHT THEME REFINEMENTS === */

/* --- Professional Channel Icons --- */
.channel-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    color: #fff; /* White icon color for all */
}

.channel-icon.email {
    background-color: #4285F4; /* Google Blue */
}
.channel-icon.sms {
    background-color: #34A853; /* Google Green */
}
.channel-icon.postcard {
    background-color: #6c757d; /* Neutral Grey */
}

/* --- Light Theme Badge Overrides --- */

body.light-mode .status-badge.status-active {
    background-color: #e6f7ec; /* Soft Green */
    color: #0d6a2c;
}
body.light-mode .status-badge.status-completed {
    background-color: #e7f0fe; /* Soft Blue */
    color: #1c59b1;
}
body.light-mode .status-badge.status-draft {
    background-color: #f8f9fa; /* Soft Grey */
    color: #495057;
    border: 1px solid #dee2e6;
}
body.light-mode .status-badge.status-paused {
    background-color: #fff8e1; /* Soft Yellow */
    color: #8d6e0b;
}

/* --- Light Theme Progress Bar --- */
body.light-mode .campaign-progress-bar {
    background-color: #e9ecef; /* Lighter background for the track */
}

body.light-mode .campaign-progress-bar .progress-bar-fill {
    background-color: var(--success-color); /* Keep the vibrant fill color */
}
/* === SOFT UI & SQUIRCLE ICON REFINEMENTS === */

/* 1. New, Softer Background for Light Mode */
body.light-mode {
    --bs-body-bg: #f7f7f9; /* A very soft, light grey instead of pure white */
    --card-bg: #ffffff;
}


/* 2. Updated Squircle Icon Styles */

/* Base style for the new "squircle" container */
.channel-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px; /* This creates the "circle squared" or squircle shape */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem; /* Slightly larger icon */
}

/* New soft background and icon colors for light mode */
body.light-mode .channel-icon.email {
    background-color: #eaf1ff; /* Soft Pastel Blue */
    color: #4285F4; /* Icon color is now the vibrant blue */
}
body.light-mode .channel-icon.sms {
    background-color: #e6f4ea; /* Soft Pastel Green */
    color: #34A853; /* Icon color is the vibrant green */
}
body.light-mode .channel-icon.postcard {
    background-color: #f1f3f5; /* Soft Pastel Grey */
    color: #5f6368; /* Icon color is a dark grey */
}

/* 3. Make table rows blend with the new soft background */
body.light-mode .styled-table tbody tr:hover {
    background-color: #eff1f3; /* A slightly darker soft grey for hover */
}
/* === PAGINATION CONTROLS FOR DATA TABLE (REVISED) === */

#pagination-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--bs-border-color);
    flex-shrink: 0;
}

#pagination-info {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--light-text);
}

/* This is the key change for the button's appearance */
#pagination-controls .btn {
    background-color: color-mix(in srgb, var(--primary-color) 15%, transparent);
    border: 1px solid color-mix(in srgb, var(--primary-color) 40%, transparent);
    color: var(--primary-color);
    font-weight: 500;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

#pagination-controls .btn:hover {
    background-color: color-mix(in srgb, var(--primary-color) 25%, transparent);
    border-color: var(--primary-color);
}

#pagination-controls .btn:disabled {
    background-color: var(--card-bg);
    border-color: var(--bs-border-color);
    color: var(--secondary-color);
    opacity: 0.6;
    cursor: not-allowed;
}
/* ADD to the end of styles.css */
.location-search-container {
    display: flex;
    gap: 0.5rem;
}

.location-search-container input {
    flex-grow: 1;
}

.location-search-container .btn {
    flex-shrink: 0;
    padding: 0.5rem 0.8rem;
}
/* (add to the end of styles.css) */

/* --- Explorer Table Scrolling --- */
#explorer-data-grid .table-container {
    flex-grow: 1; /* Allows the container to fill the available space */
    overflow-y: auto; /* Adds a scrollbar if the content overflows */
    padding: 0 1rem; /* Add some horizontal padding */
}
/* styles.css */

/* --- Enhanced Drawer Details List --- */
.sh-details-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.sh-details-list li {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background-color: var(--bs-body-bg);
    border-radius: var(--border-radius);
    border: 1px solid var(--bs-border-color);
}

.sh-details-list li i {
    font-size: 1.1rem;
    color: var(--primary-color);
    width: 24px;
    text-align: center;
}

.sh-details-list li div {
    display: flex;
    flex-direction: column;
}

.sh-details-list li span {
    font-size: 0.8rem;
    color: var(--light-text);
}

.sh-details-list li strong {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--heading-text);
}

/* --- Drawer Footer Button Icons --- */
.drawer-footer .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}
/* styles.css */

/* --- CMA Result Modal Styles --- */
.cma-container {
    background-color: var(--card-bg);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--bs-border-color);
    box-shadow: var(--shadow-lg);
    width: 90%;
    max-width: 700px; /* Slightly smaller than wizard */
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.cma-content {
    padding: 2rem;
    overflow-y: auto;
    flex-grow: 1;
}

.cma-content h4 {
    font-size: 1.1rem;
    color: var(--heading-text);
    margin: 1.8rem 0 0.8rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color-2);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.cma-content h4 i {
    color: var(--primary-color);
}

.cma-content p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--bs-body-color);
}

#cma-price-box {
    background-color: color-mix(in srgb, var(--primary-color) 10%, transparent);
    border: 1px solid color-mix(in srgb, var(--primary-color) 30%, transparent);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    text-align: center;
    margin-bottom: 1.5rem;
}

.cma-price-label {
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
    color: var(--light-text);
}

.cma-price-value {
    font-size: 2.8rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1.2;
    margin: 0.25rem 0;
}

.cma-price-range {
    font-size: 0.9rem;
    color: var(--light-text);
}
/* styles.css */

/* --- Coming Soon Modal Styles --- */
.coming-soon-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    background-color: var(--card-bg);
    padding: 3rem 4rem;
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--bs-border-color);
    position: relative;
    box-shadow: var(--shadow-lg);
}
/* styles.css */

/* --- Campaigns Page: View Toggler --- */
.view-toggle-container {
    margin: 1.5rem 0;
    display: flex;
    gap: 0.5rem;
}
.view-toggle-container .btn {
    gap: 0.5rem;
}
.view-toggle-container .btn.btn-secondary {
    background-color: var(--card-bg);
    color: var(--light-text);
    border: 1px solid var(--bs-border-color);
}
body.light-mode .view-toggle-container .btn.btn-secondary {
    background-color: #e9ecef;
}

/* --- Campaigns Page: Kanban Board --- */
.kanban-container {
    display: grid;
    grid-auto-columns: minmax(280px, 1fr);
    grid-auto-flow: column;
    gap: 1.5rem;
    overflow-x: auto;
    padding-bottom: 1rem;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on mobile */
}
.kanban-column {
    background-color: var(--bs-body-bg);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--bs-border-color);
    display: flex;
    flex-direction: column;
}
.kanban-column-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--bs-border-color);
    font-weight: 600;
    color: var(--heading-text);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.kanban-column-header .count {
    font-size: 0.9rem;
    background-color: var(--card-bg);
    padding: 0.1rem 0.5rem;
    border-radius: 5px;
}
.kanban-cards {
    min-height: 150px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex-grow: 1;
}
.kanban-card {
    background-color: var(--card-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: var(--border-radius);
    padding: 1rem;
    box-shadow: var(--shadow-sm);
    cursor: grab;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.kanban-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.kanban-card:active {
    cursor: grabbing;
}
.kanban-card-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}
.kanban-card-address {
    font-size: 0.85rem;
    color: var(--light-text);
}

/* Drag & Drop Visual Styles */
.kanban-card.dragging {
    opacity: 0.5;
    transform: rotate(3deg);
}
.kanban-column.drag-over {
    background-color: color-mix(in srgb, var(--primary-color) 10%, transparent);
    border-color: var(--primary-color);
}

/* --- Bulk Action Bar --- */
.bulk-action-bar {
    position: fixed;
    bottom: -100px; /* Start hidden */
    left: 50%;
    transform: translateX(-50%);
    width: auto;
    max-width: 600px;
    background-color: var(--banner-bg);
    color: var(--banner-text);
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--bs-border-color);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: bottom 0.3s ease-in-out;
    z-index: 1000;
}
.bulk-action-bar:not(.hidden) {
    bottom: 20px;
}
.bulk-action-bar .bulk-actions {
    display: flex;
    gap: 0.75rem;
}

/* styles.css */

/* --- Enhanced Wizard Styles --- */
.wizard-progress-bar .step { cursor: pointer; }
.content-creation-card {
    background-color: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}
.form-control.invalid {
    border-color: var(--danger-color);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--danger-color) 25%, transparent);
}
.wizard-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
/* styles.css */
/* --- Simple Checkbox Group Styles --- */
.simple-checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.75rem; /* Space between checkbox and label */
}
.simple-checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color); /* Styles the checkmark color */
}
.simple-checkbox-group label {
    font-weight: 500;
    margin-bottom: 0; /* Prevents unwanted spacing */
}
/* styles.css */

/* --- Campaigns Page: Split View Layout --- */
.campaigns-split-layout {
    display: grid;
    grid-template-columns: 320px 1fr; /* Fixed left column, flexible right column */
    gap: 1.5rem;
    height: calc(100vh - var(--banner-height) - var(--subnav-height) - 3rem); /* Full height minus headers */
}

#campaigns-list-panel {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 0;
}

#campaigns-list-panel .table-container {
    flex-grow: 1; /* Allows table to fill remaining space */
}

.campaigns-list-table th, .campaigns-list-table td {
    padding: 1rem 1.5rem;
    white-space: nowrap;
}

.campaigns-list-table tbody tr {
    cursor: pointer;
}

.campaigns-list-table tbody tr.active-campaign,
.campaigns-list-table tbody tr:hover {
    background-color: var(--menu-hover-bg);
}

.placeholder-view {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    padding: 2rem;
    color: var(--light-text);
}
.placeholder-view i {
    font-size: 3rem;
    margin-bottom: 1.5rem;
}
.placeholder-view h3 {
    color: var(--heading-text);
}
/* styles.css */

/* --- Campaign Spreadsheet View --- */
.campaign-spreadsheet tbody tr {
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
}
.campaign-spreadsheet tbody tr:hover {
    background-color: var(--menu-hover-bg);
    transform: translateY(-2px); /* Add a subtle lift effect */
    box-shadow: var(--shadow-md);
}
.campaign-spreadsheet td, .campaign-spreadsheet th {
    padding: 1.25rem 1rem;
}
/* Utility class to hide elements */
.hidden {
    display: none !important;
}
/* === D3.js Histogram Chart Styles === */

#scoreDistributionChart {
    width: 100%;
    min-height: 350px;
}

.histogram-bar {
    fill: var(--primary-color);
    transition: filter 0.2s ease-in-out;
}

.histogram-bar:hover {
    fill: var(--accent-color); /* Highlight with accent color on hover */
}

/* Styles for the D3 axes */
.axis path,
.axis line {
    stroke: var(--bs-border-color);
}

.axis text {
    fill: var(--light-text);
    font-size: 12px;
}
/* === ENHANCED STYLES FOR OVERVIEW CARDS === */

/* --- 1. AI Alerts Panel Improvements --- */

/* (styles.css) - Add these new styles to the end of the file */

/* === Enhanced Announcement Styles (with Scrolling) === */

#announcements-container .sh-ai-alerts-panel {
    padding: 0;
    gap: 0;
    display: block;    /* Keeps the block layout for the announcement items */
    flex-grow: 1;      /* Allows this panel to grow and fill available space */
    overflow-y: auto;  /* Adds a vertical scrollbar ONLY when content overflows */
    min-height: 0;     /* A crucial fix for scrolling inside a flex container */
}
/* Style each individual alert item */
.sh-ai-alerts-panel .alert-item {
    padding: .85rem 1.1rem;
    border-radius: var(--border-radius);
    /* Use a semi-transparent version of the primary color for the background */
    background-color: color-mix(in srgb, var(--primary-color) 10%, transparent);
    /* Add a subtle border that matches the background */
    border: 1px solid color-mix(in srgb, var(--primary-color) 25%, transparent);
    display: flex;
    align-items: center; /* Vertically align icon and text */
    gap: 1rem; /* Space between icon and text */
    transition: background-color var(--transition-speed), border-color var(--transition-speed);
}

/* Add a hover effect to make alerts feel interactive */
.sh-ai-alerts-panel .alert-item:hover {
    background-color: color-mix(in srgb, var(--primary-color) 20%, transparent);
    border-color: color-mix(in srgb, var(--primary-color) 40%, transparent);
}

/* Style the icon within the alert */
.alert-item .alert-icon {
    font-size: 1.2rem;
    color: var(--primary-color);
    flex-shrink: 0; /* Prevent the icon from shrinking */
}

/* Style the text content of the alert */
.alert-item p {
    margin: 0;
    line-height: 1.4;
    font-size: 0.9rem;
}

/* Make the bolded text within an alert stand out more */
.alert-item p strong {
    color: var(--heading-text);
    font-weight: 600;
}


/* --- 2. Recent Activity Feed Improvements --- */

/* Make the list a flex container */
.sh-activity-feed {
    list-style: none;
    padding: 0;
    max-height: 400px; /* Keep the max height for scrolling */
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem; /* Add consistent space between activity items */
}

/* Style each individual activity item */
.sh-activity-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: .75rem; /* Add padding to create space inside the item */
    border-radius: var(--border-radius); /* Add rounded corners */
    border-bottom: none; /* Remove the old bottom border */
    transition: background-color var(--transition-speed);
}

/* Add a hover effect for interactivity */
.sh-activity-item:hover {
    background-color: var(--menu-hover-bg);
}

/* No need to change the dot or content styles, they work well with the new container */
.sh-activity-item:last-child {
    border-bottom: none;
}

/* Add padding to panel and chart containers for better spacing */
.panel-container,
.chart-container {
    padding: 1.5rem;
}
/* (styles.css) - Add this to the end of your login page styles */

/* Fix for browser autofill background color */
input:-webkit-autofill,
input:-webkit-autofill:hover, 
input:-webkit-autofill:focus, 
input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px white inset !important;
    -webkit-text-fill-color: #111827 !important;
}

/* Styles for the button's loading state */
.btn .spinner {
    display: none; /* Hide spinner by default */
}

.btn.loading .spinner {
    display: inline-block; /* Show spinner when loading */
}

.btn.loading .btn-text {
    display: none; /* Hide text when loading */
}

.btn.loading {
    cursor: not-allowed;
    opacity: 0.8;
}
/* styles.css */

/* --- Enhanced Kanban Card for Draggability --- */

.kanban-card {
    position: relative; /* Needed to position the drag handle */
    padding-right: 35px; /* Add space for the handle */
}

.drag-handle {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bs-border-color); /* Subtle color by default */
    cursor: grab;
    transition: color 0.2s ease;
}

.kanban-card:hover .drag-handle {
    color: var(--light-text); /* Make handle more visible on hover */
}
/* styles.css */

/* --- Drawer Form & Section Styles --- */
.drawer-section-header {
    text-transform: uppercase;
    font-size: .8rem;
    color: var(--light-text);
    margin: 2rem 0 1rem 0;
    padding-bottom: .5rem;
    border-bottom: 1px solid var(--border-color-2);
}

.drawer-form-group {
    margin-bottom: 1.25rem;
}

.drawer-form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}
/* (at the end of styles.css) */

/* === OVERVIEW CAMPAIGN KANBAN STYLES === */

#overview-campaign-kanban-container .kanban-container {
    padding-bottom: 0; /* No bottom padding needed for this view */
}

.campaign-overview-card {
    cursor: pointer; /* Indicates the card is clickable */
}

.campaign-overview-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.75rem;
    font-size: 0.85rem;
    color: var(--light-text);
}

.campaign-overview-details span {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.no-campaigns-text {
    font-size: 0.85rem;
    color: var(--light-text);
    padding: 1rem 0.5rem;
    text-align: center;
    font-style: italic;
}
/* (styles.css) - Find and update this CSS rule inside the media query */

#announcements-container { /* <-- This ID has been updated */
    grid-column: 9 / 13;
    display: flex; 
    flex-direction: column;
}
/* (styles.css) - Add these styles to the end of the file */

#campaign-status-container {
    position: relative;
    display: inline-block;
    margin-left: 0.25rem;
    vertical-align: text-bottom;
}

/* Make the status badge look clickable */
.status-badge-interactive {
    cursor: pointer;
    transition: filter 0.2s ease;
}
.status-badge-interactive:hover {
    filter: brightness(1.2);
}
.status-badge-interactive i {
    margin-left: 0.5rem;
    font-size: 0.8em;
}

/* The dropdown menu */
.status-dropdown {
    display: none; /* Hidden by default */
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 100;
    min-width: 160px;
    background-color: var(--card-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    padding: 0.5rem 0;
    margin-top: 0.5rem;
}
.status-dropdown.active {
    display: block;
}

.status-dropdown-item {
    display: block;
    width: 100%;
    padding: 0.6rem 1.2rem;
    color: var(--bs-body-color);
    background: none;
    border: none;
    font-size: 0.9rem;
    text-align: left;
    cursor: pointer;
}
.status-dropdown-item:hover {
    background-color: var(--menu-hover-bg);
    color: var(--heading-text);
}
/* (styles.css) - Add these styles to the end of the file */

#plan-details-container {
    display: flex;
    flex-direction: column;
}

#plan-cards-scroller {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    padding: 0.5rem 0.25rem 1.5rem 0.25rem;
    flex-grow: 1;
    -ms-overflow-style: none;
    scrollbar-width: none;
}
#plan-cards-scroller::-webkit-scrollbar {
    display: none;
}

.plan-card {
    flex: 0 0 260px; /* Sets a fixed width for each card */
    border: 2px solid var(--bs-border-color);
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
    background-color: var(--bs-body-bg);
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
}
.plan-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.plan-card.current-plan {
    border-color: var(--primary-color);
    box-shadow: 0 0 20px color-mix(in srgb, var(--primary-color) 20%, transparent);
}

.plan-card h5 {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--heading-text);
    margin-bottom: 1.5rem;
}

.plan-card ul {
    list-style: none;
    padding: 0;
    margin: 0 0 2rem 0;
    flex-grow: 1; /* Pushes button to the bottom */
}

.plan-card li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}
.plan-card li i {
    color: var(--success-color);
    width: 16px;
    text-align: center;
}

.current-plan-badge {
    position: absolute;
    top: -2px;
    right: 1.5rem;
    background-color: var(--primary-color);
    color: white;
    padding: 0.3rem 0.8rem;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    box-shadow: var(--shadow-sm);
}

/* Update the grid layout rule */
@media(min-width: 992px) {
     #top-leads-container {
        grid-column: 1 / 9;
    }
}
/* (styles.css) - Add these styles to the end of the file */

/* --- User Menu Dropdown Enhancements --- */

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--bs-border-color);
    background-color: var(--bs-body-bg);
}

#profile-icon-btn {
    padding: 0;
    border: none;
    overflow: hidden;
}

#profile-icon-btn .user-avatar {
    width: 100%;
    height: 100%;
}

#userMenuDropdown {
    padding-top: 0;
}

#userMenuCloseBtn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 32px;
    height: 32px;
    font-size: 1rem;
}

#userMenuHeader {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    padding-right: 3rem; /* Make space for close button */
}

#userMenuHeader .user-avatar {
    width: 50px;
    height: 50px;
}

#userMenuInfo .user-menu-nav-link {
    padding: 0;
}

#userMenuDisplayName {
    font-weight: 600;
}

#userMenuEmail {
    font-size: .8rem;
    color: var(--light-text);
}
/* (styles.css) - Add these new styles for the activity chart */

/* --- Weekly Activity Bar Chart --- */
#weeklyActivityChart {
    width: 100%;
    min-height: 350px;
}

/* D3 axes styles (can reuse existing .axis styles if they are generic) */
.axis path,
.axis line {
    stroke: var(--bs-border-color);
}
.axis text {
    fill: var(--light-text);
    font-size: 12px;
}

/* Legend styles */
.legend {
    font-size: 0.8rem;
}/* (styles.css) - Add these styles to the end of the file */

/* --- High-Priority Leads Card --- */
#top-leads-container {
    display: flex;
    flex-direction: column;
}

#top-leads-list {
    margin: 0;
    padding: 0;
    overflow-y: auto; /* Add scroll if content overflows card height */
    flex-grow: 1;
}

.top-lead-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 0.25rem;
    border-bottom: 1px solid var(--bs-border-color);
    cursor: pointer;
    transition: background-color 0.2s ease;
}
.top-lead-item:last-child {
    border-bottom: none;
}
.top-lead-item:hover {
    background-color: var(--menu-hover-bg);
}

.top-lead-info {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.top-lead-info strong {
    font-weight: 600;
    color: var(--heading-text);
    font-size: 0.95rem;
}
.top-lead-info small {
    color: var(--light-text);
    font-size: 0.8rem;
}

.top-lead-score .status-badge {
    font-size: 0.9rem;
    padding: 0.4rem 0.6rem;
    min-width: 40px;
    text-align: center;
    background-color: color-mix(in srgb, var(--primary-color) 20%, transparent);
    color: var(--primary-color);


}
/* (styles.css) - Aggiungi questi nuovi stili alla fine del file */

/* === Stili Annunci Migliorati === */


.announcement-item {
    display: flex;
    gap: 1.25rem;
    padding: 1.25rem;
    border-bottom: 1px solid var(--border-color-2);
}
.announcement-item:last-child {
    border-bottom: none;
}

.announcement-icon-container {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: color-mix(in srgb, var(--primary-color) 15%, transparent);
    color: var(--primary-color);
    font-size: 1.1rem;
    margin-top: 0.1rem;
}

.announcement-content h5 {
    margin: 0 0 0.35rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--heading-text);
}

.announcement-content p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--bs-body-color);
}
/* === Shepherd.js Tour Styles === */

.shepherd-element {
    background-color: var(--card-bg);
    border: 1px solid var(--bs-border-color);
    box-shadow: var(--shadow-lg);
    border-radius: var(--border-radius-lg);
    max-width: 400px;
}

.shepherd-header {
    background-color: var(--bs-body-bg);
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--bs-border-color);
}

.shepherd-title {
    color: var(--heading-text);
    font-weight: 600;
    font-size: 1.1rem;
}

.shepherd-text {
    padding: 1.25rem 1.5rem;
    color: var(--bs-body-color);
    font-size: 0.95rem;
    line-height: 1.6;
}

.shepherd-text strong {
    color: var(--primary-color);
    font-weight: 600;
}

.shepherd-button {
    border-radius: var(--border-radius);
    padding: 0.6rem 1.2rem;
    font-weight: 600;
    transition: all 0.2s ease;
    text-transform: uppercase;
    font-size: 0.8rem;
    margin: 0 0.25rem;
}

.shepherd-button-secondary {
    background-color: var(--secondary-color);
    color: white;
}
.shepherd-button-secondary:hover {
    background-color: color-mix(in srgb, var(--secondary-color) 85%, black);
}

.shepherd-button-primary {
    background-color: var(--primary-color);
    color: white;
}
.shepherd-button-primary:hover {
    background-color: color-mix(in srgb, var(--primary-color) 85%, black);
}

/* (styles.css) - Add these styles to the end of the file */

.announcement-footer {
    margin-top: 20px;
    text-align: right;
}

.read-more-link {
    display: inline-block;
    padding: 6px 18px;
    background-color: var(--primary-color);
    color: white;
    font-weight: 600;
    font-size: 14px;
    border-radius: 20px;
    text-decoration: none;
    transition: all 0.2s ease;
}
.read-more-link:hover {
    background-color: color-mix(in srgb, var(--primary-color) 85%, black);
    color: white;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
/* (styles.css) - Add these styles to the end of the file */

/* === What's New Card Height Control === */

.announcement-item {
    /* The main container for a single announcement */
    display: flex;
    gap: 1.25rem;
    padding: 1.25rem;
    border-bottom: 1px solid var(--border-color-2);
}
.announcement-item:last-child {
    border-bottom: none;
}

.announcement-body {
    /* This is the container for the message that will be truncated */
    max-height: 150px; /* <-- You can adjust this value to make it taller or shorter */
    overflow: hidden;
    position: relative;
}

/* This class is added by JavaScript ONLY when the text is too long */
.announcement-body.has-overflow::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50px;
    background: linear-gradient(to bottom, transparent, var(--card-bg));
    pointer-events: none; /* Allows clicks to pass through */
}

.announcement-footer {
    margin-top: 1rem;
    text-align: right;
}
/* === SCROLL FIX FOR WHAT'S NEW CARD === */

#announcements-container {
    /* Ensures the parent container is a flex column */
    display: flex;
    flex-direction: column;
}

#announcements-container .sh-ai-alerts-panel {
    flex-grow: 1;      /* Allows the panel to fill available vertical space */
    overflow-y: auto;  /* Adds a vertical scrollbar ONLY when content overflows */
    min-height: 0;     /* A crucial fix for scrolling inside a flex container */
}
/* styles.css */

/* === TRIAL EXPIRATION BANNER STYLES === */

#trial-banner {
    background: linear-gradient(90deg, #4361ee, #3a53d6);
    color: #ffffff;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--primary-color);
    box-shadow: var(--shadow-md);
    z-index: 1031; /* Above header */
}

#trial-banner.hidden {
    display: none !important;
}

.trial-banner-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.trial-banner-main {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex-grow: 1;
}

.trial-banner-headline {
    font-size: 1.1rem;
    font-weight: 600;
}

.trial-banner-subline {
    font-size: 0.9rem;
    opacity: 0.9;
}

.trial-banner-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.trial-banner-actions .btn-primary {
    background-color: var(--accent-color);
    color: var(--text-inverted);
    border-color: var(--accent-color);
}
body.light-mode .trial-banner-actions .btn-primary {
    color: #111827;
}


.trial-banner-actions .btn-secondary {
    background-color: transparent;
    border-color: rgba(255, 255, 255, 0.5);
    color: #ffffff;
}
.trial-banner-actions .btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: #ffffff;
}

.trial-banner-actions .dismiss-btn {
    color: rgba(255, 255, 255, 0.8);
    width: 32px;
    height: 32px;
    font-size: 1.2rem;
}
.trial-banner-actions .dismiss-btn:hover {
    background-color: rgba(0, 0, 0, 0.2);
    color: #ffffff;
}

@media (max-width: 992px) {
    .trial-banner-content {
        flex-direction: column;
        align-items: flex-start;
        text-align: center;
        gap: 1rem;
    }
    .trial-banner-actions {
        width: 100%;
        justify-content: center;
    }
}