/* path: crm.css */

/* ==============================================
   WELISSE CRM - Kiegészítő stílusok
   ============================================== */

/* Hero (vékony) */
.crm-hero {
    padding: 8rem 2rem 4rem;
    text-align: center;
    background: var(--bg-secondary);
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.crm-hero-content h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    margin-bottom: 1rem;
}

.crm-hero-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 700px;
    margin: 0 auto;
}

/* CRM Section */
.crm-section {
    padding: 2rem 1rem;
}

.crm-container {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 2rem;
    max-width: 1600px;
    margin: 0 auto;
}

/* Sidebar (bal oszlop) */
.crm-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.widget {
    background: var(--bg-card);
    border: 1px solid rgba(148, 163, 184, 0.1);
    border-radius: 16px;
    padding: 1.5rem;
}

.widget h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

/* Mai teendők widget */
.today-tasks-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.today-tasks-list li {
    padding: 0.75rem;
    background: rgba(56, 189, 248, 0.05);
    border-left: 3px solid var(--accent-blue);
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.today-tasks-list li.empty-state {
    background: rgba(148, 163, 184, 0.05);
    border-left-color: rgba(148, 163, 184, 0.3);
    font-style: italic;
}

/* Sidebar Actions */
.sidebar-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Filters */
.filters-widget .filter-group {
    margin-bottom: 1rem;
}

.filters-widget label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.filter-select option {
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 0.75rem;
}

.filter-select {
    color: var(--text-primary) !important;
    background: rgba(148, 163, 184, 0.05) !important;
}

select {
    color: var(--text-primary) !important;
    background: rgba(148, 163, 184, 0.05) !important;
}

select option {
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 0.5rem;
}

/* Focus állapot */
select:focus {
    background: rgba(56, 189, 248, 0.1) !important;
    color: var(--text-primary) !important;
}

.filter-select,
.filter-input {
    width: 100%;
    padding: 0.6rem;
    background: rgba(148, 163, 184, 0.05);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: var(--transition);
}

.filter-select:focus,
.filter-input:focus {
    outline: none;
    border-color: var(--accent-blue);
    background: rgba(56, 189, 248, 0.05);
}

/* Pipeline */
.pipeline-columns {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.pipeline-column {
    background: rgba(148, 163, 184, 0.03);
    border: 1px solid rgba(148, 163, 184, 0.1);
    border-radius: 12px;
    overflow: hidden;
}

.pipeline-header {
    background: rgba(56, 189, 248, 0.1);
    padding: 0.75rem 1rem;
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-primary);
}

.pipeline-count {
    background: var(--accent-blue);
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.8rem;
}

.pipeline-body {
    padding: 0.75rem;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.pipeline-body.drag-over {
    background: rgba(56, 189, 248, 0.1);
    outline: 2px dashed var(--accent-blue);
    outline-offset: -4px;
}

.pipeline-card {
    background: var(--bg-card);
    padding: 0.75rem;
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    cursor: grab;
    transition: var(--transition);
    font-size: 0.85rem;
}

.pipeline-card:hover {
    border-color: var(--accent-blue);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(56, 189, 248, 0.2);
}

.pipeline-card.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.pipeline-card strong {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.pipeline-card span {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* CRM Main (jobb oszlop) */
.crm-main {
    position: relative;
}

/* Lead Lista Táblázat */
.leads-table-container {
    background: var(--bg-card);
    border: 1px solid rgba(148, 163, 184, 0.1);
    border-radius: 16px;
    padding: 1.5rem;
    overflow-x: auto;
}

.leads-table-container h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.leads-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.leads-table thead {
    background: rgba(56, 189, 248, 0.1);
    position: sticky;
    top: 0;
    z-index: 10;
}

.leads-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 2px solid rgba(148, 163, 184, 0.2);
}

.leads-table tbody tr {
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
    transition: var(--transition);
    cursor: pointer;
}

.leads-table tbody tr:hover {
    background: rgba(56, 189, 248, 0.05);
}

.leads-table tbody tr.empty-state {
    cursor: default;
}

.leads-table tbody tr.empty-state:hover {
    background: transparent;
}

.leads-table td {
    padding: 1rem;
    color: var(--text-secondary);
}

.leads-table td:first-child {
    color: var(--text-primary);
    font-weight: 600;
}

.status-badge {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-badge.kerelmek {
    background: rgba(148, 163, 184, 0.2);
    color: var(--text-secondary);
}

.status-badge.kapcsolatfelvetelre-var {
    background: rgba(56, 189, 248, 0.2);
    color: var(--accent-blue);
}

.status-badge.folyamatban {
    background: rgba(129, 140, 248, 0.2);
    color: var(--accent-purple);
}

.status-badge.nyert {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.status-badge.elveszett {
    background: rgba(244, 114, 182, 0.2);
    color: var(--accent-pink);
}

.priority-badge {
    display: inline-block;
    padding: 0.3rem 0.6rem;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
}

.priority-badge.alacsony {
    background: rgba(148, 163, 184, 0.2);
    color: var(--text-secondary);
}

.priority-badge.kozepes {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
}

.priority-badge.magas {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

/* Lead Detail Panel (slide-over) */
.lead-detail-panel {
    position: fixed;
    right: 0;
    top: 80px;
    width: 500px;
    max-width: 90vw;
    height: calc(100vh - 80px);
    background: var(--bg-card);
    border-left: 1px solid rgba(148, 163, 184, 0.2);
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.3);
    transform: translateX(100%);
    transition: transform 0.3s ease-out;
    z-index: 999;
    overflow-y: auto;
}

.lead-detail-panel[aria-hidden="false"] {
    transform: translateX(0);
}

.panel-header {
    position: sticky;
    top: 0;
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
}

.panel-header h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.3rem;
    color: var(--text-primary);
    margin: 0;
}


/* Panel bezárás gombok - Desktop és Mobil */

/* Desktop X gomb */
.panel-close-desktop {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(148, 163, 184, 0.1);
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.panel-close-desktop:hover {
    background: rgba(244, 114, 182, 0.2);
    color: var(--accent-pink);
}

/* Mobil vissza gomb - alapértelmezetten rejtett */
.panel-back-mobile {
    display: none;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: rgba(56, 189, 248, 0.15);
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: 8px;
    color: var(--accent-blue);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}

.panel-back-mobile:hover,
.panel-back-mobile:active {
    background: rgba(56, 189, 248, 0.25);
    border-color: var(--accent-blue);
}

.back-arrow {
    font-size: 1.2rem;
    line-height: 1;
}

.back-text {
    font-size: 0.9rem;
}

.panel-body {
    padding: 1.5rem;
}

.panel-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.panel-section:last-child {
    border-bottom: none;
}

.panel-section h4 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.panel-info {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.panel-info p {
    display: flex;
    gap: 0.5rem;
    font-size: 0.9rem;
    line-height: 1.6;
}

.panel-info strong {
    min-width: 120px;
    color: var(--text-secondary);
}

.panel-info span {
    color: var(--text-primary);
    flex: 1;
}

.panel-section .secondary-btn {
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

.danger-btn {
    background: rgba(239, 68, 68, 0.1) !important;
    color: #ef4444 !important;
    border-color: rgba(239, 68, 68, 0.3) !important;
}

.danger-btn:hover {
    background: rgba(239, 68, 68, 0.2) !important;
}

/* Activity Feed */
.activity-feed {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1rem;
}

.activity-item {
    padding: 1rem;
    background: rgba(148, 163, 184, 0.05);
    border-left: 3px solid var(--accent-blue);
    border-radius: 8px;
}

.activity-item.note {
    border-left-color: var(--accent-purple);
}

.activity-item.email {
    border-left-color: #22c55e;
}

.activity-item.status_change {
    border-left-color: #fbbf24;
}

.activity-item.ai_summary,
.activity-item.ai_reply,
.activity-item.ai_qualification,
.activity-item.ai_tasks {
    border-left-color: var(--accent-pink);
}

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

.activity-type {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.activity-time {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.activity-content {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    white-space: pre-wrap;
}

.activity-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* AI Panel */
.ai-panel {
    background: rgba(129, 140, 248, 0.05);
    border: 1px solid rgba(129, 140, 248, 0.2);
    border-radius: 12px;
    padding: 1.5rem;
}

.ai-feature {
    margin-bottom: 1.5rem;
}

.ai-feature:last-child {
    margin-bottom: 0;
}

.ai-feature h5 {
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.ai-feature textarea {
    width: 100%;
    padding: 0.75rem;
    background: rgba(148, 163, 184, 0.05);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    resize: vertical;
}

.ai-feature textarea:focus {
    outline: none;
    border-color: var(--accent-blue);
}

.ai-output {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(56, 189, 248, 0.05);
    border: 1px solid rgba(56, 189, 248, 0.2);
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    white-space: pre-wrap;
    display: none;
}

.ai-output.show {
    display: block;
}

.ai-output.loading {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--accent-blue);
}

.ai-output.loading::before {
    content: '⏳';
    animation: spin 2s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* CRM Forms */
.crm-form .form-group {
    margin-bottom: 1.25rem;
}

.crm-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.crm-form input[type="text"],
.crm-form input[type="email"],
.crm-form input[type="tel"],
.crm-form input[type="date"],
.crm-form select,
.crm-form textarea {
    width: 100%;
    padding: 0.75rem;
    background: rgba(148, 163, 184, 0.05);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    transition: var(--transition);
}

.crm-form input:focus,
.crm-form select:focus,
.crm-form textarea:focus {
    outline: none;
    border-color: var(--accent-blue);
    background: rgba(56, 189, 248, 0.05);
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    background: var(--bg-card);
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    color: var(--text-primary);
    font-weight: 600;
    z-index: 10000;
    transform: translateY(150%);
    transition: transform 0.3s ease-out;
}

.toast.show {
    transform: translateY(0);
}

.toast.success {
    border-color: rgba(34, 197, 94, 0.5);
    background: rgba(34, 197, 94, 0.1);
}

.toast.error {
    border-color: rgba(239, 68, 68, 0.5);
    background: rgba(239, 68, 68, 0.1);
}

/* Empty States */
.empty-state {
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
    padding: 2rem;
}

/* ==============================================
   MOBIL RESZPONZIVITÁS - TELJES JAVÍTÁS
   ============================================== */

/* Alap mobilos javítások */
@media (max-width: 1024px) {
    .crm-container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .crm-sidebar {
        order: 2;
    }
    
    .crm-main {
        order: 1;
    }
    
    .lead-detail-panel {
        width: 100%;
        max-width: 100vw;
        left: 0;
        right: 0;
    }
    
    .pipeline-columns {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
}

/* Tablet és kisebb laptopok */
@media (max-width: 768px) {
    /* Hero */
    .crm-hero {
        padding: 6rem 1rem 3rem;
    }
    
    .crm-hero-content h1 {
        font-size: 2rem;
    }
    
    .crm-hero-subtitle {
        font-size: 0.95rem;
        padding: 0 1rem;
    }
    
    /* Section */
    .crm-section {
        padding: 1.5rem 1rem;
    }
    
    .crm-container {
        gap: 1.5rem;
    }
    
    /* Sidebar */
    .sidebar-actions {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .sidebar-actions .cta-button,
    .sidebar-actions .secondary-btn {
        width: 100%;
        padding: 0.85rem 1rem;
    }
    
    /* Pipeline - 1 oszlopos */
    .pipeline-columns {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .pipeline-header {
        font-size: 0.9rem;
        padding: 0.7rem 1rem;
    }
    
    .pipeline-card {
        font-size: 0.85rem;
        padding: 0.7rem;
    }
    
    /* Táblázat container */
    .leads-table-container {
        overflow-x: auto;
        padding: 1rem;
        /* KRITIKUS: Ne engedje kilógni a táblázatot */
        max-width: 100%;
        -webkit-overflow-scrolling: touch;
    }
    
    .leads-table-container h2 {
        font-size: 1.3rem;
        margin-bottom: 1rem;
    }
    
    /* Táblázat */
    .leads-table {
        min-width: 650px; /* Görgethetőség */
        font-size: 0.85rem;
    }
    
    .leads-table th,
    .leads-table td {
        padding: 0.75rem 0.5rem;
        white-space: nowrap;
    }
    
    /* Lead panel */
    .lead-detail-panel {
        top: 60px;
        height: calc(100vh - 60px);
    }
    
    .panel-header {
        padding: 1rem;
    }
    
    .panel-header h3 {
        font-size: 1.1rem;
    }
    
    .panel-body {
        padding: 1rem;
    }
    
    /* Widgetek */
    .widget {
        padding: 1.25rem;
    }
    
    .widget h3 {
        font-size: 1rem;
    }
}

/* Mobilok (Samsung Galaxy S8+, iPhone 12 stb.) */
@media (max-width: 480px) {
    /* KRITIKUS: Body overflow fix */
    body {
        overflow-x: hidden;
    }
    
    /* Hero - Kompakt */
    .crm-hero {
        padding: 5rem 0.75rem 2rem;
    }
    
    .crm-hero-content h1 {
        font-size: 1.75rem;
        line-height: 1.2;
    }
    
    .crm-hero-subtitle {
        font-size: 0.9rem;
        padding: 0 0.5rem;
    }
    
    /* Section padding - ne lógjon ki */
    .crm-section {
        padding: 1rem 0.75rem;
    }
    
    .crm-container {
        gap: 1rem;
        /* KRITIKUS: Max szélesség */
        max-width: 100%;
        padding: 0;
    }
    
    /* Widgetek - ne lógjanak ki */
    .widget {
        padding: 0.875rem;
        border-radius: 12px;
        /* KRITIKUS */
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .widget h3 {
        font-size: 0.95rem;
        margin-bottom: 0.75rem;
    }
    
    /* Mai teendők */
    .today-tasks-list {
        gap: 0.5rem;
    }
    
    .today-tasks-list li {
        padding: 0.625rem;
        font-size: 0.8rem;
    }
    
    /* Gombok - teljes szélesség */
    .cta-button,
    .secondary-btn {
        width: 100%;
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
        /* KRITIKUS */
        box-sizing: border-box;
    }
    
    /* Pipeline - ne lógjon ki */
    .pipeline-widget {
        /* KRITIKUS */
        overflow: hidden;
    }
    
    .pipeline-columns {
        gap: 0.625rem;
    }
    
    .pipeline-header {
        font-size: 0.8rem;
        padding: 0.5rem 0.75rem;
    }
    
    .pipeline-count {
        padding: 0.15rem 0.4rem;
        font-size: 0.7rem;
    }
    
    .pipeline-body {
        padding: 0.5rem;
        min-height: 60px;
    }
    
    .pipeline-card {
        padding: 0.5rem;
        font-size: 0.75rem;
    }
    
    .pipeline-card strong {
        font-size: 0.8rem;
        margin-bottom: 0.2rem;
    }
    
    .pipeline-card span {
        font-size: 0.7rem;
    }
    
    /* Táblázat container - KRITIKUS FIX */
    .leads-table-container {
        padding: 0.75rem;
        border-radius: 12px;
        /* KRITIKUS: Horizontal scroll engedélyezése */
        overflow-x: auto;
        overflow-y: visible;
        max-width: 100vw;
        margin: 0 -0.75rem; /* Kompenzálja a section paddinget */
        padding: 0.75rem;
        box-sizing: border-box;
    }
    
    .leads-table-container h2 {
        font-size: 1.1rem;
        margin-bottom: 0.875rem;
        padding: 0 0.25rem;
    }
    
    /* Táblázat - görgethetőség */
    .leads-table {
        min-width: 600px; /* Biztosítja a horizontal scrollt */
        font-size: 0.75rem;
        width: auto;
    }
    
    .leads-table th,
    .leads-table td {
        padding: 0.5rem 0.4rem;
        white-space: nowrap;
    }
    
    .status-badge,
    .priority-badge {
        font-size: 0.7rem;
        padding: 0.25rem 0.5rem;
        white-space: nowrap;
    }
    
    /* Lead panel - teljes képernyő */
    .lead-detail-panel {
        top: 0;
        height: 100vh;
        width: 100vw;
        max-width: 100vw;
        border-radius: 0;
    }
    
    .panel-header {
        padding: 0.75rem 1rem;
        position: sticky;
        top: 0;
        z-index: 100;
    }
    
    .panel-header h3 {
        font-size: 1rem;
    }
    
    .panel-close {
        width: 32px;
        height: 32px;
        font-size: 1.3rem;
    }
    
    .panel-body {
        padding: 0.875rem;
    }
    
    .panel-section {
        margin-bottom: 1.25rem;
        padding-bottom: 1.25rem;
    }
    
    .panel-section h4 {
        font-size: 0.95rem;
        margin-bottom: 0.75rem;
    }
    
    /* Panel info - stack */
    .panel-info p {
        font-size: 0.8rem;
        flex-direction: column;
        gap: 0.2rem;
        align-items: flex-start;
    }
    
    .panel-info strong {
        min-width: auto;
        font-size: 0.75rem;
    }
    
    /* Activity feed */
    .activity-feed {
        gap: 0.75rem;
    }
    
    .activity-item {
        padding: 0.625rem;
    }
    
    .activity-type {
        font-size: 0.75rem;
    }
    
    .activity-time {
        font-size: 0.7rem;
    }
    
    .activity-content {
        font-size: 0.8rem;
        line-height: 1.5;
    }
    
    .activity-actions {
        gap: 0.5rem;
        flex-wrap: wrap;
    }
    
    .activity-actions .secondary-btn {
        font-size: 0.8rem;
        padding: 0.5rem 0.75rem;
    }
    
    /* AI Panel */
    .ai-panel {
        padding: 0.875rem;
    }
    
    .ai-feature {
        margin-bottom: 1.25rem;
    }
    
    .ai-feature h5 {
        font-size: 0.875rem;
        margin-bottom: 0.5rem;
    }
    
    .ai-feature textarea {
        padding: 0.625rem;
        font-size: 0.8rem;
        min-height: 80px;
    }
    
    .ai-output {
        padding: 0.75rem;
        font-size: 0.8rem;
        margin-top: 0.75rem;
    }
    
    /* Filters widget */
    .filters-widget .filter-group {
        margin-bottom: 0.75rem;
    }
    
    .filters-widget label {
        font-size: 0.8rem;
        margin-bottom: 0.3rem;
    }
    
    .filter-select,
    .filter-input {
        padding: 0.5rem;
        font-size: 0.8rem;
        box-sizing: border-box;
    }
    
    /* Modálok - teljes képernyő mobilon */
    .modal {
        padding: 0;
    }
    
    .modal-content {
        max-width: 100vw;
        max-height: 100vh;
        height: 100vh;
        margin: 0;
        border-radius: 0;
        padding: 1rem;
        overflow-y: auto;
        box-sizing: border-box;
    }
    
    .modal-content h3 {
        font-size: 1.1rem;
        margin-bottom: 1rem;
    }
    
    .modal-close {
        width: 32px;
        height: 32px;
        font-size: 1.3rem;
    }
    
    /* Form elemek */
    .crm-form .form-group {
        margin-bottom: 0.875rem;
    }
    
    .crm-form label {
        font-size: 0.8rem;
        margin-bottom: 0.3rem;
    }
    
    .crm-form input,
    .crm-form select,
    .crm-form textarea {
        padding: 0.625rem;
        font-size: 0.85rem;
        box-sizing: border-box;
    }
    
    .crm-form textarea {
        min-height: 80px;
    }
    
    /* Toast - ne lógjon ki */
    .toast {
        bottom: 1rem;
        right: 0.75rem;
        left: 0.75rem;
        width: auto;
        max-width: none;
        padding: 0.75rem 1rem;
        font-size: 0.85rem;
        box-sizing: border-box;
    }
}

/* Extra kicsi mobilok (360px szélesség alatti) */
@media (max-width: 360px) {
    .crm-hero-content h1 {
        font-size: 1.5rem;
    }
    
    .crm-hero-subtitle {
        font-size: 0.85rem;
    }
    
    .crm-section {
        padding: 1rem 0.5rem;
    }
    
    .widget {
        padding: 0.75rem;
    }
    
    .widget h3 {
        font-size: 0.9rem;
    }
    
    .cta-button,
    .secondary-btn {
        padding: 0.65rem 0.875rem;
        font-size: 0.85rem;
    }
    
    .leads-table {
        font-size: 0.7rem;
        min-width: 550px;
    }
    
    .leads-table th,
    .leads-table td {
        padding: 0.4rem 0.3rem;
    }
    
    .status-badge,
    .priority-badge {
        font-size: 0.65rem;
        padding: 0.2rem 0.4rem;
    }
    
    .pipeline-header {
        font-size: 0.75rem;
        padding: 0.4rem 0.6rem;
    }
    
    .pipeline-card {
        font-size: 0.7rem;
        padding: 0.4rem;
    }
}

/* Landscape mód (fekvő mobil) */
@media (max-width: 768px) and (orientation: landscape) {
    .crm-hero {
        padding: 4rem 1rem 2rem;
    }
    
    .crm-hero-content h1 {
        font-size: 1.75rem;
    }
    
    .lead-detail-panel {
        width: 60vw;
        max-width: 500px;
    }
    
    .pipeline-columns {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }
    
    .modal-content {
        max-height: 90vh;
        overflow-y: auto;
    }
}

/* Samsung Galaxy S8+ specifikus (360x740) */
@media (max-width: 380px) and (max-height: 760px) {
    .crm-section {
        padding: 0.875rem 0.625rem;
    }
    
    .widget {
        padding: 0.75rem;
        margin-bottom: 0.75rem;
    }
    
    .leads-table-container {
        margin: 0 -0.625rem;
    }
    
    .pipeline-header {
        padding: 0.5rem;
        font-size: 0.8rem;
    }
    
    .pipeline-body {
        padding: 0.4rem;
    }
}

/* Mobilok (Samsung Galaxy S8+, iPhone 12 stb.) */
@media (max-width: 480px) {
    /* ... meglévő kód ... */
    
    /* Panel header - KRITIKUS mobilon */

    .panel-header {
        padding: 0.75rem 1rem;
        position: sticky;
        top: 0;
        z-index: 100;
        background: var(--bg-secondary);
        border-bottom: 2px solid rgba(148, 163, 184, 0.2);
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 1rem;
    }
    
    .panel-header h3 {
        flex: 1;
        font-size: 1rem;
        margin: 0;
        text-align: center;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    /* Mobilon: Vissza gomb látható, X gomb rejtett */
    .panel-back-mobile {
        display: flex; /* LÁTHATÓ */
    }
    
    .panel-close-desktop {
        display: none; /* REJTETT */
    }
}