/* cauli/style.css */
:root {
    --primary: #2E7D32; /* Vert Cauli */
    --primary-light: #e8f5e9;
    --sidebar-bg: #1e293b;
    --sidebar-text: #94a3b8;
    --bg: #f3f4f6;
    --text: #334155;
    --border: #e2e8f0;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

body { margin: 0; font-family: 'Inter', sans-serif; background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
* { box-sizing: border-box; }

/* --- LOGIN PAGE (RESTAURÉ) --- */
.login-wrapper {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%); padding: 20px;
}
.login-box {
    background: white; width: 100%; max-width: 420px; padding: 40px;
    border-radius: 16px; box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1);
    text-align: center;
}
.login-logo { width: 80px; height: auto; margin-bottom: 20px; }
.login-title { font-size: 1.5rem; font-weight: 700; color: var(--text); margin-bottom: 5px; }
.login-subtitle { color: #64748b; font-size: 0.9rem; margin-bottom: 30px; }

.form-group { margin-bottom: 20px; text-align: left; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 6px; color: #475569; }
.form-input { 
    width: 100%; padding: 12px; border: 1px solid var(--border); border-radius: 8px; 
    font-size: 1rem; outline: none; transition: 0.2s; 
}
.form-input:focus { border-color: var(--primary); ring: 2px solid var(--primary-light); }

/* --- DASHBOARD LAYOUT --- */
.sidebar {
    width: 260px; background: var(--sidebar-bg); color: white;
    position: fixed; top: 0; bottom: 0; left: 0; display: flex; flex-direction: column;
    z-index: 50; transition: 0.3s;
}
.brand { height: 70px; display: flex; align-items: center; padding: 0 24px; gap: 12px; border-bottom: 1px solid rgba(255,255,255,0.05); }
.brand-img { height: 32px; width: auto; object-fit: contain; }
.brand-text { font-size: 1.2rem; font-weight: 700; color: white; letter-spacing: -0.5px; }

.nav-menu { flex: 1; padding: 24px 16px; overflow-y: auto; }
.nav-label { font-size: 0.75rem; font-weight: 700; color: #64748b; margin: 20px 0 10px 12px; text-transform: uppercase; }
.nav-item {
    display: flex; align-items: center; gap: 12px; padding: 10px 12px;
    color: var(--sidebar-text); text-decoration: none; border-radius: 8px;
    transition: 0.2s; font-size: 0.9rem; font-weight: 500; margin-bottom: 4px;
}
.nav-item:hover { background: rgba(255,255,255,0.05); color: white; }
.nav-item.active { background: var(--primary); color: white; }

.user-footer { padding: 16px 20px; background: rgba(0,0,0,0.2); display: flex; align-items: center; justify-content: space-between; }
.u-name { font-size: 0.9rem; font-weight: 600; color: white; display:block;}
.u-role { font-size: 0.75rem; color: #64748b; }
.btn-logout { color: #ef4444; text-decoration: none; padding: 5px; border-radius: 4px; }
.btn-logout:hover { background: rgba(239, 68, 68, 0.1); }

/* CONTENT */
.main-content { margin-left: 260px; padding: 30px; min-height: 100vh; }
.page-container { max-width: 1200px; margin: 0 auto; }
.mobile-header { display: none; background: var(--sidebar-bg); color: white; padding: 15px; align-items: center; justify-content: space-between; }

/* UTILS */
.card { background: white; border-radius: 12px; padding: 24px; box-shadow: var(--shadow); border: 1px solid var(--border); margin-bottom: 20px; }
.btn { border: none; background: var(--primary); color: white; padding: 10px 20px; border-radius: 8px; cursor: pointer; font-weight: 600; width: 100%; }
.btn:hover { background: #1B5E20; }
.error-box { background: #fee2e2; color: #991b1b; padding: 10px; border-radius: 6px; font-size: 0.9rem; margin-bottom: 15px; text-align: center; display:none; }

/* MESSAGERIE UI (Gardée de l'étape précédente) */
.msg-layout { display: flex; height: calc(100vh - 60px); background: white; border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; border: 1px solid var(--border); }
.msg-list-panel { width: 320px; border-right: 1px solid var(--border); display: flex; flex-direction: column; background: #f8fafc; }
.msg-chat-panel { flex: 1; display: flex; flex-direction: column; background: white; }
.msg-header { padding: 15px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; background: white; }
.thread-item { padding: 15px; border-bottom: 1px solid var(--border); cursor: pointer; }
.thread-item:hover { background: #f1f5f9; }
.thread-item.active { background: #f0fdf4; border-left: 4px solid var(--primary); }

/* RESPONSIVE */
@media (max-width: 992px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; padding: 0; }
    .mobile-header { display: flex; }
    .page-container { padding: 15px; }
    .msg-layout { height: calc(100vh - 80px); }
    .msg-list-panel { width: 100%; }
    .msg-chat-panel { display: none; }
    .view-chat .msg-list-panel { display: none; }
    .view-chat .msg-chat-panel { display: flex; }
}