/* Force le calcul correct des largeurs incluant le padding */
*, *::before, *::after {
    box-sizing: border-box;
}

/* Assure que l'input ne dépasse jamais son parent */
.input-container input {
    width: 100% !important; /* Force la largeur */
    max-width: 100%;        /* Sécurité supplémentaire */
    display: block;         /* Évite les comportements inline */
}

:root {
    --primary: #FF6B00;
    --orange: #FF6B00;
    --orange-dark: #e65c00;
    --primary-dark: #e65c00;
    --blue: #0066CC;
    --success: #10b981;
	--success-dark: #198754;
    --danger: #ef4444;
    --warning: #f59e0b;
    --bg-light: #f8fafc;
    --text-dark: #1e293b;
    --text-muted: #64748b;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --radius: 12px;
}

body {
    margin: 0;
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
}

.app-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px 10px;
}

/* Header */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
	align-items: anchor-center;
	justify-content: center;
	gap: 15px;
}

.user-greeting { display: flex; flex-direction: column; }
.welcome-text { font-size: 14px; color: var(--text-muted); }
.user-name { font-size: 18px; font-weight: 700; color: var(--blue); }

.btn-icon-logout {
    background: #fee2e2;
    color: var(--danger);
    border: none;
    padding: 10px;
    border-radius: 50%;
    cursor: pointer;
    transition: 0.2s;
}

/* Card Style */
.card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 24px;
	border-top: 5px solid var(--orange);
}

.page-title { margin: 15px 15px 15px; color: var(--blue); font-size: 22px; display: flex; align-items: center; justify-content: center; gap: 10px;


}

/* Map Legend */
.map-legend {
    display: flex;
    justify-content: center;
    gap: 15px;
    padding: 12px;
    font-size: 13px;
    background: white;
}
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot-todo { background: var(--blue) }
.dot-route { background: var(--primary); }
.dot-done { background: var(--success); }

/* Appointment Cards */
.appointment-card {
    background: white;
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
    border-left: 5px solid #e2e8f0;
    transition: transform 0.2s;
}

.appointment-card.validated, .appointment-card.assigned { border-left-color: var(--blue); }
.appointment-card.en_route { border-left-color: var(--primary); background: #fffcf0; }
/*.appointment-card.done { border-left-color: var(--success); opacity: 0.8; }*/
.appointment-card.urgent-border { border-left-color: var(--danger); }

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.time-badge {
    background: #f1f5f9;
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 13px;
    color: var(--blue);
	 display: flex; 
	 align-items: anchor-center; 
	 justify-content: center; 
	 gap: 8px;
}

.status-badge {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 4px 8px;
    border-radius: 4px;
}

.badge-en_route { background: #ffedd5; color: #9a3412; }
/*.badge-done { background: #dcfce7; color: #166534; }*/

.client-name { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.tag-urgent { color: var(--danger); font-size: 12px; font-weight: 800; margin-left: 8px; }

.info-row { display: flex; align-items: flex-start; gap: 8px; font-size: 14px; margin: 6px 0; color: var(--text-muted); }
.icon { width: 18px; height: 18px; flex-shrink: 0; }

.notes-box {
    margin-top: 12px;
    padding: 10px;
    background: #f8fafc;
    border-radius: 8px;
    font-size: 13px;
    border-left: 3px solid #cbd5e1;
	 display: flex; 
	 align-items: anchor-center; 
	 gap: 8px;
}

/* Actions */
.card-footer {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.btn {
    flex: 1;
    padding: 12px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    text-align: center;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: 0.2s;
}

.btn-outline { background: white; border: 1px solid #e2e8f0; color: var(--text-dark); display: flex; align-items: anchor-center; justify-content: center; gap: 8px;}
.btn-primary { background: var(--primary); color: white; }
.btn-success { background: var(--success); color: white; }
.full-width { width: 100%; margin-top: 4px; }

.btn.btn-outline.btn-call:hover, 
.btn.btn-outline.btn-gps:hover { border: 1px solid var(--primary); }
.btn.btn-success:hover { background: var(--success-dark); }


.btn:active { transform: scale(0.98); }

.btn-primary:hover {
  background-color: var(--orange-dark);
}
@media (max-width: 600px) {
    .app-container { padding: 20px 10px; }
    .card-footer { flex-direction: row; }
    .btn-call, .btn-gps { flex: 1; }
	.btn-success, .btn-primary { min-width: 100%; }
}

/* ------------------------------------------------------------ */
/* LOGIN SPECIFIC STYLES                                        */
/* ------------------------------------------------------------ */

.bg-login {
    /*background: linear-gradient(135deg, #0066CC 0%, #004a99 100%);*/
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.login-wrapper {
    width: 100%;
    max-width: 400px;
}

.login-card {
    background: white;
    border-radius: 20px;
    padding: 30px; /* Réduit un peu le padding sur les côtés pour laisser de la place */
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
}

.login-header h2 {
    margin: 20px 0 10px;
    font-size: 24px;
    font-weight: 800;
    color: var(--text-dark);
}

.login-header p {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 30px;
}

.logo-circle {
    width: 64px;
    height: 64px;
    background: var(--primary);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    box-shadow: 0 10px 15px -3px rgba(255, 107, 0, 0.3);
}

/* Form Styling */
.form-group {
    text-align: left;
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-dark);
}

.input-container input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    font-size: 16px; /* Évite le zoom auto sur iPhone */
    transition: all 0.2s;
    background: #f8fafc;
}

.input-container input:focus {
    border-color: var(--blue);
    background: white;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.btn-block {
    width: 100%;
    height: 54px;
    font-size: 16px;
    box-shadow: 0 4px 6px -1px rgba(255, 107, 0, 0.2);
}

/* Error Alert */
.alert-error {
    background: #fff1f2;
    color: var(--danger);
    padding: 12px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid #fee2e2;
}

.login-footer {
    margin-top: 30px;
    font-size: 12px;
    color: #94a3b8;
}

/* Animation entrée */
@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.login-card {
    animation: slideUp 0.5s ease-out;
}

/* État terminé : On grise et on réduit l'importance visuelle */
.appointment-card.done {
    background-color: #f1f5f9; /* Fond gris très clair */
    border-left-color: var(--success);
    filter: grayscale(0.5);     /* Désature légèrement les couleurs */
}

/* On change aussi la couleur du badge horaire et du texte pour le contraste */
.appointment-card.done .time-badge {
    background: #e2e8f0;
    color: #64748b;
}

.appointment-card.done .client-name {
    color: #64748b;
}

/* Optionnel : cacher les boutons d'action si c'est fini */
.appointment-card.done .card-footer {
    display: none; 
}

a {
  text-decoration: none;
  color: var(--orange);
}
/* HEADER & DROPDOWNS */
.header { height: 69px; background: #FFF; padding: 0 30px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border); position: sticky; top:0; z-index:1000; box-shadow: 0 2px 5px rgba(0,0,0,0.05); }
.header img { height: 45px; }
.header-center { display: flex; gap: 10px; }