* { box-sizing: border-box; }
body { font-family: system-ui, sans-serif; margin: 0; color: #222; background: #f7f7f9; }
/* --- En-tête aux couleurs Spekty ------------------------------------------ */
.app-header { background: #1f2c54; border-bottom: 3px solid #3d92d1; box-shadow: 0 2px 12px rgba(0,0,0,.18); padding: .35rem 1.2rem; margin-bottom: 1.2rem; color: #fff; }
.header-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.4rem; }
.app-brand { display: flex; align-items: center; gap: .65rem; }
.app-brand-logo-img { height: 30px; width: auto; display: block; }
.app-brand-name { color: rgba(255,255,255,.72); font-size: .9rem; font-weight: 500; padding-left: .65rem; border-left: 1px solid rgba(255,255,255,.28); }
.app-brand-name .app-version { font-size: 0.7rem; font-weight: 400; color: rgba(255,255,255,0.5); margin-left: 0.3rem; }

.user-box { font-size: 0.85rem; color: rgba(255,255,255,0.85); display: flex; align-items: center; gap: 0.75rem; }
.user-box .badge-role { padding: 0.1rem 0.5rem; border-radius: 10px; background: #2d8a48; font-size: 0.75rem; }
.user-box .badge-role.admin { background: #cc7a00; }
.user-box button.logout { background: rgba(255,255,255,0.14); color: #ffc2c2; padding: 0.25rem 0.6rem; font-size: 0.8rem; }
.user-box button.logout:hover { background: rgba(255,255,255,0.24); color: #fff; }

.app-header nav { align-items: center; }
.app-header nav a.nav-link { color: #e7ecf6; opacity: .82; font-weight: 500; margin-right: 1rem; text-decoration: none; padding: 0.25rem 0.15rem; }
.app-header nav a.nav-link:hover { color: #fff; opacity: 1; }
.app-header nav a.nav-link.active { color: #fff; opacity: 1; font-weight: 700; text-decoration: underline; text-decoration-color: #3d92d1; text-decoration-thickness: 2px; text-underline-offset: 6px; }
main { padding: 1.5rem; max-width: 1400px; margin: 0 auto; }
td.actions, table td:last-child, table th:last-child { white-space: nowrap; }
table td:last-child button { margin-right: 0.25rem; }
table { width: 100%; border-collapse: collapse; background: white; table-layout: auto; }
th, td { padding: 0.5rem 0.75rem; text-align: left; border-bottom: 1px solid #e5e5e5; vertical-align: top; }
th { background: #eef1f5; font-weight: 600; }
td input[type="text"], td input:not([type]) { width: 100%; box-sizing: border-box; }
button { padding: 0.5rem 1rem; border: none; border-radius: 4px; background: #1f3a5f; color: white; cursor: pointer; }
button.secondary { background: #777; }
button.danger { background: #b33a3a; }
.badge { padding: 0.15rem 0.5rem; border-radius: 10px; color: white; font-size: 0.8rem; }
.badge.graph { background: #2d8a48; }
.badge.fallback_heuristic { background: #cc7a00; }
.badge.manual { background: #3366cc; }
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; }
.modal { background: white; padding: 1.5rem; border-radius: 8px; min-width: 320px; }
.modal h2 { margin-top: 0; }
#toast { position: fixed; bottom: 1rem; right: 1rem; max-width: 420px; }
.toast-item { background: #333; color: white; padding: 0.75rem 1rem; border-radius: 4px; margin-top: 0.5rem; }
.toast-item.success { background: #2d8a48; }
.toast-item.error { background: #b33a3a; }
.banner-error { background: #fde2e2; border: 1px solid #b33a3a; color: #711; padding: 0.75rem 1rem; border-radius: 4px; margin-bottom: 1rem; }
