/* Organisation Manager — interface applicative front-end (connexion + coquille).
   Les composants (cartes, tableaux, badges, formulaires) sont dans admin.css.
   Propriétés logiques (inline/block) partout : prêt pour l'arabe et le RTL. */

.om-app {
	--om-sidebar-bg: #0f1d33;
	--om-sidebar-ink: #c9d3e3;
	--om-sidebar-ink-strong: #ffffff;
	--om-sidebar-hover: rgba(255, 255, 255, .07);
	--om-sidebar-current: rgba(255, 255, 255, .12);
	--om-sidebar-w: 248px;
	--om-font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Noto Sans Arabic", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body.om-app { font-family: var(--om-font); font-size: 14px; line-height: 1.5; color: var(--om-text); background: var(--om-bg); -webkit-font-smoothing: antialiased; }
.om-app a { color: var(--om-primary); }
.om-app a.om-btn { color: var(--om-text); text-decoration: none; }
.om-app a.om-btn-primary, .om-app a.om-btn-primary:hover { color: var(--om-primary-ink); }
.om-table code { white-space: nowrap; }
.om-app h1, .om-app h2, .om-app h3 { color: var(--om-text); line-height: 1.25; }
.om-app code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; background: #f0f2f5; padding: 1px 5px; border-radius: 4px; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.om-skip { position: absolute; inset-inline-start: -9999px; top: 8px; z-index: 100; background: #fff; padding: 8px 12px; border-radius: 6px; }
.om-skip:focus { inset-inline-start: 8px; }
.om-icon { flex: none; }

/* Champs de formulaire (hors wp-admin, aucun style de base n'est fourni) */
.om-app input[type=text], .om-app input[type=email], .om-app input[type=tel], .om-app input[type=password],
.om-app input[type=search], .om-app input[type=date], .om-app input[type=time], .om-app input[type=datetime-local], .om-app input[type=number],
.om-app select, .om-app textarea {
	font: inherit; color: var(--om-text); background: #fff; border: 1px solid #cdd2da; border-radius: 8px; padding: 8px 11px; min-height: 38px; width: 100%;
	transition: border-color .15s, box-shadow .15s;
}
.om-app textarea { min-height: 80px; resize: vertical; }
.om-app input:focus, .om-app select:focus, .om-app textarea:focus { outline: none; border-color: var(--om-primary); box-shadow: 0 0 0 3px rgba(42, 93, 176, .18); }
.om-app input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--om-primary); margin: 0; }
.om-app button { font: inherit; }
.om-filters input[type=search], .om-filters select { width: auto; }
.om-btn { min-height: 38px; }
.om-btn-block { width: 100%; justify-content: center; }

/* ---------- Coquille ---------- */
.om-shell { display: flex; min-height: 100vh; }
.om-sidebar {
	position: sticky; top: 0; height: 100vh; width: var(--om-sidebar-w); flex: none;
	background: var(--om-sidebar-bg); color: var(--om-sidebar-ink); display: flex; flex-direction: column; z-index: 40;
}
.om-sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; color: var(--om-sidebar-ink-strong); font-weight: 600; font-size: 15px; }
.om-brand-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.om-brand-mark { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: linear-gradient(135deg, #3b6fd1, #2a5db0); color: #fff; }
.om-brand-mark .om-icon { width: 24px; height: 24px; }
.om-brand-mark-sm { width: 32px; height: 32px; border-radius: 9px; }
.om-brand-mark-sm .om-icon { width: 18px; height: 18px; }

.om-nav { flex: 1; overflow-y: auto; padding: 6px 10px 12px; }
.om-nav ul { list-style: none; margin: 0 0 6px; padding: 0; }
.om-nav-heading { margin: 16px 10px 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #7f8ba0; }
.om-nav-link { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 8px; color: var(--om-sidebar-ink) !important; text-decoration: none; font-weight: 500; }
.om-nav-link:hover { background: var(--om-sidebar-hover); color: var(--om-sidebar-ink-strong) !important; }
.om-nav-link.is-current { background: var(--om-sidebar-current); color: var(--om-sidebar-ink-strong) !important; box-shadow: inset 3px 0 0 #5b8def; }
.om-rtl .om-nav-link.is-current { box-shadow: inset -3px 0 0 #5b8def; }
.om-nav-link:focus-visible { outline: 2px solid #5b8def; outline-offset: 1px; }

.om-sidebar-user { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-top: 1px solid rgba(255, 255, 255, .08); }
.om-avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: #23395e; color: #fff; font-weight: 600; flex: none; }
.om-user-meta { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.om-user-meta strong { color: #fff; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.om-user-meta span { font-size: 12px; color: #8e9ab0; }
.om-logout { color: var(--om-sidebar-ink) !important; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; }
.om-logout:hover { background: var(--om-sidebar-hover); color: #fff !important; }

.om-main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.om-topbar { display: none; }
.om-main { flex: 1; padding: 28px 32px; max-width: 1320px; width: 100%; }
.om-main:focus { outline: none; }
.om-main-col > .om-footer { padding: 0 32px 24px; margin: 0; }
.om-view .om-header { margin-block-end: 22px; }
.om-sidebar-backdrop { display: none; }

/* ---------- Connexion ---------- */
.om-login-page { background: #eef1f6; }
.om-login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
.om-login-single { grid-template-columns: 1fr; }
.om-login-brand {
	position: relative; overflow: hidden; display: flex; align-items: flex-end; padding: 56px;
	background: radial-gradient(1200px 600px at 10% 0%, #2a5db0 0%, transparent 60%), linear-gradient(160deg, #0f1d33 0%, #13284a 55%, #1b3a6b 100%);
	color: #e6ecf6;
}
.om-login-brand::after {
	content: ""; position: absolute; inset: 0; opacity: .08; pointer-events: none;
	background-image: linear-gradient(rgba(255,255,255,.6) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.6) 1px, transparent 1px);
	background-size: 44px 44px;
}
.om-login-brand-inner { position: relative; max-width: 440px; }
.om-login-brand .om-brand-mark { width: 56px; height: 56px; border-radius: 16px; margin-bottom: 22px; }
.om-login-tagline { font-size: 22px; line-height: 1.4; font-weight: 500; margin: 0; color: #f2f5fa; }
.om-login-panel { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 24px; }
.om-login-card { width: 100%; max-width: 400px; background: #fff; border: 1px solid var(--om-border); border-radius: 16px; padding: 32px 30px; box-shadow: 0 10px 30px rgba(15, 29, 51, .08); }
.om-login-head { text-align: center; margin-bottom: 22px; }
.om-login-head .om-brand-mark { margin-bottom: 12px; }
.om-login-head h1 { font-size: 21px; margin: 0 0 4px; }
.om-login-head p { margin: 0; color: var(--om-muted); }
.om-login-form { gap: 16px; max-width: none; }
.om-login-form label { font-weight: 500; font-size: 13px; }
.om-login-form .om-check { font-weight: 400; }
.om-login-form .om-btn-block { min-height: 44px; font-size: 15px; margin-top: 4px; }
.om-login-links { text-align: center; margin: 18px 0 0; font-size: 13px; }
.om-login-foot { color: var(--om-muted); font-size: 12px; margin-top: 18px; text-align: center; }
.om-login .om-notice { margin-bottom: 18px; box-shadow: none; background: #fafbfc; }
.om-login-head .om-brand-mark-sm { display: none; }

/* ---------- Tablette / mobile ---------- */
@media (max-width: 960px) {
	.om-login { grid-template-columns: 1fr; }
	.om-login-brand { display: none; }
	.om-login-head .om-brand-mark-sm { display: inline-grid; }

	.om-sidebar { position: fixed; inset-block: 0; inset-inline-start: 0; transform: translateX(-100%); transition: transform .2s ease; box-shadow: 0 0 40px rgba(0,0,0,.25); }
	.om-rtl .om-sidebar { transform: translateX(100%); }
	.om-nav-open .om-sidebar { transform: none; }
	.om-nav-open .om-sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(15, 29, 51, .45); z-index: 30; }
	.om-topbar { display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 20; background: #fff; border-bottom: 1px solid var(--om-border); padding: 8px 12px; }
	.om-nav-toggle { display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--om-border); background: #fff; border-radius: 8px; cursor: pointer; color: var(--om-text); }
	.om-topbar-title { font-weight: 600; }
	.om-main { padding: 20px 16px; }
	.om-main-col > .om-footer { padding: 0 16px 20px; }
}
@media (max-width: 600px) {
	.om-login-card { padding: 26px 20px; border-radius: 14px; }
	.om-header { align-items: stretch; }
	.om-header-actions { width: 100%; }
	.om-header-actions .om-btn { flex: 1; justify-content: center; }
	.om-filters input[type=search], .om-filters select { width: 100%; }
	.om-filters label { width: 100%; }
}

@media print {
	.om-sidebar, .om-topbar, .om-header-actions, .om-filters, .om-pagination, .om-footer { display: none !important; }
	.om-main { padding: 0; }
	body.om-app { background: #fff; }
}

/* ---------- Module membres / participations (0.3.0) ---------- */
.om-mt { margin-top: 16px; }
.om-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.om-form-section { display: flex; flex-direction: column; gap: 14px; }
.om-form-section h2 { margin: 0; }
.om-small-label { font-size: 12px; font-weight: 400; }
.om-req { color: var(--om-danger); }
.om-field-error { color: var(--om-danger); font-size: 12px; font-weight: 500; }
.om-app [aria-invalid="true"] { border-color: var(--om-danger) !important; box-shadow: 0 0 0 3px rgba(198, 40, 40, .12); }
.om-error-list { margin: 6px 0 0; padding-inline-start: 18px; }
.om-inline-form { display: inline; margin: 0; }
.om-link-btn { background: none; border: 0; padding: 0; color: var(--om-primary); cursor: pointer; text-decoration: underline; font: inherit; }
.om-link-danger { color: var(--om-danger); }
.om-section-head { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.om-section-head h2 { margin: 0; }
.om-kpis-compact { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.om-kpis-compact .om-kpi-value { font-size: 20px; }
.om-profile-badges { display: flex; flex-wrap: wrap; gap: 6px; margin: -10px 0 16px; }
.om-dl-spaced { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--om-border); }
.om-duration { margin: 0; padding: 10px 12px; background: #f3f6fb; border-radius: 8px; }
.om-duration.is-error strong { color: var(--om-danger); }
.om-radios { border: 0; margin: 0; padding: 0; display: flex; gap: 20px; flex-wrap: wrap; }
.om-table tfoot th { background: #fafbfc; text-align: start; }
.om-history li { flex-wrap: wrap; }
.om-small { font-size: 12px; }
@media (max-width: 960px) { .om-grid-3 { grid-template-columns: 1fr; } }
@media (max-width: 600px) { .om-section-head .om-header-actions { width: 100%; } }
.om-label { display: inline; }
