/* SOS-Achats — feuille applicative
 * Identité SOS : bleu fédération (#0071b3), vert (#00843d), typographie sobre. */

:root {
	--sos-blue: #0071b3;
	--sos-blue-dark: #00507a;
	--sos-green: #00843d;
	--sos-green-dark: #006630;
	--sos-bg: #f4f6f8;
	--sos-card: #ffffff;
	--sos-border: #dfe3e6;
	--sos-text: #1a1a1a;
	--sos-muted: #666;
	--sos-danger: #c62828;
}

* { box-sizing: border-box; }
body.sos-body { margin: 0; background: var(--sos-bg); color: var(--sos-text); font-family: "Segoe UI", Roboto, Arial, sans-serif; font-size: 14px; }

/* Layout */
.sos-app { display: flex; min-height: 100vh; }
.sos-sidebar { width: 240px; background: var(--sos-blue-dark); color: #fff; display: flex; flex-direction: column; padding: 16px; position: sticky; top: 0; height: 100vh; }
.sos-brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 18px; margin-bottom: 20px; }
.sos-brand img { background: #fff; border-radius: 6px; padding: 2px; }
.sos-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.sos-nav-item { color: #dceaf5; text-decoration: none; padding: 10px 12px; border-radius: 6px; display: flex; align-items: center; justify-content: space-between; font-size: 14px; }
.sos-nav-item:hover { background: rgba(255,255,255,.1); color: #fff; }
.sos-nav-item.sos-active { background: var(--sos-green); color: #fff; }
.sos-badge-count { background: #fff; color: var(--sos-blue-dark); border-radius: 10px; padding: 1px 7px; font-size: 11px; font-weight: 700; }
.sos-userbox { margin-top: 16px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.2); font-size: 12px; }
.sos-userbox a { color: #cfe; }
.sos-main { flex: 1; padding: 24px; max-width: 1100px; }
.sos-foot { padding: 10px 24px; color: var(--sos-muted); font-size: 11px; }

/* Sections / toolbars */
.sos-section { background: var(--sos-card); border: 1px solid var(--sos-border); border-radius: 8px; padding: 20px; margin-bottom: 16px; box-shadow: 0 1px 2px rgba(0,0,0,.03); }
.sos-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; flex-wrap: wrap; gap: 8px; }
.sos-section h2, .sos-section h3 { margin-top: 0; color: var(--sos-blue); }
.sos-help, .sos .description { color: var(--sos-muted); font-size: 12px; }

/* Buttons */
.sos-btn { background: #eef2f5; color: var(--sos-text); border: 1px solid var(--sos-border); padding: 7px 14px; border-radius: 6px; cursor: pointer; font-size: 13px; text-decoration: none; display: inline-block; }
.sos-btn:hover { background: #e2e8ed; }
.sos-btn-primary { background: var(--sos-green); color: #fff; border-color: var(--sos-green); }
.sos-btn-primary:hover { background: var(--sos-green-dark); }
.sos-btn-danger { background: var(--sos-danger); color: #fff; border-color: var(--sos-danger); }
.sos-btn-link { color: var(--sos-blue); text-decoration: none; padding: 4px 8px; font-size: 13px; }
.sos-btn-link:hover { text-decoration: underline; }

/* Tables */
.sos-table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 13px; }
.sos-table th { background: var(--sos-blue); color: #fff; text-align: left; padding: 8px 10px; font-weight: 600; }
.sos-table td { border: 1px solid var(--sos-border); padding: 8px 10px; }
.sos-table tbody tr:nth-child(even) { background: #f7f9fb; }
.sos-table tbody tr:hover { background: #eef5fb; }
.sos-meta th { background: #f0f4f7; width: 30%; }
.sos-meta td, .sos-meta th { border: 1px solid var(--sos-border); padding: 6px 10px; vertical-align: top; text-align: left; }

/* Badges */
.sos-badge { display: inline-block; padding: 2px 9px; border-radius: 12px; font-size: 11px; font-weight: 600; color: #fff; }

/* Forms */
.sos-form fieldset { border: 1px solid var(--sos-border); border-radius: 6px; padding: 12px 16px; margin: 12px 0; }
.sos-form legend { font-weight: 600; color: var(--sos-blue); padding: 0 6px; }
.sos-form label { display: block; margin: 8px 0; font-size: 13px; }
.sos-form input, .sos-form select, .sos-form textarea, .sos-filters input, .sos-filters select { padding: 7px 10px; border: 1px solid var(--sos-border); border-radius: 5px; font-size: 13px; font-family: inherit; }
.sos-form input[type="text"], .sos-form input[type="date"], .sos-form input[type="datetime-local"], .sos-form input[type="number"], .sos-form select, .sos-form textarea { width: 100%; max-width: 520px; }
.sos-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.sos-grid label { margin: 0; }
.sos-actions { margin-top: 16px; display: flex; gap: 8px; flex-wrap: wrap; }
.sos-form-msg { margin-top: 10px; font-size: 13px; }
.sos-form-msg.sos-ok { color: var(--sos-green); }
.sos-form-msg.sos-ko { color: var(--sos-danger); }
.sos-filters { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; align-items: center; }
.sos-filters input, .sos-filters select { width: auto; }

/* KPI tiles */
.sos-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.sos-kpi { background: linear-gradient(135deg, #fff, #eef6fb); border: 1px solid var(--sos-border); border-left: 4px solid var(--sos-green); border-radius: 8px; padding: 14px; }
.sos-kpi .num { display: block; font-size: 26px; font-weight: 700; color: var(--sos-blue); }
.sos-kpi .lbl { display: block; font-size: 12px; color: var(--sos-muted); margin-top: 4px; }

/* Cards */
.sos-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 12px 0; }
.sos-card { display: block; background: #fff; border: 1px solid var(--sos-border); border-radius: 8px; padding: 16px; text-decoration: none; color: var(--sos-blue); font-weight: 600; }
.sos-card:hover { border-color: var(--sos-green); box-shadow: 0 2px 8px rgba(0,0,0,.08); }

.sos-attachments, .sos-list { list-style: none; padding: 0; }
.sos-attachments li, .sos-list li { padding: 6px 0; border-bottom: 1px dashed var(--sos-border); }
.sos-attachments a { text-decoration: none; }
.sos-lines input { width: 100%; }

/* Responsive */
@media (max-width: 820px) {
	.sos-app { flex-direction: column; }
	.sos-sidebar { width: 100%; height: auto; position: relative; flex-direction: row; flex-wrap: wrap; }
	.sos-nav { flex-direction: row; flex-wrap: wrap; }
	.sos-nav-item { margin: 2px; }
	.sos-main { padding: 14px; }
}