/* Espace chercheur CIRES — charte : orange, blanc, brun-noir. Aucun bleu. */
:root{
    --e-ink:#201511; --e-brown:#2b1c17; --e-orange:#df5a1b; --e-orange-dark:#bf4711;
    --e-muted:#6f6158; --e-rule:#e2dcd5; --e-paper:#f7f4f0; --e-white:#fff;
    --e-ok:#2f6b3a; --e-ok-bg:#eef5ef; --e-err:#9b2c14; --e-err-bg:#fbece6; --e-warn-bg:#fcf3e3;
}
body.ech-app, body.ech-auth{ background:var(--e-paper); color:var(--e-ink); }

/* ---------- Écrans de connexion ---------- */
body.ech-auth{ min-height:100vh; display:flex; flex-direction:column; align-items:center; justify-content:center; padding:24px 16px; }
.ech-auth-card{ width:100%; max-width:420px; background:var(--e-white); border:1px solid var(--e-rule); border-top:3px solid var(--e-orange); padding:32px 32px 28px; }
.ech-auth-brand{ display:flex; align-items:center; gap:12px; text-decoration:none; color:var(--e-ink); margin-bottom:26px; }
.ech-auth-brand img{ width:48px; height:auto; }
.ech-auth-brand strong{ display:block; font-family:var(--ed-serif); font-size:1.4rem; line-height:1; }
.ech-auth-brand small{ display:block; font-size:13px; color:var(--e-muted); letter-spacing:.06em; text-transform:uppercase; font-weight:600; margin-top:4px; }
.ech-auth-card h1{ font-size:1.55rem; margin:0 0 8px; }
.ech-auth-card .ech-lead{ color:var(--e-muted); font-size:15px; margin-bottom:22px; }
.ech-auth-links{ margin-top:18px; font-size:15px; }
.ech-auth-links a, .ech-auth-foot a{ color:var(--e-orange-dark); }
.ech-auth-foot{ margin-top:18px; font-size:14px; }

/* ---------- Formulaires ---------- */
.ech-field{ margin-bottom:18px; }
.ech-field label, .ech-label{ display:block; font-weight:600; font-size:15px; margin-bottom:6px; color:var(--e-ink); }
.ech-field .ech-help{ display:block; font-size:13.5px; color:var(--e-muted); margin-top:5px; }
.ech-field input[type=text], .ech-field input[type=email], .ech-field input[type=password],
.ech-field input[type=url], .ech-field input[type=tel], .ech-field textarea{
    width:100%; border:1px solid #cdc4bb; border-radius:2px; padding:9px 11px; font:inherit; font-size:16px; background:#fff; color:var(--e-ink);
}
.ech-field textarea{ min-height:150px; resize:vertical; line-height:1.55; }
.ech-field input:focus, .ech-field textarea:focus{ outline:none; border-color:var(--e-orange); box-shadow:0 0 0 3px rgba(223,90,27,.16); }
.ech-field.has-error input, .ech-field.has-error textarea{ border-color:var(--e-err); }
.ech-field .ech-error{ display:block; color:var(--e-err); font-size:14px; margin-top:5px; }
.ech-field input[type=file]{ font-size:15px; }
.ech-btn{ display:inline-flex; align-items:center; justify-content:center; gap:8px; border:1px solid var(--e-orange); background:var(--e-orange); color:#fff; font-weight:600; font-size:16px; padding:10px 20px; border-radius:2px; text-decoration:none; cursor:pointer; }
.ech-btn:hover{ background:var(--e-orange-dark); border-color:var(--e-orange-dark); color:#fff; }
.ech-btn.is-secondary{ background:#fff; color:var(--e-ink); border-color:#cdc4bb; }
.ech-btn.is-secondary:hover{ border-color:var(--e-ink); color:var(--e-ink); background:#fff; }
.ech-btn.is-block{ width:100%; }
.ech-btn.is-small{ font-size:14px; padding:6px 12px; }

/* ---------- Alertes ---------- */
.ech-alert{ border-left:3px solid var(--e-muted); background:#fff; padding:12px 14px; margin-bottom:20px; font-size:15px; }
.ech-alert.is-success{ border-color:var(--e-ok); background:var(--e-ok-bg); }
.ech-alert.is-error{ border-color:var(--e-err); background:var(--e-err-bg); }
.ech-alert.is-warning{ border-color:var(--e-orange); background:var(--e-warn-bg); }
.ech-alert.is-info{ border-color:var(--e-brown); background:#fff; }

/* ---------- En-tête des pages connectées ---------- */
.ech-header{ background:var(--e-white); border-bottom:1px solid var(--e-rule); }
.ech-header-inner{ display:flex; align-items:center; justify-content:space-between; gap:16px; padding-top:14px; padding-bottom:14px; }
.ech-brand{ display:flex; align-items:center; gap:12px; text-decoration:none; color:var(--e-ink); }
.ech-brand img{ width:42px; }
.ech-brand strong{ display:block; font-family:var(--ed-serif); font-size:1.3rem; line-height:1; }
.ech-brand small{ display:block; font-size:12.5px; color:var(--e-muted); letter-spacing:.06em; text-transform:uppercase; font-weight:600; margin-top:3px; }
.ech-user{ display:flex; align-items:center; gap:14px; font-size:15px; }
.ech-user-name{ font-weight:600; }
.ech-logout{ background:none; border:0; color:var(--e-muted); font:inherit; font-size:15px; cursor:pointer; padding:0; }
.ech-logout:hover{ color:var(--e-orange-dark); }
.ech-nav{ background:var(--e-brown); }
.ech-nav ul{ list-style:none; margin:0; padding:0; display:flex; flex-wrap:wrap; }
.ech-nav li a, .ech-nav li span{ display:block; padding:12px 16px; color:rgba(255,255,255,.88); text-decoration:none; font-size:15.5px; font-weight:600; border-bottom:3px solid transparent; }
.ech-nav li a:hover{ color:#fff; border-bottom-color:rgba(255,255,255,.35); }
.ech-nav li a.is-active{ color:#fff; border-bottom-color:var(--e-orange); }
.ech-nav li span.is-soon{ color:rgba(255,255,255,.42); cursor:default; }
.ech-nav li span.is-soon small{ font-size:11px; text-transform:uppercase; letter-spacing:.06em; margin-left:4px; }

.ech-main{ padding:36px 0 56px; }
.ech-footer{ border-top:1px solid var(--e-rule); padding:18px 0; font-size:14px; color:var(--e-muted); background:#fff; }
.ech-footer a{ color:var(--e-orange-dark); }

/* ---------- Contenu ---------- */
.ech-page-title{ margin-bottom:28px; }
.ech-page-title h1{ font-size:clamp(1.7rem,1.2rem + 1.5vw,2.3rem); margin:0 0 6px; }
.ech-page-title p{ color:var(--e-muted); margin:0; font-size:16.5px; }
.ech-panel{ background:#fff; border:1px solid var(--e-rule); padding:24px; margin-bottom:24px; }
.ech-panel > h2{ font-size:1.3rem; margin:0 0 16px; padding-bottom:12px; border-bottom:1px solid var(--e-rule); }
.ech-grid-2{ display:grid; grid-template-columns:1fr 1fr; gap:0 24px; }
.ech-kv{ display:grid; grid-template-columns:200px 1fr; gap:8px 16px; margin:0; font-size:15.5px; }
.ech-kv dt{ color:var(--e-muted); font-weight:600; }
.ech-kv dd{ margin:0; }

.ech-profile-head{ display:flex; gap:20px; align-items:center; }
.ech-avatar{ width:96px; height:96px; flex:0 0 96px; background:#efe9e2; color:var(--e-ink); display:flex; align-items:center; justify-content:center; font-family:var(--ed-serif); font-size:2rem; font-weight:600; overflow:hidden; }
.ech-avatar img{ width:100%; height:100%; object-fit:cover; }
.ech-profile-head h2{ font-size:1.5rem; margin:0 0 4px; border:0; padding:0; }
.ech-profile-head p{ margin:0; color:var(--e-muted); }

.ech-status{ display:inline-block; font-size:12.5px; font-weight:700; letter-spacing:.06em; text-transform:uppercase; }
.ech-status.is-pending{ color:var(--e-orange-dark); }
.ech-status.is-ok{ color:var(--e-ok); }
.ech-status.is-refused{ color:var(--e-err); }

.ech-cards{ display:grid; grid-template-columns:repeat(3,1fr); gap:20px; }
.ech-card{ background:#fff; border:1px solid var(--e-rule); border-top:3px solid var(--e-brown); padding:20px; text-decoration:none; color:var(--e-ink); display:block; }
a.ech-card:hover{ border-top-color:var(--e-orange); color:var(--e-ink); }
.ech-card h3{ font-size:1.15rem; margin:0 0 6px; }
.ech-card p{ margin:0; color:var(--e-muted); font-size:15px; }
.ech-card.is-soon{ opacity:.6; }
.ech-card .ech-soon-tag{ font-size:11.5px; text-transform:uppercase; letter-spacing:.07em; color:var(--e-muted); font-weight:700; }

.ech-progress{ height:6px; background:#efe9e2; margin:10px 0 6px; }
.ech-progress span{ display:block; height:100%; background:var(--e-orange); }
.ech-checklist{ list-style:none; padding:0; margin:0; columns:2; font-size:15px; }
.ech-checklist li{ padding:3px 0; break-inside:avoid; }
.ech-checklist .fa-check{ color:var(--e-ok); width:18px; }
.ech-checklist .fa-circle{ color:#cdc4bb; width:18px; font-size:9px; vertical-align:2px; }

.ech-file-current{ display:flex; align-items:center; gap:12px; font-size:14.5px; color:var(--e-muted); margin-bottom:8px; }
.ech-file-current img{ width:56px; height:56px; object-fit:cover; border:1px solid var(--e-rule); }
.ech-actions{ display:flex; gap:12px; flex-wrap:wrap; align-items:center; }

@media (max-width: 991.98px){ .ech-cards{ grid-template-columns:1fr 1fr; } }
@media (max-width: 767.98px){
    .ech-grid-2{ grid-template-columns:1fr; }
    .ech-cards{ grid-template-columns:1fr; }
    .ech-kv{ grid-template-columns:1fr; gap:2px; }
    .ech-kv dd{ margin-bottom:10px; }
    .ech-checklist{ columns:1; }
    .ech-user-name{ display:none; }
    .ech-nav ul{ flex-wrap:nowrap; overflow-x:auto; }
    .ech-nav li a, .ech-nav li span{ white-space:nowrap; padding:11px 12px; }
    .ech-panel{ padding:18px; }
    .ech-auth-card{ padding:24px 20px; }
}

/* ---------- Notifications ---------- */
.ech-bell{ position:relative; color:var(--e-ink); font-size:19px; text-decoration:none; padding:2px 4px; }
.ech-bell:hover, .ech-bell.is-active{ color:var(--e-orange-dark); }
.ech-bell-count{ position:absolute; top:-6px; right:-10px; background:var(--e-orange); color:#fff; font-size:11px; font-weight:700; line-height:1; padding:3px 5px; min-width:18px; text-align:center; }
.ech-role{ display:block; font-size:11.5px; text-transform:uppercase; letter-spacing:.06em; color:var(--e-orange-dark); font-weight:700; }
.ech-notifs{ list-style:none; margin:0; padding:0; }
.ech-notifs li{ border-top:1px solid var(--e-rule); padding:14px 0; display:flex; gap:14px; justify-content:space-between; }
.ech-notifs li:first-child{ border-top:0; }
.ech-notifs li.is-unread strong::before{ content:""; display:inline-block; width:8px; height:8px; background:var(--e-orange); margin-right:8px; vertical-align:1px; }
.ech-notifs a{ color:var(--e-ink); }
.ech-notifs small{ color:var(--e-muted); white-space:nowrap; }

/* ---------- Courrier ---------- */
.ech-tabs{ display:flex; flex-wrap:wrap; gap:2px; border-bottom:1px solid var(--e-rule); margin-bottom:22px; }
.ech-tabs a{ padding:10px 16px; text-decoration:none; color:var(--e-muted); font-weight:600; border-bottom:3px solid transparent; margin-bottom:-1px; }
.ech-tabs a.is-active{ color:var(--e-ink); border-bottom-color:var(--e-orange); }
.ech-tabs a .ech-count{ display:inline-block; background:var(--e-orange); color:#fff; font-size:11.5px; padding:1px 6px; margin-left:6px; }
.cr-table{ width:100%; border-collapse:collapse; font-size:15px; background:#fff; }
.cr-table th{ text-align:left; font-size:12px; text-transform:uppercase; letter-spacing:.05em; color:var(--e-muted); padding:10px 12px; border-bottom:1px solid var(--e-rule); background:var(--e-paper); }
.cr-table td{ padding:12px; border-bottom:1px solid var(--e-rule); vertical-align:top; }
.cr-table tr.is-unread td{ font-weight:600; }
.cr-table a{ color:var(--e-ink); }
.cr-num{ font-family:var(--ed-serif); font-weight:600; white-space:nowrap; }
.cr-badge{ display:inline-block; font-size:11.5px; font-weight:700; letter-spacing:.05em; text-transform:uppercase; padding:2px 7px; border:1px solid currentColor; white-space:nowrap; }
.cr-badge.is-urgent{ color:var(--e-orange-dark); } .cr-badge.is-tres-urgent{ color:#fff; background:var(--e-err); border-color:var(--e-err); }
.cr-badge.is-late{ color:var(--e-err); } .cr-badge.is-ok{ color:var(--e-ok); } .cr-badge.is-muted{ color:var(--e-muted); }
.cr-badge.is-conf{ color:var(--e-brown); }
.cr-fiche{ border:2px solid var(--e-brown); background:#fff; padding:18px 20px; margin-bottom:14px; }
.cr-fiche h3{ font-size:1.05rem; text-transform:uppercase; letter-spacing:.08em; margin:0 0 12px; border-bottom:1px solid var(--e-brown); padding-bottom:8px; }
.cr-instr{ display:grid; grid-template-columns:1fr 1fr; gap:4px 18px; margin:10px 0 14px; padding:0; list-style:none; font-size:15px; }
.cr-instr li .fa-square-check{ color:var(--e-orange-dark); } .cr-instr li .fa-square{ color:#cdc4bb; }
.cr-instr label{ display:flex; gap:8px; align-items:center; font-weight:400; cursor:pointer; }
.cr-journal{ list-style:none; margin:0; padding:0; font-size:14.5px; }
.cr-journal li{ padding:8px 0; border-top:1px solid var(--e-rule); }
.cr-journal small{ color:var(--e-muted); }
.cr-files a{ display:inline-flex; gap:8px; align-items:center; border:1px solid var(--e-rule); padding:8px 12px; margin:0 8px 8px 0; text-decoration:none; color:var(--e-ink); background:#fff; }
.cr-files a:hover{ border-color:var(--e-orange); }
.cr-filters{ display:flex; flex-wrap:wrap; gap:10px; margin-bottom:16px; align-items:flex-end; }
.cr-filters input, .cr-filters select{ border:1px solid #cdc4bb; border-radius:2px; padding:7px 10px; font:inherit; font-size:15px; background:#fff; }
.ech-field select, .ech-field input[type=date]{ width:100%; border:1px solid #cdc4bb; border-radius:2px; padding:9px 11px; font:inherit; font-size:16px; background:#fff; }
.cr-stats{ display:grid; grid-template-columns:repeat(4,1fr); gap:14px; margin-bottom:22px; }
.cr-stat{ background:#fff; border:1px solid var(--e-rule); border-top:3px solid var(--e-brown); padding:14px 16px; text-decoration:none; color:var(--e-ink); }
.cr-stat strong{ display:block; font-family:var(--ed-serif); font-size:1.9rem; line-height:1.1; }
.cr-stat span{ font-size:13px; color:var(--e-muted); text-transform:uppercase; letter-spacing:.05em; font-weight:600; }
.cr-stat.is-alert{ border-top-color:var(--e-err); }
@media (max-width: 767.98px){
    .cr-instr{ grid-template-columns:1fr; } .cr-stats{ grid-template-columns:1fr 1fr; }
    .cr-table thead{ display:none; } .cr-table tr{ display:block; border-bottom:1px solid var(--e-rule); padding:8px 0; }
    .cr-table td{ display:block; border:0; padding:3px 12px; }
}

/* ---------- Liens : jamais le bleu par défaut du navigateur (charte CIRES) ---------- */
:where(body.ech-app, body.ech-auth) a{ color: var(--e-orange-dark); }
:where(body.ech-app, body.ech-auth) a:hover{ color: var(--e-ink); }
body.ech-app a.cr-num, body.ech-app .cr-table a{ color: var(--e-ink); }
body.ech-app a.cr-num:hover, body.ech-app .cr-table a:hover{ color: var(--e-orange-dark); }
