/* ==========================================
   PLANNERPRO V3.1 — LEADS KANBAN CLEAN
========================================== */

#commercialLeadsContainer {
    width: 100%;
    min-height: 600px;
    overflow: visible;
}

.leads-module {
    width: 100%;
    padding: 24px;
    background: #f4f6fb;
    border-radius: 22px;
}

.leads-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.leads-header h2 {
    margin: 0;
    font-size: 28px;
    color: #111827;
}

.leads-header p {
    margin: 4px 0 0;
    color: #6b7280;
}

.leads-kanban {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 18px;
    overflow-x: visible;
    padding-bottom: 20px;
}

.lead-column {
    min-width: 260px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 14px;
    min-height: 460px;
}

.lead-column-header {
    padding: 10px 12px;
    border-radius: 12px;
    color: #ffffff;
    font-weight: 800;
    margin-bottom: 14px;
}

.lead-column-body {
    min-height: 360px;
}

.lead-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 14px;
    margin-bottom: 14px;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.10);
    color: #111827;
}

.lead-card h4 {
    margin: 0 0 10px;
    font-size: 15px;
    color: #111827;
}

.lead-card p {
    margin: 5px 0;
    font-size: 13px;
    color: #4b5563;
}

.lead-probability {
    margin-top: 10px;
    font-size: 12px;
    font-weight: 800;
    color: #6C63FF;
}

.lead-status-select {
    width: 100%;
    margin-top: 12px;
    padding: 8px;
    border-radius: 10px;
    border: 1px solid #d1d5db;
}

.primary-btn,
.secondary-btn {
    border: none;
    border-radius: 12px;
    padding: 10px 16px;
    cursor: pointer;
    font-weight: 800;
}

.primary-btn {
    background: #6C63FF;
    color: #ffffff;
}

.secondary-btn {
    background: #e5e7eb;
    color: #111827;
}

.lead-card .secondary-btn {
    width: 100%;
    margin-top: 10px;
}

/* STATUS COLORS */

.new { background: #7F8CFF; }
.contacted { background: #4DA3FF; }
.quote { background: #F5A623; }
.negotiation { background: #9B59B6; }
.won { background: #27AE60; }
.lost { background: #E74C3C; }
.archived { background: #64748B; }

/* MODAL */

.lead-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.lead-modal-content {
    width: 700px;
    background: #ffffff;
    border-radius: 20px;
    padding: 26px;
}

.lead-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.lead-close-btn {
    border: none;
    background: transparent;
    font-size: 20px;
    cursor: pointer;
}

.lead-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.lead-form-grid input,
.lead-form-grid select,
.lead-form-grid textarea {
    padding: 12px;
    border-radius: 12px;
    border: 1px solid #d1d5db;
}

.lead-form-grid textarea {
    grid-column: span 2;
    min-height: 100px;
}

.lead-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 20px;
}


/* ==========================================
   LEADS ANALYTICS
========================================== */

.leads-analytics-section {

    margin-top: 40px;

}

.leads-analytics-header {

    margin-bottom: 25px;

}

.leads-kpis-grid {

    display: grid;

    grid-template-columns:
        repeat(auto-fit, minmax(220px, 1fr));

    gap: 18px;

    margin-bottom: 25px;

}

.lead-kpi-card {

    background: white;

    border-radius: 18px;

    padding: 22px;

    box-shadow:
        0 4px 14px rgba(0,0,0,0.06);

}

.lead-kpi-card span {

    display: block;

    color: #64748b;

    margin-bottom: 8px;

}

.lead-kpi-card strong {

    font-size: 34px;

    color: #111827;

}

.leads-charts-grid {

    display: grid;

    grid-template-columns: 1fr 1fr;

    gap: 22px;

    margin-bottom: 25px;

}

.lead-chart-card {

    background: white;

    border-radius: 18px;

    padding: 22px;

    box-shadow:
        0 4px 14px rgba(0,0,0,0.06);

}

.lead-report-table-card {

    background: white;

    border-radius: 18px;

    padding: 22px;

    box-shadow:
        0 4px 14px rgba(0,0,0,0.06);

}

.lead-report-table {

    width: 100%;

    border-collapse: collapse;

}

.lead-report-table th,
.lead-report-table td {

    padding: 14px;

    border-bottom:
        1px solid #e5e7eb;

    text-align: left;

}

.lead-report-table th {

    color: #64748b;

    font-weight: 600;

}

/* ==========================================
   LEADS SEARCH
========================================== */

.leads-search-bar {
    margin-bottom: 18px;
}

.leads-search-bar input {
    width: 100%;
    padding: 14px 18px;
    border: 1px solid #dbe1ea;
    border-radius: 16px;
    font-size: 15px;
    background: #ffffff;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
    outline: none;
}

.leads-search-bar input:focus {
    border-color: #6C63FF;
    box-shadow: 0 0 0 4px rgba(108, 99, 255, 0.12);
}

/* ==========================================
   LEADS ANALYTICS — COMPACT CHARTS
========================================== */

.leads-charts-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 18px !important;
}

.lead-chart-card {
    min-height: 280px !important;
    max-height: 340px !important;
    overflow: hidden !important;
}

.lead-chart-card canvas {
    max-height: 240px !important;
}

/* ==========================================
   LEADS GLOBAL V2 — COMPACT VISUAL VIEW
========================================== */

.leads-search-bar--hidden {
    display: none;
}

.leads-analytics-section {
    margin: 0 0 22px;
    padding: 16px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
}

.leads-analytics-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 14px;
}

.leads-analytics-header h2 {
    margin: 0;
    font-size: 18px;
}

.leads-analytics-header p {
    margin: 3px 0 0;
    font-size: 13px;
    color: #64748b;
}

.leads-period-selector {
    display: inline-flex;
    flex: 0 0 auto;
    gap: 4px;
    padding: 4px;
    background: #e5e7eb;
    border-radius: 8px;
}

.leads-period-selector button {
    border: none;
    border-radius: 6px;
    padding: 7px 10px;
    background: transparent;
    color: #475569;
    cursor: pointer;
    font-size: 12px;
    font-weight: 800;
}

.leads-period-selector button.active {
    background: #ffffff;
    color: #111827;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.12);
}

.leads-kpis-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.lead-kpi-card {
    border-radius: 8px;
    padding: 12px 14px;
}

.lead-kpi-card span {
    margin-bottom: 4px;
    font-size: 12px;
    font-weight: 700;
}

.lead-kpi-card strong {
    font-size: 24px;
}

.leads-charts-grid {
    gap: 14px !important;
    margin-bottom: 14px;
}

.lead-chart-card {
    min-height: 220px !important;
    max-height: 270px !important;
    border-radius: 8px;
    padding: 14px;
}

.lead-chart-card h3 {
    margin: 0 0 8px;
    font-size: 14px;
}

.lead-chart-card canvas {
    max-height: 185px !important;
}

.lead-report-table-card {
    border-radius: 8px;
    padding: 14px;
}

.lead-report-table-card h3 {
    margin: 0 0 10px;
    padding: 0;
    background: transparent;
    color: #111827;
    font-size: 15px;
}

.lead-report-table thead th {
    background: #111827;
    color: #ffffff;
    border-bottom: none;
}

.lead-report-table thead th:first-child {
    border-top-left-radius: 8px;
}

.lead-report-table thead th:last-child {
    border-top-right-radius: 8px;
}

.lead-report-table th,
.lead-report-table td {
    padding: 10px 12px;
}

.lead-report-table th button {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: none;
    padding: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
    font: inherit;
    font-weight: 800;
}

.lead-report-table th button:hover {
    color: #e5e7eb;
}

.leads-module {
    padding: 18px;
    border-radius: 12px;
}

.leads-module .leads-kanban {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
    overflow-x: visible;
    padding-bottom: 0;
}

.leads-module .lead-column {
    min-width: 0;
    min-height: 390px;
    padding: 10px;
    border-radius: 10px;
}

.leads-module .lead-column-header {
    padding: 8px 9px;
    border-radius: 8px;
    margin-bottom: 10px;
    font-size: 12px;
}

.leads-module .lead-column-body {
    min-height: 310px;
}

.leads-module .lead-card {
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 10px;
}

.leads-module .lead-card h4 {
    margin-bottom: 7px;
    font-size: 13px;
}

.leads-module .lead-card p {
    margin: 3px 0;
    font-size: 11px;
}

.leads-module .lead-probability {
    margin-top: 7px;
    font-size: 11px;
}

.leads-module .lead-status-select {
    margin-top: 8px;
    padding: 7px;
    border-radius: 8px;
    font-size: 12px;
}

.leads-module .lead-card .primary-btn,
.leads-module .lead-card .secondary-btn {
    width: 100%;
    margin-top: 8px;
    padding: 7px 8px;
    font-size: 11px;
}

.leads-header {
    margin-bottom: 18px;
}

.leads-header h2 {
    font-size: 22px;
}

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

.primary-btn,
.secondary-btn {
    border-radius: 8px;
    padding: 9px 14px;
}

.lead-360-btn {
    min-width: 56px;
}

.leads-main-view {
    width: 100%;
}

.leads-360-screen {
    width: 100%;
    min-height: 680px;
    padding: 18px;
    background: #f4f6fb;
    border-radius: 12px;
}

.leads-360-screen {
    margin-bottom: 18px;
    padding: 14px;
    background: #f4f6fb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.leads-360-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}

.leads-360-header h2,
.leads-360-header h3 {
    margin: 0;
    font-size: 24px;
    color: #111827;
}

.leads-360-header p {
    margin: 3px 0 0;
    color: #64748b;
    font-size: 13px;
}

.leads-360-back-btn {
    margin-bottom: 12px;
}

.leads-360-analytics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 14px;
}

.leads-360-analytics .lead-chart-card {
    min-height: 260px !important;
}

.leads-360-analytics canvas {
    max-height: 190px !important;
}

.leads-360-tabs {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    background: #e5e7eb;
    border-radius: 8px;
}

.leads-360-tabs button {
    border: none;
    border-radius: 6px;
    padding: 8px 12px;
    background: transparent;
    color: #475569;
    cursor: pointer;
    font-size: 12px;
    font-weight: 800;
}

.leads-360-tabs button.active {
    background: #ffffff;
    color: #111827;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.12);
}

.leads-360-history-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.leads-360-history-toolbar label {
    color: #475569;
    font-size: 12px;
    font-weight: 800;
}

.leads-360-history-toolbar select {
    min-width: 110px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 8px 10px;
    background: #ffffff;
    color: #111827;
    font-size: 13px;
    font-weight: 800;
}

.leads-360-note {
    min-height: 18px;
    margin: 0 0 10px;
    color: #64748b;
    font-size: 12px;
}

.leads-360-grid-wrap {
    width: 100%;
    overflow-x: auto;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.leads-360-grid {
    width: 100%;
    min-width: 1080px;
    border-collapse: collapse;
    background: #ffffff;
}

.leads-360-grid th,
.leads-360-grid td {
    padding: 10px 12px;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
    vertical-align: middle;
    color: #111827;
    font-size: 13px;
}

.leads-360-grid th {
    background: #111827;
    color: #ffffff;
    white-space: nowrap;
}

.leads-360-grid th button {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: none;
    padding: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
    font: inherit;
    font-weight: 800;
}

.leads-360-grid tbody tr:hover {
    background: #f8fafc;
}

.leads-360-empty-cell {
    height: 120px;
    text-align: center !important;
    color: #64748b !important;
    font-weight: 800;
}

.leads-360-status {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 3px 8px;
    border-radius: 999px;
    background: #eef2ff;
    color: #3730a3;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.leads-360-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.leads-360-actions .primary-btn,
.leads-360-actions .secondary-btn {
    padding: 7px 9px;
    font-size: 12px;
}

.leads-year-selector,
.leads-month-selector {
    min-width: 118px;
    border: none;
    border-radius: 6px;
    padding: 7px 10px;
    background: #ffffff;
    color: #111827;
    font-size: 12px;
    font-weight: 800;
    outline: none;
}

.leads-period-note {
    min-height: 18px;
    margin: -6px 0 12px;
    color: #64748b;
    font-size: 12px;
}

@media (max-width: 900px) {
    .leads-analytics-header,
    .leads-header,
    .leads-360-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .leads-charts-grid {
        grid-template-columns: 1fr !important;
    }

    .leads-360-analytics {
        grid-template-columns: 1fr;
    }

    .leads-module .leads-kanban {
        grid-template-columns: repeat(5, 220px);
        overflow-x: auto;
    }
}
