/* SITIE — front-end (shortcode [sitie_suivi])
   Objectif : occuper toute la largeur disponible, indépendamment de la colonne de contenu du
   thème, avec un rendu plus proche du site que du style natif wp-admin. */

.sim-frontend-wrap {
	/* Occupe toute la largeur du bloc qui le contient. Pour une vraie pleine largeur (au-delà
	   de la colonne de contenu habituelle du thème), utilisez l'alignement natif de l'éditeur :
	   sélectionnez le bloc contenant [sitie_suivi] (ou groupez-le dans un bloc "Groupe") et
	   choisissez "Pleine largeur" dans sa barre d'outils — plus fiable qu'un calcul en CSS avec
	   un thème à blocs comme celui-ci. */
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	padding: 32px clamp(16px, 4vw, 64px);
	background: #fff;
	font-family: inherit;
	color: inherit;
}

.sim-frontend-wrap h1,
.sim-frontend-wrap h2 {
	font-family: inherit;
	font-weight: 600;
	color: inherit;
	margin: 0 0 16px;
}
.sim-frontend-wrap h1 { font-size: 1.6em; }
.sim-frontend-wrap h2 { font-size: 1.25em; margin-top: 2em; }

.sim-frontend-wrap a { color: #2271b1; text-decoration: none; }
.sim-frontend-wrap a:hover { text-decoration: underline; }

/* Tableaux — style aligné sur le tableau "Éléments enregistrés" du module Arrêtés */
.sim-frontend-wrap table.widefat {
	width: 100%;
	min-width: 900px; /* évite un tableau trop tassé ; la zone qui l'entoure défile plutôt que la page entière */
	border-collapse: collapse;
	background: #fff;
	border: none;
	border-radius: 8px;
	overflow: hidden;
	margin: 0;
	font-size: 14px;
}
.sim-frontend-wrap .sim-table-scroll {
	overflow-x: auto;
	margin: 16px 0;
	border-radius: 8px;
	-webkit-overflow-scrolling: touch;
}
.sim-frontend-wrap table.widefat th,
.sim-frontend-wrap table.widefat td {
	padding: 16px 18px;
	text-align: left;
	border-bottom: 1px solid #eee;
	vertical-align: middle;
}
.sim-frontend-wrap table.widefat thead th {
	background: #1e293b;
	color: #fff;
	font-weight: 600;
	border-bottom: none;
}
.sim-frontend-wrap table.widefat tbody tr:last-child td { border-bottom: none; }
.sim-frontend-wrap table.striped tbody tr:nth-child(odd) { background: #fff; } /* pas d'alternance : lignes blanches, séparées par un simple trait */
.sim-frontend-wrap table.sim-fiche th { width: 180px; color: #555; font-weight: 600; }
.sim-frontend-wrap table.form-table th { width: 200px; text-align: left; padding: 10px 12px 10px 0; }
.sim-frontend-wrap table.form-table td { padding: 10px 0; }

/* Champs */
.sim-frontend-wrap input[type="text"],
.sim-frontend-wrap input[type="email"],
.sim-frontend-wrap input[type="search"],
.sim-frontend-wrap input[type="url"],
.sim-frontend-wrap input[type="number"],
.sim-frontend-wrap input[type="date"],
.sim-frontend-wrap select,
.sim-frontend-wrap textarea {
	padding: 8px 10px;
	border: 1px solid #ccc;
	border-radius: 4px;
	font-size: 14px;
	font-family: inherit;
	box-sizing: border-box;
}
.sim-frontend-wrap textarea { width: 100%; max-width: 600px; }
.sim-frontend-wrap .regular-text { width: 320px; max-width: 100%; }
.sim-frontend-wrap .large-text { width: 100%; }

/* Boutons */
.sim-frontend-wrap .button,
.sim-frontend-wrap input[type="submit"],
.sim-frontend-wrap button[type="submit"] {
	display: inline-block;
	padding: 9px 18px;
	background: #2271b1;
	color: #fff;
	border: none;
	border-radius: 5px;
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	text-decoration: none;
	line-height: 1.4;
}
.sim-frontend-wrap .button:hover,
.sim-frontend-wrap input[type="submit"]:hover,
.sim-frontend-wrap button[type="submit"]:hover {
	background: #135e96;
	color: #fff;
}
.sim-frontend-wrap .button-secondary { background: #6b6b6b; }
.sim-frontend-wrap .button-secondary:hover { background: #4d4d4d; }
.sim-frontend-wrap .button.delete { background: #d63638; }
.sim-frontend-wrap .button.delete:hover { background: #b32d2e; }
.sim-frontend-wrap .button:disabled { opacity: .6; cursor: default; }

/* Notices */
.sim-frontend-wrap .notice {
	padding: 12px 16px;
	border-radius: 6px;
	margin: 16px 0;
	border-left: 4px solid #ccc;
	background: #f7f7f7;
}
.sim-frontend-wrap .notice-success { border-left-color: #00a32a; background: #edfaef; }
.sim-frontend-wrap .notice p { margin: 0; }

/* Statistiques */
.sim-frontend-wrap .sim-stats-bandeau { display: flex; gap: 16px; flex-wrap: wrap; margin: 16px 0 24px; }
.sim-frontend-wrap .sim-stat {
	background: #f7f7f7; border-radius: 8px; padding: 14px 20px; min-width: 110px;
	text-align: center; border: 1px solid #eee;
}
.sim-frontend-wrap .sim-stat-num { display: block; font-size: 1.5em; font-weight: 700; }
.sim-frontend-wrap .sim-stat-nouveau .sim-stat-num { color: #d63638; }
.sim-frontend-wrap .sim-stat-encours .sim-stat-num { color: #b8860b; }
.sim-frontend-wrap .sim-stat-traite .sim-stat-num { color: #00a32a; }

/* Badges */
/* Badges — pastilles arrondies, fond clair + texte coloré (plutôt que fond plein + texte blanc) */
.sim-frontend-wrap .sim-badge {
	display: inline-block;
	padding: 6px 14px;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 700;
	white-space: nowrap;
}
.sim-frontend-wrap .sim-badge-nouveau { background: #fde2e2; color: #b42318; }
.sim-frontend-wrap .sim-badge-encours { background: #fef3c7; color: #92620a; }
.sim-frontend-wrap .sim-badge-traite  { background: #dcf5e3; color: #14804a; }

/* Fiche détail */
.sim-frontend-wrap .sim-detail-grid { display: flex; gap: 32px; align-items: flex-start; flex-wrap: wrap; }
.sim-frontend-wrap .sim-detail-main { flex: 2 1 500px; min-width: 0; }
.sim-frontend-wrap .sim-detail-side { flex: 1 1 280px; background: #f7f7f7; padding: 16px; border-radius: 8px; }
.sim-frontend-wrap .sim-historique { list-style: none; margin: 0; padding: 0; }
.sim-frontend-wrap .sim-historique li { padding: 10px 0; border-bottom: 1px solid #e5e5e5; font-size: 13px; }
.sim-frontend-wrap .sim-historique li:last-child { border-bottom: none; }
.sim-frontend-wrap .sim-historique-contenu { margin-top: 6px; padding: 8px; background: #fff; border-radius: 4px; border: 1px solid #eee; white-space: pre-line; }
.sim-frontend-wrap .sim-affectation-box { background: #f7f7f7; border-radius: 8px; padding: 14px 16px; margin-bottom: 20px; }
.sim-frontend-wrap .sim-danger-zone { margin-top: 32px; padding-top: 20px; border-top: 2px solid #f0d5d5; }
.sim-frontend-wrap .sim-map { width: 100%; height: 320px; border-radius: 8px; margin: 12px 0; }

/* Lightbox photos */
.sim-frontend-wrap .sim-lightbox {
	position: fixed; inset: 0; background: rgba(0,0,0,.85); display: none;
	align-items: center; justify-content: center; z-index: 100000;
}
.sim-frontend-wrap .sim-lightbox img { max-width: 90%; max-height: 90%; }
.sim-frontend-wrap .sim-lightbox-close { position: absolute; top: 20px; right: 30px; color: #fff; font-size: 32px; cursor: pointer; }

/* Connexion / accès refusé */
.sim-frontend-login {
	max-width: 420px;
	margin: 40px auto;
	text-align: center;
}
.sim-frontend-login .login-username,
.sim-frontend-login .login-password,
.sim-frontend-login .login-remember {
	text-align: left;
	margin-bottom: 14px;
}
.sim-frontend-login label { display: block; margin-bottom: 4px; font-weight: 600; }
.sim-frontend-login input[type="text"],
.sim-frontend-login input[type="password"] {
	width: 100%; box-sizing: border-box; padding: 10px; border: 1px solid #ccc; border-radius: 4px;
}
.sim-frontend-login #wp-submit {
	width: 100%; padding: 12px; background: #2271b1; color: #fff; border: none; border-radius: 5px;
	font-weight: 600; cursor: pointer;
}

@media (max-width: 782px) {
	.sim-frontend-wrap { padding: 20px 16px; }
	.sim-frontend-wrap .sim-detail-grid { flex-direction: column; }
}
