:root {
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --border: #e2e8f0;
    --radius: 12px;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.5;
    padding-bottom: 60px; /* Espace pour la barre mobile si besoin */
}

/* Header & Layouts */
header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-weight: 800;
    font-size: 1.4rem;
    color: var(--primary);
    text-decoration: none;
}

.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

/* Cartes & Tableaux de bord */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

/* Formulaires */
.form-group {
    margin-bottom: 1.25rem;
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-main);
}

input, select, textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    background: #fff;
    transition: border-color 0.2s;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
}

/* Boutons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.2rem;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s;
    font-size: 0.95rem;
}

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: var(--border); color: var(--text-main); }
.btn-secondary:hover { background: #cbd5e1; }
.btn-danger { background: var(--danger); color: white; }

/* Statuts Badge */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
}
.badge-waiting { background: #fef3c7; color: #d97706; }
.badge-process { background: #dbeafe; color: #2563eb; }
.badge-ready { background: #d1fae5; color: #059669; }

/* Timeline du Client */
.timeline {
    position: relative;
    padding-left: 2rem;
    border-left: 3px solid var(--border);
    margin-top: 1.5rem;
}

.timeline-item {
    position: relative;
    margin-bottom: 2rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: calc(-2rem - 7px);
    top: 4px;
    width: 120px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary);
    border: 3px solid var(--bg-card);
}

.timeline-img {
    max-width: 100%;
    max-height: 250px;
    border-radius: 8px;
    margin-top: 0.5rem;
    object-fit: cover;
}

/* Tchat */
.chat-box {
    display: flex;
    flex-direction: column;
    height: 350px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #f1f5f9;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.msg {
    max-width: 75%;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    font-size: 0.95rem;
}

.msg.shop {
    background: var(--primary);
    color: white;
    align-self: flex-start;
    border-bottom-left-radius: 2px;
}

.msg.client {
    background: #e2e8f0;
    color: var(--text-main);
    align-self: flex-end;
    border-bottom-right-radius: 2px;
}

.chat-input-area {
    display: flex;
    padding: 0.75rem;
    background: #fff;
    border-top: 1px solid var(--border);
    border-bottom-left-radius: var(--radius);
    border-bottom-right-radius: var(--radius);
}

.chat-input-area input {
    flex: 1;
    margin-right: 0.5rem;
}

/* Responsive Téléphone Intelligent */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    .grid {
        grid-template-columns: 1fr;
    }
    .container {
        margin: 1rem auto;
    }
    .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
}