/* ========================================
   DASHBOARD SECTIONS STYLES
   Leads, Agenda, Analytics
   ======================================== */

/* ========================================
   LEADS SECTION
   ======================================== */

.leads-stats {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.leads-stats-premium {
    gap: 1.1rem;
}

.lead-stat-card {
    background: #13131c;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 5px;
    padding: 1.4rem;
    text-align: center;
    border-left: 3px solid;
    transition: all 0.22s ease;
    position: relative;
    overflow: hidden;
}

.lead-stat-icon {
    font-size: 1.1rem;
    margin-bottom: 0.6rem;
    opacity: 0.7;
}

.lead-stat-card.new .lead-stat-icon { color: #4a9eff; }
.lead-stat-card.contact .lead-stat-icon { color: #00c896; }
.lead-stat-card.qualified .lead-stat-icon { color: #a78bfa; }
.lead-stat-card.negotiation .lead-stat-icon { color: #f6ad55; }
.lead-stat-card.converted .lead-stat-icon { color: #10b981; }

.lead-stat-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    opacity: 0.4;
    transition: opacity 0.3s ease, height 0.3s ease;
}

.lead-stat-card:hover .lead-stat-bar {
    opacity: 0.7;
    height: 4px;
}

.lead-stat-card.new .lead-stat-bar { background: #4a9eff; }
.lead-stat-card.contact .lead-stat-bar { background: #00c896; }
.lead-stat-card.qualified .lead-stat-bar { background: #a78bfa; }
.lead-stat-card.negotiation .lead-stat-bar { background: #f6ad55; }
.lead-stat-card.converted .lead-stat-bar { background: #10b981; }

.lead-stat-card:hover {
    background: #16161f;
    border-color: rgba(255, 255, 255, 0.14);
}

.lead-stat-card.new { border-left-color: #4a9eff; }
.lead-stat-card.contact { border-left-color: #00c896; }
.lead-stat-card.qualified { border-left-color: #a78bfa; }
.lead-stat-card.negotiation { border-left-color: #f6ad55; }
.lead-stat-card.converted { border-left-color: #10b981; }

.stat-number {
    font-size: 2.2rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 0.4rem;
    letter-spacing: -0.03em;
    line-height: 1;
}

.stat-label {
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.leads-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    align-items: center;
}

.leads-controls .search-box {
    flex: 1;
}

.leads-table-container {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow-x: auto;
}

.leads-table {
    width: 100%;
    border-collapse: collapse;
}

.leads-table thead {
    background: #f9fafb;
}

.leads-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: #1f2937;
    font-size: 0.875rem;
    border-bottom: 2px solid #e5e7eb;
}

.leads-table td {
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
    font-size: 0.875rem;
    color: #1f2937;
}

.lead-name-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.lead-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(74, 158, 255, 0.12);
    border: 1px solid rgba(74, 158, 255, 0.25);
    color: #4a9eff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
}

.lead-contact {
    font-size: 0.75rem;
    color: #6b7280;
}

.lead-contact i {
    width: 14px;
    color: #667eea;
}

.lead-source {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.lead-source.website {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

.lead-source.whatsapp {
    background: rgba(37, 211, 102, 0.1);
    color: #25d366;
}

.lead-source.phone {
    background: rgba(56, 239, 125, 0.1);
    color: #38ef7d;
}

.lead-badge {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.lead-badge.new {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

.lead-badge.contacted {
    background: rgba(56, 239, 125, 0.1);
    color: #38ef7d;
}

.lead-badge.qualified {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
}

.lead-badge.visit_scheduled {
    background: rgba(6, 182, 212, 0.1);
    color: #06b6d4;
}

.lead-badge.visit_done {
    background: rgba(20, 184, 166, 0.1);
    color: #14b8a6;
}

.lead-badge.proposal {
    background: rgba(249, 115, 22, 0.1);
    color: #f97316;
}

.lead-badge.negotiation {
    background: rgba(255, 217, 61, 0.2);
    color: #f59e0b;
}

.lead-badge.documentation {
    background: rgba(168, 85, 247, 0.1);
    color: #a855f7;
}

.lead-badge.converted {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.lead-badge.lost {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

/* ========================================
   VIEW TOGGLE (Table/Pipeline)
   ======================================== */

.leads-view-toggle {
    display: flex;
    gap: 2px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    padding: 2px;
    border: 1px solid rgba(212, 175, 55, 0.15);
}

.leads-view-toggle .view-btn {
    padding: 6px 12px;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.leads-view-toggle .view-btn:hover {
    color: rgba(255, 255, 255, 0.8);
}

.leads-view-toggle .view-btn.active {
    background: rgba(212, 175, 55, 0.2);
    color: #d4af37;
}

/* ========================================
   KANBAN PIPELINE
   ======================================== */

.leads-pipeline {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 1rem;
    min-height: 400px;
    scrollbar-width: thin;
    scrollbar-color: rgba(212,175,55,0.3) transparent;
}

.leads-pipeline::-webkit-scrollbar {
    height: 6px;
}
.leads-pipeline::-webkit-scrollbar-thumb {
    background: rgba(212,175,55,0.3);
    border-radius: 3px;
}

.pipeline-column {
    min-width: 220px;
    max-width: 220px;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    transition: border-color 0.2s ease;
}

.pipeline-column.drag-over {
    border-color: rgba(212, 175, 55, 0.5);
    background: rgba(212, 175, 55, 0.05);
}

.pipeline-column-header {
    padding: 12px;
    border-bottom: 2px solid var(--col-color, #667eea);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pipeline-col-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.85);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.pipeline-col-title i {
    color: var(--col-color, #667eea);
    font-size: 0.85rem;
}

.pipeline-col-count {
    background: var(--col-color, #667eea);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    min-width: 22px;
    text-align: center;
}

.pipeline-column-body {
    padding: 8px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    max-height: 500px;
}

.pipeline-empty {
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.75rem;
    text-align: center;
    padding: 2rem 0.5rem;
    font-style: italic;
}

.pipeline-card {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 10px;
    cursor: grab;
    transition: all 0.2s ease;
}

.pipeline-card:active {
    cursor: grabbing;
    opacity: 0.7;
}

.pipeline-card:hover {
    border-color: rgba(212, 175, 55, 0.3);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transform: translateY(-1px);
}

.pipeline-card-name {
    font-weight: 700;
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pipeline-card-interest {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.45);
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pipeline-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.pipeline-card-source {
    font-size: 0.65rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.pipeline-card-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.pipeline-card:hover .pipeline-card-actions {
    opacity: 1;
}

.pipeline-card-actions .btn-icon {
    padding: 3px 5px;
    font-size: 0.7rem;
}

/* ========================================
   AGENDA SECTION
   ======================================== */

.agenda-layout {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 1.5rem;
}

.calendar-section {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.calendar-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.calendar-day-header {
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    padding: 0.5rem;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 0.875rem;
    color: #1f2937;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
}

.calendar-day.muted {
    color: #9ca3af;
}

.calendar-day:hover {
    background: #f3f4f6;
}

.calendar-day.today {
    background: rgba(212, 175, 55, 0.18);
    border: 1px solid rgba(212, 175, 55, 0.5);
    color: #d4af37;
    font-weight: 600;
}

.calendar-day.selected {
    outline: 2px solid #667eea;
    outline-offset: 1px;
    background: rgba(102, 126, 234, 0.14);
}

.calendar-day.has-event {
    font-weight: 600;
}

.event-dot {
    position: absolute;
    bottom: 4px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #667eea;
}

.calendar-day.today .event-dot {
    background: white;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

.appointments-section {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.appointments-section h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 1.5rem;
}

.appointments-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.appointment-card {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    border-radius: 12px;
    background: #f9fafb;
    border-left: 4px solid #e5e7eb;
    transition: all 0.3s ease;
}

.appointment-card:hover {
    background: #f3f4f6;
    transform: translateX(4px);
}

.appointment-card.today {
    border-left-color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

.appointment-time {
    flex-shrink: 0;
    text-align: center;
    min-width: 70px;
}

.appointment-time .time {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1f2937;
}

.appointment-time .date {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

.appointment-content {
    flex: 1;
}

.appointment-content h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 0.5rem 0;
}

.appointment-content p {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0.25rem 0;
}

.appointment-content i {
    width: 16px;
    color: #667eea;
}

.appointment-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.lead-actions-inline {
    display: flex;
    gap: 0.4rem;
    align-items: center;
}

/* ========================================
   ANALYTICS SECTION
   ======================================== */

.analytics-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.period-selector {
    padding: 0.75rem 1.5rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.875rem;
    color: #1f2937;
    background: white;
    cursor: pointer;
    font-weight: 500;
}

.analytics-metrics {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.analytics-metrics-premium {
    gap: 1.25rem;
}

.analytics-card {
    background: #13131c;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 5px;
    padding: 1.5rem;
    display: flex;
    gap: 1rem;
    transition: all 0.22s ease;
    position: relative;
    overflow: hidden;
}

.analytics-card-premium {
    background: #13131c;
    border-left-width: 3px;
}

.analytics-card-shine { display: none; }

.analytics-card-premium:hover .analytics-card-shine { left: 100%; }

.analytics-card:hover {
    background: #16161f;
    border-color: rgba(255, 255, 255, 0.12);
}

.analytics-card-premium:hover {
    background: #16161f;
}

.analytics-card-premium:hover .analytics-icon {
    opacity: 0.8;
}

.analytics-icon {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
    transition: opacity 0.22s ease;
}

.analytics-icon.blue   { background: rgba(74, 158, 255, 0.1);  color: #4a9eff;  border: 1px solid rgba(74, 158, 255, 0.2); }
.analytics-icon.green  { background: rgba(0, 200, 150, 0.1);   color: #00c896;  border: 1px solid rgba(0, 200, 150, 0.2); }
.analytics-icon.purple { background: rgba(167, 139, 250, 0.1); color: #a78bfa;  border: 1px solid rgba(167, 139, 250, 0.2); }
.analytics-icon.orange { background: rgba(246, 173, 85, 0.1);  color: #f6ad55;  border: 1px solid rgba(246, 173, 85, 0.2); }

.analytics-content {
    flex: 1;
    min-width: 0;
}

.analytics-label {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.55);
    margin-bottom: 0.4rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.analytics-value {
    font-size: 1.85rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 0.4rem;
    letter-spacing: -0.025em;
    line-height: 1.1;
}

.analytics-trend {
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.5rem;
    border-radius: 20px;
}

.analytics-trend.positive {
    color: #10b981;
    background: rgba(16, 185, 129, 0.1);
}

.analytics-trend.negative {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.analytics-charts {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.analytics-chart-card {
    background: #13131c;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 5px;
    padding: 1.5rem;
}

.analytics-chart-card h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0 0 1.5rem 0;
}

.analytics-chart-card canvas {
    max-height: 300px;
}

.top-performers-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.top-performers-card {
    background: #13131c;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 5px;
    padding: 1.5rem;
}

.top-performers-card h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0 0 1.5rem 0;
}

.interest-stats-grid {
    margin-top: 1.5rem;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.interest-stat-card {
    background: #13131c;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 5px;
    padding: 1.1rem 1.2rem;
    transition: all 0.22s ease;
}

.interest-stat-card:hover {
    background: #16161f;
    border-color: rgba(255, 255, 255, 0.12);
}

.interest-stat-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.interest-stat-value {
    font-size: 1rem;
    line-height: 1.35;
    font-weight: 700;
    color: #d4af37;
    min-height: 2.7em;
}

.interest-stat-meta {
    margin-top: 0.35rem;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.55);
}

.interest-rankings-grid {
    margin-top: 1.2rem;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.interest-ranking-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    padding: 0.45rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.interest-ranking-label {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.85);
}

.interest-ranking-value {
    font-size: 0.85rem;
    color: #d4af37;
    font-weight: 600;
}

.performers-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.performer-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #f9fafb;
    border-radius: 8px;
}

.rank {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.rank.gold {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #92400e;
}

.rank.silver {
    background: linear-gradient(135deg, #c0c0c0, #e8e8e8);
    color: #374151;
}

.rank.bronze {
    background: linear-gradient(135deg, #cd7f32, #e8a87c);
    color: #78350f;
}

.performer-name {
    flex: 1;
    font-weight: 500;
    color: #1f2937;
}

.performer-value {
    font-weight: 600;
    color: #667eea;
}

/* ========================================
   SHARED ELEMENTS
   ======================================== */

.empty-state-inline {
    text-align: center;
    padding: 3rem 2rem;
    color: #9ca3af;
}

.empty-state-inline i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

.empty-state-inline p {
    font-size: 0.875rem;
    margin: 0;
}

.search-box {
    position: relative;
    flex: 1;
    max-width: 400px;
}

.search-box i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
}

.search-box input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.875rem;
    transition: border-color 0.3s ease;
}

.search-box input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.filter-group {
    display: flex;
    gap: 0.5rem;
}

.filter-group select {
    padding: 0.75rem 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.875rem;
    background: white;
    color: #1f2937;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.filter-group select option {
    color: #1f2937;
    background: #ffffff;
}

.filter-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
}

.btn-icon {
    width: 32px;
    height: 32px;
    border: none;
    background: #f3f4f6;
    color: #6b7280;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.btn-icon:hover {
    background: #e5e7eb;
    color: #1f2937;
}

.btn-icon.success {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.btn-icon.success:hover {
    background: rgba(16, 185, 129, 0.2);
}

.btn-icon.danger {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.btn-icon.danger:hover {
    background: rgba(239, 68, 68, 0.2);
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 1400px) {
    .analytics-charts {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1200px) {
    .agenda-layout {
        grid-template-columns: 1fr;
    }
    
    .analytics-metrics {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .top-performers-section {
        grid-template-columns: 1fr;
    }

    .interest-stats-grid {
        grid-template-columns: 1fr;
    }

    .interest-rankings-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1024px) {
    .leads-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .leads-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .lead-stat-card {
        padding: 1.1rem;
        border-radius: 14px;
    }

    .stat-number {
        font-size: 1.8rem;
    }

    .stat-label {
        font-size: 0.7rem;
    }

    .lead-stat-icon {
        font-size: 0.9rem;
        margin-bottom: 0.4rem;
    }
    
    .leads-controls {
        flex-direction: column;
    }
    
    .search-box {
        max-width: 100%;
    }
    
    .analytics-metrics {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .analytics-card {
        padding: 1.1rem;
        border-radius: 14px;
    }

    .analytics-icon {
        width: 44px;
        height: 44px;
        border-radius: 11px;
        font-size: 1.15rem;
    }

    .analytics-value {
        font-size: 1.5rem;
    }

    .analytics-label {
        font-size: 0.7rem;
    }
    
    .analytics-controls {
        flex-direction: column;
        gap: 1rem;
    }

    .interest-stat-card {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .leads-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .stat-number {
        font-size: 1.5rem;
    }

    .analytics-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.6rem;
    }
}

/* ========================================
   LEAD AGENT BADGE
   ======================================== */

.lead-agent-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.65rem;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 500;
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.lead-agent-badge:hover {
    background: rgba(102, 126, 234, 0.2);
    transform: translateY(-1px);
}

.lead-agent-badge.unassigned {
    background: rgba(156, 163, 175, 0.1);
    color: #9ca3af;
    border: 1px dashed #d1d5db;
}

.lead-agent-badge.unassigned:hover {
    background: rgba(156, 163, 175, 0.2);
    color: #6b7280;
}

/* Pipeline card agent */
.pipeline-card-agent {
    font-size: 0.72rem;
    color: #667eea;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    margin-top: 0.25rem;
}

/* ========================================
   DRAG & DROP STATES
   ======================================== */

/* Card sendo arrastado — fica transparente na posição original */
.pipeline-card.dragging {
    opacity: 0.35;
    transform: scale(0.96);
    border: 1px dashed rgba(212, 175, 55, 0.4);
    background: rgba(212, 175, 55, 0.05);
}

/* Coluna alvo highlight melhorado */
.pipeline-column.drag-over {
    border-color: rgba(212, 175, 55, 0.6) !important;
    background: rgba(212, 175, 55, 0.08) !important;
    box-shadow: inset 0 0 20px rgba(212, 175, 55, 0.06);
}

.pipeline-column.drag-over .pipeline-column-body {
    min-height: 80px;
}

/* Ghost flutuante para touch (mobile) */
.pipeline-card-ghost {
    position: fixed;
    z-index: 10000;
    pointer-events: none;
    opacity: 0.9;
    transform: rotate(2deg) scale(1.04);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4), 0 0 0 2px rgba(212, 175, 55, 0.5);
    border-radius: 10px;
    background: rgba(30, 30, 40, 0.95);
    border: 1px solid rgba(212, 175, 55, 0.4);
    padding: 10px;
    transition: none;
}

/* Transição suave ao re-renderizar pipeline */
.pipeline-column-body {
    transition: background 0.2s ease;
}

/* ========================================
   PUSH TOGGLE SWITCH
   ======================================== */

.push-toggle-wrapper {
    margin-top: 0.75rem;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #d1d5db;
    border-radius: 26px;
    transition: 0.3s;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: 0.3s;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: #667eea;
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(22px);
}

/* ========================================
   WHATSAPP TEMPLATES
   ======================================== */

.whatsapp-templates-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.whatsapp-template-item {
    padding: 0.75rem 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.whatsapp-template-item:hover {
    border-color: #25D366;
    background: rgba(37, 211, 102, 0.04);
    transform: translateY(-1px);
}

.whatsapp-template-name {
    font-weight: 600;
    font-size: 0.875rem;
    color: #1f2937;
    margin-bottom: 0.25rem;
}

.whatsapp-template-preview {
    font-size: 0.78rem;
    color: #6b7280;
    line-height: 1.4;
}

/* ========================================
   WEBHOOK CONFIG ITEMS
   ======================================== */

.webhook-configs-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.webhook-config-item {
    padding: 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #f9fafb;
}

.webhook-config-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.webhook-config-url {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-top: 0.35rem;
    font-size: 0.82rem;
}

.webhook-config-url label {
    font-weight: 600;
    color: #374151;
    min-width: 50px;
}

.webhook-config-url code {
    background: #e5e7eb;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.78rem;
    color: #1f2937;
}

/* ========================================
   MODAL IMPROVEMENTS
   ======================================== */

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
    margin-top: 1rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.875rem;
    transition: border-color 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}
