/* Page de gestion des livraisons (front). Couleur principale : --wcsm-accent. */
.wcsm {
	--wcsm-accent: #2e7d32;
	--wcsm-accent-soft: rgba(46, 125, 50, .09);
	--wcsm-alert: #c62828;
	--wcsm-line: #e3e3e3;
	--wcsm-muted: #767676;
	--wcsm-bg: #fff;
	font-size: 15px;
	line-height: 1.5;
	max-width: 1200px;
	margin: 0 auto;
	color: #222;
}
.wcsm *, .wcsm *::before, .wcsm *::after { box-sizing: border-box; }
.wcsm h2, .wcsm h3, .wcsm h4 { margin: 0; line-height: 1.25; }
.wcsm a { color: var(--wcsm-accent); }

/* En-tête */
.wcsm-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 16px; padding-bottom: 14px; margin-bottom: 18px; border-bottom: 1px solid var(--wcsm-line); }
.wcsm-title a { color: inherit; text-decoration: none; }
.wcsm-user { color: var(--wcsm-muted); font-size: 14px; }

/* Messages */
.wcsm-notice { padding: 10px 14px; border-radius: 6px; background: var(--wcsm-accent-soft); border-left: 4px solid var(--wcsm-accent); margin: 0 0 16px; }
.wcsm-notice--error { background: rgba(198, 40, 40, .08); border-color: var(--wcsm-alert); }
.wcsm-empty, .wcsm-muted { color: var(--wcsm-muted); }

/* Boutons */
.wcsm-btn { display: inline-block; padding: 8px 16px; border-radius: 6px; border: 1px solid var(--wcsm-accent); background: var(--wcsm-accent); color: #fff !important; text-decoration: none !important; font-weight: 600; font-size: 14px; line-height: 1.3; cursor: pointer; white-space: nowrap; }
.wcsm-btn:hover { filter: brightness(1.08); }
.wcsm-btn--ghost { background: transparent; color: var(--wcsm-accent) !important; }
.wcsm-btn--big { padding: 12px 28px; font-size: 16px; }

/* Onglets de filtre */
.wcsm-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.wcsm-tab { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--wcsm-line); border-radius: 999px; text-decoration: none !important; color: #333 !important; font-size: 14px; background: var(--wcsm-bg); }
.wcsm-tab.is-active { border-color: var(--wcsm-accent); background: var(--wcsm-accent-soft); color: var(--wcsm-accent) !important; font-weight: 600; }
.wcsm-tab--todo { border-style: dashed; }
.wcsm-count { background: #eee; border-radius: 999px; padding: 0 8px; font-size: 12px; font-weight: 600; }
.wcsm-tab.is-active .wcsm-count { background: var(--wcsm-accent); color: #fff; }

/* Recherche */
.wcsm-search { display: flex; gap: 8px; margin-bottom: 16px; }
.wcsm-search input[type=search] { flex: 1; min-width: 0; padding: 8px 12px; border: 1px solid #ccc; border-radius: 6px; }

/* Actions groupées */
.wcsm-bulk { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 12px; background: #f7f7f7; border-radius: 6px; margin-bottom: 10px; font-size: 14px; }
.wcsm-bulk select { padding: 6px 8px; }

/* Tableau */
.wcsm-table { width: 100%; border-collapse: collapse; background: var(--wcsm-bg); }
.wcsm-table th, .wcsm-table td { padding: 10px 8px; border-bottom: 1px solid var(--wcsm-line); text-align: left; vertical-align: middle; font-size: 14px; }
.wcsm-table th { font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--wcsm-muted); }
.wcsm-table small { color: var(--wcsm-muted); }
.wcsm-col-check { width: 32px; }
.wcsm-col-action { text-align: right !important; }

/* Pagination */
.wcsm-pager { display: flex; justify-content: center; align-items: center; gap: 14px; margin: 18px 0; }

/* Badges */
.wcsm-badge, .wcsm-status { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; background: #eee; color: #444; }
.wcsm-badge--none { background: transparent; color: #aaa; }
.wcsm-badge--confirmee   { background: #e3f2fd; color: #0d47a1; }
.wcsm-badge--preparation { background: #fff3e0; color: #e65100; }
.wcsm-badge--expediee    { background: #ede7f6; color: #4527a0; }
.wcsm-badge--transit     { background: #e8eaf6; color: #283593; }
.wcsm-badge--livraison   { background: #e0f7fa; color: #006064; }
.wcsm-badge--livree      { background: #c8e6c9; color: #1b5e20; }
.wcsm-badge--incident    { background: #ffcdd2; color: #b71c1c; }
.wcsm-status--processing { background: #c6e1c6; color: #2c4700; }
.wcsm-status--on-hold    { background: #f8dda7; color: #94660c; }
.wcsm-status--completed  { background: #c8d7e1; color: #2e4453; }
.wcsm-status--cancelled, .wcsm-status--failed { background: #eba3a3; color: #761919; }

/* Fiche commande */
.wcsm-back { text-decoration: none; }
.wcsm-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-bottom: 14px; }
.wcsm-head h3 { font-size: 24px; }
.wcsm-head-total { margin-left: auto; font-size: 18px; }
.wcsm-link-admin { font-size: 13px; }

.wcsm-progress { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.wcsm-step { padding: 4px 12px; border-radius: 999px; font-size: 13px; background: #f1f1f1; color: #999; }
.wcsm-step--done { background: var(--wcsm-accent-soft); color: var(--wcsm-accent); }
.wcsm-step--current { background: var(--wcsm-accent); color: #fff; font-weight: 700; }
.wcsm-step--incident { background: var(--wcsm-alert); color: #fff; font-weight: 700; }

.wcsm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.wcsm-card { border: 1px solid var(--wcsm-line); border-radius: 8px; padding: 14px 16px; margin: 0; min-width: 0; background: var(--wcsm-bg); }
.wcsm-card h4 { font-size: 14px; text-transform: uppercase; letter-spacing: .03em; color: var(--wcsm-muted); margin: 0 0 8px; }
.wcsm-card h4:not(:first-child) { margin-top: 14px; }
.wcsm-card legend { font-weight: 700; padding: 0 6px; }
.wcsm-card address { font-style: normal; }
.wcsm-items { list-style: none; margin: 0; padding: 0; }
.wcsm-items li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid #f0f0f0; }

.wcsm-form label { display: block; font-weight: 600; margin: 10px 0 4px; font-size: 14px; }
.wcsm-form label small { font-weight: 400; color: var(--wcsm-muted); }
.wcsm-form input[type=text], .wcsm-form input[type=url], .wcsm-form input[type=date],
.wcsm-form input[type=datetime-local], .wcsm-form select, .wcsm-form textarea {
	width: 100%; padding: 9px 10px; border: 1px solid #ccc; border-radius: 6px; font-size: 15px; background: #fff;
}
.wcsm-form .wcsm-inline { display: flex; gap: 8px; align-items: center; font-weight: 400; margin-top: 14px; }

.wcsm-history { list-style: none; margin: 0; padding: 0; }
.wcsm-history li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--wcsm-line); }
.wcsm-history-main { display: flex; flex-direction: column; gap: 3px; align-items: flex-start; }
.wcsm-note { background: #fafafa; border-radius: 4px; padding: 4px 8px; }
.wcsm-form .wcsm-delete { display: flex; gap: 6px; align-items: center; font-weight: 400; font-size: 13px; color: var(--wcsm-alert); margin: 0; white-space: nowrap; }

/* Connexion */
.wcsm-login { max-width: 420px; margin: 20px auto; padding: 24px; border: 1px solid var(--wcsm-line); border-radius: 8px; }
.wcsm-login h2 { margin-bottom: 8px; }
.wcsm-login input[type=text], .wcsm-login input[type=password] { width: 100%; padding: 9px 10px; }

/* Mobile */
@media (max-width: 760px) {
	.wcsm-grid { grid-template-columns: 1fr; }
	.wcsm-head-total { margin-left: 0; }
	.wcsm-table thead { display: none; }
	.wcsm-table, .wcsm-table tbody, .wcsm-table tr, .wcsm-table td { display: block; width: 100%; }
	.wcsm-table tr { position: relative; border: 1px solid var(--wcsm-line); border-radius: 8px; margin-bottom: 12px; padding: 8px 12px 8px 40px; }
	.wcsm-table td { border: 0; padding: 4px 0; }
	.wcsm-table td[data-label]::before { content: attr(data-label); display: block; font-size: 11px; text-transform: uppercase; color: var(--wcsm-muted); }
	.wcsm-table .wcsm-col-check { position: absolute; left: 12px; top: 12px; width: auto; }
	.wcsm-col-action { text-align: left !important; padding-top: 8px !important; }
	.wcsm-col-action .wcsm-btn { display: block; text-align: center; }
	.wcsm-btn--big { width: 100%; }
}
