@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@600;700&family=Manrope:wght@400;500;600;700;800&display=swap');

:root{
	--cream:#FBF1E4; --cream-2:#F4E6D2;
	--forest:#173B2E; --forest-2:#0F2921;
	--orange:#E85A1B; --orange-2:#C6480F;
	--olive:#7E9A3D; --ink:#1B1B18; --paper:#FFFDF9;
	--line: rgba(23,59,46,0.13);
	--shadow-sm: 0 2px 8px rgba(23,59,46,0.06);
	--shadow: 0 10px 26px rgba(23,59,46,0.10);
}
*{ box-sizing:border-box; }
body{
	font-family:'Manrope', sans-serif; background:var(--cream); color:var(--ink);
	margin:0; padding-bottom:70px; -webkit-font-smoothing:antialiased; line-height:1.5;
}
h1,h2,h3,h4{ font-family:'Space Grotesk', sans-serif; letter-spacing:-0.01em; color:var(--forest-2); }
a{ color:inherit; text-decoration:none; }
img{ max-width:100%; display:block; }
input, textarea, select, button{ font-family:inherit; }
.container{ max-width:600px; margin:0 auto; padding:0 14px; }
.container-wide{ max-width:1100px; margin:0 auto; padding:0 14px; }

/* ---------- BOUTONS ---------- */
.btn{
	display:inline-flex; align-items:center; justify-content:center; gap:6px;
	padding:11px 20px; border-radius:100px; font-weight:700; font-size:0.9rem;
	border:none; cursor:pointer; transition:transform .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.btn-primary{ background:var(--orange); color:var(--paper); box-shadow:0 6px 16px rgba(232,90,27,0.3); }
.btn-primary:hover{ background:var(--orange-2); }
.btn-outline{ border:1.5px solid var(--forest); color:var(--forest); background:transparent; }
.btn-outline:hover{ background:var(--forest); color:var(--paper); }
.btn-sm{ padding:7px 14px; font-size:0.8rem; }
.btn-block{ width:100%; }
.btn-danger{ background:#c62828; color:#fff; }
.btn:disabled{ opacity:0.5; cursor:default; }

/* ---------- FORMULAIRES ---------- */
.field{ margin-bottom:16px; }
.field label{ display:block; font-size:0.83rem; font-weight:700; color:var(--forest-2); margin-bottom:6px; }
.field input, .field select, .field textarea{
	width:100%; font-size:0.94rem; background:var(--cream-2); border:1.5px solid transparent;
	border-radius:12px; padding:12px 14px; outline:none; transition:border-color .15s ease, background-color .15s ease;
}
.field textarea{ min-height:90px; resize:vertical; }
.field input:focus, .field select:focus, .field textarea:focus{ border-color:var(--orange); background:var(--paper); }
.field-hint{ font-size:0.76rem; color:rgba(27,27,24,0.5); margin-top:5px; display:block; }
.auth-card{
	background:var(--paper); border:1px solid var(--line); border-radius:20px;
	padding:30px 24px; box-shadow:var(--shadow); max-width:440px; margin:40px auto;
}
.auth-card h1{ font-size:1.5rem; margin:0 0 6px; }
.auth-card p.sub{ color:rgba(27,27,24,0.6); font-size:0.9rem; margin:0 0 22px; }
.auth-logo{ text-align:center; margin-bottom:18px; font-weight:700; font-size:1.1rem; color:var(--forest-2); }
.alert{ padding:12px 16px; border-radius:10px; font-size:0.87rem; margin-bottom:16px; }
.alert-error{ background:#fdeceb; color:#a02818; border-left:3px solid #c62828; }
.alert-success{ background:rgba(126,154,61,0.12); color:var(--forest-2); border-left:3px solid var(--olive); }

/* ---------- TOP NAV (desktop) ---------- */
.topnav{
	position:sticky; top:0; z-index:50; background:rgba(251,241,228,0.92); backdrop-filter:blur(10px);
	border-bottom:1px solid var(--line); display:none;
}
.topnav-inner{ max-width:1100px; margin:0 auto; padding:12px 20px; display:flex; align-items:center; justify-content:space-between; gap:16px; }
.topnav-brand{ display:flex; align-items:center; gap:9px; font-weight:700; color:var(--forest-2); }
.topnav-brand .avatar{ width:30px; height:30px; border-radius:50%; }
.topnav-links{ display:flex; gap:6px; }
.topnav-links a{
	padding:9px 14px; border-radius:10px; font-weight:600; font-size:0.88rem; color:rgba(27,27,24,0.6);
	display:flex; align-items:center; gap:6px; position:relative;
}
.topnav-links a.active, .topnav-links a:hover{ background:var(--cream-2); color:var(--forest-2); }
.topnav-search input{
	background:var(--cream-2); border:none; border-radius:100px; padding:9px 16px; font-size:0.85rem; width:220px;
}

/* ---------- MOBILE HEADER ---------- */
.mobile-header{
	position:sticky; top:0; z-index:50; background:rgba(251,241,228,0.92); backdrop-filter:blur(10px);
	border-bottom:1px solid var(--line); padding:12px 16px; display:flex; align-items:center; justify-content:space-between;
}
.mobile-header .brand{ display:flex; align-items:center; gap:8px; font-weight:700; color:var(--forest-2); }
.mobile-header .brand img{ width:28px; height:28px; border-radius:50%; }
.mobile-header .icon-btn{ position:relative; font-size:1.2rem; padding:6px; }
.badge-count{
	position:absolute; top:-2px; right:-2px; background:var(--orange); color:#fff; font-size:0.62rem; font-weight:700;
	border-radius:100px; min-width:16px; height:16px; display:flex; align-items:center; justify-content:center; padding:0 3px;
}

/* ---------- BOTTOM NAV (mobile) ---------- */
.bottomnav{
	position:fixed; bottom:0; left:0; right:0; z-index:50; background:var(--paper);
	border-top:1px solid var(--line); display:flex; justify-content:space-around; padding:8px 0 calc(8px + env(safe-area-inset-bottom));
	box-shadow:0 -4px 14px rgba(23,59,46,0.06);
}
.bottomnav a{
	display:flex; flex-direction:column; align-items:center; gap:3px; font-size:0.65rem; font-weight:700;
	color:rgba(27,27,24,0.45); position:relative; padding:2px 10px;
}
.bottomnav a.active{ color:var(--orange); }
.bottomnav .icon{ font-size:1.3rem; }

/* ---------- SALONS TABS ---------- */
.salon-tabs{ display:flex; gap:8px; overflow-x:auto; padding:14px 0; scrollbar-width:none; }
.salon-tabs::-webkit-scrollbar{ display:none; }
.salon-tab{
	flex-shrink:0; display:flex; align-items:center; gap:6px; padding:9px 16px; border-radius:100px;
	background:var(--paper); border:1.5px solid var(--line); font-size:0.85rem; font-weight:700; color:var(--forest-2);
	white-space:nowrap;
}
.salon-tab.active{ background:var(--forest); border-color:var(--forest); color:var(--paper); }

/* ---------- COMPOSER ---------- */
.composer{
	background:var(--paper); border:1px solid var(--line); border-radius:18px; padding:16px; margin-bottom:18px;
	box-shadow:var(--shadow-sm);
}
.composer-top{ display:flex; gap:10px; align-items:flex-start; }
.composer textarea{
	flex:1; border:none; background:var(--cream-2); border-radius:14px; padding:12px 14px; resize:none;
	min-height:52px; font-size:0.94rem; outline:none;
}
.composer textarea:focus{ background:var(--paper); box-shadow:0 0 0 2px var(--orange); }
.composer-actions{ display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:10px; margin-top:10px; }
.composer-tools{ display:flex; gap:6px; flex-wrap:wrap; }
.composer-tools label{ cursor:pointer; padding:7px 10px; border-radius:8px; font-size:0.8rem; color:var(--forest-2); background:var(--cream-2); }
.composer-preview{ margin-top:10px; border-radius:12px; overflow:hidden; max-height:220px; }
.composer-preview img{ width:100%; object-fit:cover; }

/* ---------- AVATAR ---------- */
.avatar{
	border-radius:50%; object-fit:cover; flex-shrink:0; background:var(--orange); color:var(--paper);
	display:flex; align-items:center; justify-content:center; font-family:'Space Grotesk'; font-weight:700; overflow:hidden;
}
.avatar-sm{ width:36px; height:36px; font-size:0.8rem; }
.avatar-md{ width:44px; height:44px; font-size:0.9rem; }
.avatar-lg{ width:88px; height:88px; font-size:1.6rem; border:4px solid var(--paper); }

/* ---------- POST CARD ---------- */
.post{
	background:var(--paper); border:1px solid var(--line); border-radius:18px; padding:16px; margin-bottom:14px;
	box-shadow:var(--shadow-sm);
}
.post-head{ display:flex; gap:10px; align-items:flex-start; }
.post-author{ flex:1; min-width:0; }
.post-author-name{ font-weight:700; font-size:0.95rem; color:var(--forest-2); display:flex; align-items:center; gap:6px; }
.post-author-meta{ font-size:0.78rem; color:rgba(27,27,24,0.55); margin-top:1px; }
.post-salon-tag{
	font-size:0.68rem; font-weight:700; color:var(--orange-2); background:rgba(232,90,27,0.1);
	padding:3px 9px; border-radius:100px; margin-top:5px; display:inline-block;
}
.post-time{ font-size:0.74rem; color:rgba(27,27,24,0.4); white-space:nowrap; }
.post-content{ margin:12px 0; font-size:0.94rem; color:var(--ink); white-space:pre-wrap; line-height:1.55; }
.post-image{ border-radius:14px; overflow:hidden; margin-bottom:10px; }
.post-image img{ width:100%; max-height:420px; object-fit:cover; }
.post-shared{ border:1px solid var(--line); border-radius:14px; padding:12px; margin-top:8px; background:var(--cream-2); }

.post-stats{ display:flex; justify-content:space-between; font-size:0.76rem; color:rgba(27,27,24,0.5); padding:8px 0; }
.post-actions{ display:flex; border-top:1px solid var(--line); padding-top:6px; }
.post-actions button{
	flex:1; background:none; border:none; padding:9px 4px; font-weight:700; font-size:0.82rem; color:rgba(27,27,24,0.55);
	cursor:pointer; display:flex; align-items:center; justify-content:center; gap:6px; border-radius:8px;
}
.post-actions button:hover{ background:var(--cream-2); }
.post-actions button.liked{ color:var(--orange); }

.comments-list{ margin-top:10px; display:flex; flex-direction:column; gap:8px; }
.comment{ display:flex; gap:8px; }
.comment-bubble{ background:var(--cream-2); border-radius:14px; padding:8px 12px; flex:1; }
.comment-author{ font-weight:700; font-size:0.82rem; color:var(--forest-2); }
.comment-text{ font-size:0.85rem; margin-top:1px; }
.comment-form{ display:flex; gap:8px; margin-top:10px; }
.comment-form input{ flex:1; background:var(--cream-2); border:none; border-radius:100px; padding:9px 14px; font-size:0.85rem; outline:none; }
.comment-form button{ background:var(--orange); color:#fff; border:none; border-radius:100px; padding:0 16px; font-weight:700; cursor:pointer; }

.empty-state{ text-align:center; padding:50px 20px; color:rgba(27,27,24,0.5); }
.empty-state .icon{ font-size:2.4rem; margin-bottom:10px; }

/* ---------- PROFIL ---------- */
.profile-cover{ height:120px; background:linear-gradient(135deg, var(--forest), var(--forest-2)); border-radius:0 0 20px 20px; }
.profile-head{ text-align:center; margin-top:-46px; }
.profile-name{ font-size:1.3rem; margin:12px 0 2px; }
.profile-role{ font-size:0.88rem; color:var(--orange-2); font-weight:700; }
.profile-meta{ font-size:0.82rem; color:rgba(27,27,24,0.55); margin-top:4px; }
.profile-bio{ font-size:0.88rem; color:rgba(27,27,24,0.7); max-width:420px; margin:12px auto; text-align:center; }
.profile-stats{ display:flex; justify-content:center; gap:26px; margin:16px 0; }
.profile-stat b{ display:block; font-size:1.1rem; color:var(--forest-2); }
.profile-stat span{ font-size:0.72rem; color:rgba(27,27,24,0.5); }
.profile-actions{ display:flex; justify-content:center; gap:10px; margin-bottom:20px; flex-wrap:wrap; padding:0 14px; }

/* ---------- MESSAGERIE ---------- */
.conv-list-item{ display:flex; gap:10px; padding:12px; border-radius:14px; align-items:center; }
.conv-list-item:hover{ background:var(--cream-2); }
.conv-list-item.unread .conv-name{ font-weight:800; }
.conv-name{ font-weight:600; font-size:0.92rem; color:var(--forest-2); }
.conv-preview{ font-size:0.8rem; color:rgba(27,27,24,0.55); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.chat-window{ display:flex; flex-direction:column; height:calc(100dvh - 118px); padding-bottom:74px; }
.chat-messages{ flex:1; overflow-y:auto; padding:14px 0; display:flex; flex-direction:column; gap:8px; -webkit-overflow-scrolling:touch; }
.msg-bubble{ max-width:75%; padding:9px 14px; border-radius:16px; font-size:0.88rem; }
.msg-mine{ align-self:flex-end; background:var(--orange); color:#fff; border-bottom-right-radius:4px; }
.msg-theirs{ align-self:flex-start; background:var(--cream-2); border-bottom-left-radius:4px; }
.chat-input{
	display:flex; gap:8px; padding:10px 14px; border-top:1px solid var(--line); background:var(--paper);
}
.chat-input input{ flex:1; background:var(--cream-2); border:none; border-radius:100px; padding:11px 16px; outline:none; }
.chat-input button{ background:var(--orange); color:#fff; border:none; border-radius:100px; padding:0 18px; font-weight:700; cursor:pointer; }

@media (max-width: 859px) {
	.chat-input{
		position:fixed; left:0; right:0; bottom:64px; z-index:40;
		padding-bottom:calc(10px + env(safe-area-inset-bottom));
	}
}

/* ---------- NOTIFICATIONS ---------- */
.notif-item{ display:flex; gap:10px; padding:12px; border-radius:14px; align-items:flex-start; }
.notif-item.unread{ background:rgba(232,90,27,0.06); }
.notif-text{ font-size:0.87rem; }
.notif-time{ font-size:0.74rem; color:rgba(27,27,24,0.45); margin-top:2px; }

/* ---------- PENDING SCREEN ---------- */
.pending-screen{ max-width:440px; margin:60px auto; text-align:center; padding:0 20px; }
.pending-screen .icon{ font-size:3rem; margin-bottom:14px; }

@media (min-width: 860px) {
	body{ padding-bottom:0; }
	.topnav{ display:block; }
	.mobile-header, .bottomnav{ display:none; }
	.layout{ display:grid; grid-template-columns:240px 1fr; gap:24px; max-width:1100px; margin:0 auto; padding:24px 20px; }
	.container{ max-width:600px; margin:0; padding:0; }
}

@media (max-width: 420px) {
	.auth-card{ padding:22px 16px; margin:20px auto; border-radius:16px; }
	.avatar-lg{ width:76px; height:76px; font-size:1.4rem; }
	.profile-name{ font-size:1.15rem; }
	.post{ padding:13px; border-radius:14px; }
	.composer{ padding:13px; border-radius:14px; }
}

/* Les tableaux admin sont enveloppés dans .admin-table-scroll (voir chaque page) pour rester utilisables sur mobile. */
.admin-table-scroll{ overflow-x:auto; -webkit-overflow-scrolling:touch; }
