* {
    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;
}

/* Page de connexion */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-box {
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    padding: 40px;
    width: 100%;
    max-width: 400px;
    position: relative;
}

.login-box h1 {
    color: #333;
    margin-bottom: 10px;
    text-align: center;
}

.subtitle {
    color: #666;
    text-align: center;
    margin-bottom: 30px;
    font-size: 14px;
}

.version-footer {
    text-align: center;
    margin-top: 20px;
    color: #999;
    font-size: 12px;
}

/* Dashboard */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

header h1 {
    color: #333;
    font-size: 24px;
}

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

.header-actions span {
    color: #666;
    font-size: 14px;
}

/* Onglets */
.tabs {
    background: white;
    border-radius: 10px;
    padding: 10px;
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.tab {
    flex: 1;
    padding: 12px 20px;
    border: none;
    background: #f8f9fa;
    color: #666;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
}

.tab:hover {
    background: #e9ecef;
}

.tab.active {
    background: #667eea;
    color: white;
}

/* Toolbar */
.toolbar {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.search-form {
    display: flex;
    gap: 10px;
    flex: 1;
    max-width: 700px;
}

.search-form input {
    flex: 1;
}

.filter-select {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

/* Table */
.contacts-table {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: #f8f9fa;
}

th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #dee2e6;
    white-space: nowrap;
}

td {
    padding: 15px;
    border-bottom: 1px solid #e9ecef;
}

tbody tr:hover {
    background: #f8f9fa;
}

.actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.no-results {
    text-align: center;
    padding: 40px;
    color: #666;
}

.contact-count {
    margin-top: 15px;
    text-align: right;
    color: #666;
    font-size: 14px;
}

.text-muted {
    color: #6c757d;
    font-size: 12px;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-warning {
    background: #fff3cd;
    color: #856404;
}

.badge-danger {
    background: #f8d7da;
    color: #721c24;
}

.badge-info {
    background: #d1ecf1;
    color: #0c5460;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.pagination-info {
    color: #666;
    font-size: 14px;
}

/* Call blocks (v1.2) - Compact */
.calls-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.call-block {
    background: white;
    border-radius: 6px;
    padding: 10px 14px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    border-left: 3px solid #667eea;
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.call-active {
    border-left-color: #17a2b8;
    background: #f8fdff;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.9; }
}

.call-info {
    flex: 0 0 auto;
    min-width: 250px;
}

.call-date {
    color: #666;
    font-size: 13px;
    margin-bottom: 8px;
    font-weight: 500;
}

.call-source {
    font-size: 15px;
    margin-bottom: 8px;
    line-height: 1.4;
}

.call-source strong {
    color: #333;
    display: block;
    margin-bottom: 3px;
}

.call-dest {
    color: #764ba2;
    font-size: 14px;
    font-weight: 500;
}

/* Call path - Vertical */
.call-path {
    flex: 1;
    padding: 0 15px;
    border-left: 1px solid #e9ecef;
    border-right: 1px solid #e9ecef;
}

.path-title {
    font-size: 12px;
    color: #999;
    margin-bottom: 6px;
    text-transform: uppercase;
    font-weight: 600;
}

.path-steps {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.path-step {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
}

.step-time {
    font-weight: 600;
    color: #667eea;
}

.step-action {
    color: #555;
}

.step-duration {
    color: #764ba2;
    font-weight: 500;
}

.call-summary {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    min-width: 130px;
}

.call-duration {
    color: #666;
    font-size: 13px;
    font-weight: 500;
}

/* Footer */
.app-footer {
    background: white;
    border-radius: 10px;
    padding: 15px;
    margin-top: 20px;
    text-align: center;
    color: #666;
    font-size: 13px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #333;
    font-weight: 500;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.form-group input:focus, .form-group select:focus {
    outline: none;
    border-color: #667eea;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s;
    white-space: nowrap;
}

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

.btn-primary:hover {
    background: #5568d3;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

/* Alerts */
.alert {
    padding: 12px 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
}

.modal-content {
    background: white;
    margin: 10% auto;
    padding: 30px;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
}

.modal-content h2 {
    margin-bottom: 20px;
    color: #333;
}

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

.form-actions button {
    flex: 1;
}

/* Responsive */
@media (max-width: 768px) {
    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .search-form {
        max-width: 100%;
        flex-wrap: wrap;
    }

    header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .header-actions {
        flex-direction: column;
    }

    table {
        font-size: 13px;
    }

    th, td {
        padding: 10px 5px;
    }

    .actions {
        flex-direction: column;
    }

    .pagination {
        flex-direction: column;
        gap: 10px;
    }
}

/* Bouton discret d'ajout à l'annuaire */
.btn-add-contact {
    background: none;
    border: none;
    color: #bbb;
    font-size: 16px;
    cursor: pointer;
    padding: 0 5px;
    margin-left: 5px;
    transition: color 0.2s;
    line-height: 1;
}

.btn-add-contact:hover {
    color: #667eea;
}
