* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 15px;
    padding-bottom: 80px;
}

.header {
    background: white;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.header h1 {
    color: #667eea;
    font-size: 24px;
    margin-bottom: 10px;
}

.search-bar {
    position: relative;
    margin-top: 15px;
    display: flex;
    gap: 8px;
}

.search-bar input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 16px;
    transition: all 0.3s;
}

.search-bar input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-bar input:disabled {
    background: #f5f5f5;
    cursor: not-allowed;
}

.search-btn {
    padding: 12px 24px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

.search-btn:hover:not(:disabled) {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.search-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.search-hint {
    font-size: 12px;
    color: #666;
    margin-top: 8px;
    font-style: italic;
}

.stats {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.stat-badge {
    flex: 1;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px;
    border-radius: 10px;
    text-align: center;
    font-size: 14px;
}

.stat-badge strong {
    display: block;
    font-size: 20px;
    margin-bottom: 3px;
}

.filter-buttons {
    display: flex;
    gap: 8px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 8px 16px;
    border: 2px solid #667eea;
    background: white;
    color: #667eea;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.filter-btn.active {
    background: #667eea;
    color: white;
}

.filter-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.cards-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.contact-card {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.3s;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
    gap: 15px;
}

.card-title-section {
    flex: 1;
    min-width: 0;
}

.card-name {
    font-size: 20px;
    font-weight: 700;
    color: #333;
    margin-bottom: 5px;
}

.card-domain {
    font-size: 14px;
    color: #666;
    margin-top: 5px;
}

.status-dropdown {
    padding: 8px 12px;
    border: none;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    min-width: 120px;
    text-align: center;
    color: white;
}

.card-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-top: 15px;
    border-top: 1px solid #f0f0f0;
}

.info-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.info-icon {
    font-size: 18px;
    min-width: 24px;
}

.info-content {
    flex: 1;
    font-size: 14px;
    color: #555;
    line-height: 1.5;
}

.info-label {
    font-size: 12px;
    color: #999;
    margin-bottom: 3px;
    text-transform: uppercase;
}

.phone-link {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
}

.cr-content {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 8px;
    font-size: 13px;
    color: #555;
    line-height: 1.6;
}

.card-actions {
    display: flex;
    gap: 8px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #f0f0f0;
}

.btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-edit {
    background: #ffd93d;
    color: #333;
}

.btn-delete {
    background: #ff6b6b;
    color: white;
}

.fab {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: #22C55E;
    border-radius: 50%;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(34, 197, 94, 0.4);
    z-index: 100;
    transition: all 0.3s;
}

.fab:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(34, 197, 94, 0.5);
}

.settings-btn {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: #667eea;
    border-radius: 50%;
    border: none;
    color: white;
    font-size: 22px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    z-index: 100;
    transition: all 0.3s;
}

.settings-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.loading {
    text-align: center;
    padding: 40px;
    color: white;
}

.spinner {
    border: 4px solid rgba(255,255,255,0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.empty-state {
    background: white;
    border-radius: 15px;
    padding: 60px 20px;
    text-align: center;
    color: #999;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: flex-end;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 25px 25px 0 0;
    padding: 25px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.modal-header h2 {
    color: #667eea;
    font-size: 22px;
}

.close-btn {
    background: #f0f0f0;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 600;
    font-size: 14px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    font-family: inherit;
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 25px;
}

.btn-save {
    flex: 2;
    background: #48bb78;
    color: white;
}

.btn-cancel {
    flex: 1;
    background: #e0e0e0;
    color: #333;
}

.config-modal {
    align-items: center;
}

.config-content {
    border-radius: 25px;
    max-width: 500px;
}

.info-box {
    background: #e3f2fd;
    border-left: 4px solid #2196f3;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    color: #1565c0;
    line-height: 1.6;
}

.warning-box {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    color: #856404;
    line-height: 1.6;
}

/* Mobile : 1 carte par ligne */
.cards-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Tablette & Desktop : grille responsive */
@media (min-width: 768px) {
    .cards-container {
        display: grid !important;
        flex-direction: initial;
        grid-template-columns: repeat(auto-fill, minmax(350px, 1fr)) !important;
        gap: 20px;
    }

    .modal {
        align-items: center;
    }
    
    .modal-content {
        border-radius: 25px;
        max-width: 600px;
    }
}