/* Charte Groupe Dubreuil : navy + jaune soleil, Aileron, fonds blancs, cartes sans bordure. */
@font-face { font-family: "Aileron"; src: url("fonts/Aileron-Regular.otf") format("opentype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Aileron"; src: url("fonts/Aileron-Bold.otf") format("opentype"); font-weight: 700; font-display: swap; }

:root {
  --gd-navy-900: #0E2841; --gd-navy-800: #003660; --gd-navy-700: #174A73; --gd-navy-600: #186FA1;
  --gd-yellow-500: #FBC102; --gd-yellow-300: #FFE880;
  --gd-white: #fff; --gd-off-white: #F7F8FA; --gd-grey-100: #E8E8E8; --gd-grey-200: #D6D9DC;
  --gd-grey-400: #A5A5A5; --gd-grey-600: #82929A; --gd-grey-800: #44546A;
  --ok: #2F7D4F; --ok-bg: #E6F3EA; --warn: #7A5A00; --warn-bg: #FFF4CC; --err: #B42318; --err-bg: #FDECEA;
  --fg: var(--gd-navy-800); --fg-muted: var(--gd-grey-600); --border: rgba(14,40,65,0.10);
  --shadow-md: 0 4px 12px rgba(14,40,65,0.08); --shadow-lg: 0 12px 32px rgba(14,40,65,0.10);
  --radius-sm: 8px; --radius-md: 12px; --radius-lg: 20px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; font-family: "Aileron", "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 16px; line-height: 1.45; color: var(--fg); background: var(--gd-off-white); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -0.01em; color: var(--fg); text-wrap: balance; }
h1 { font-size: clamp(26px, 3vw, 34px); line-height: 1.1; }
h2 { font-size: 20px; line-height: 1.2; }
h3 { font-size: 16px; }
p { margin: 0 0 12px; }
a { color: var(--gd-navy-600); text-decoration: none; }
a:hover { color: var(--gd-navy-700); text-decoration: underline; text-underline-offset: 2px; }

/* --- en-tête --- */
.topbar { background: var(--gd-white); box-shadow: 0 1px 0 var(--border); }
.topbar-inner { max-width: 1120px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 48px); height: 68px; display: flex; align-items: center; gap: 32px; }
.brand { display: flex; align-items: center; gap: 14px; color: var(--fg); text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand img { height: 52px; width: auto; display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text .overline { font-size: 11px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--fg-muted); }
.brand-text .title { font-size: 17px; font-weight: 700; }
.nav { display: flex; gap: 4px; margin-left: 8px; }
.nav a { padding: 8px 12px; border-radius: var(--radius-sm); color: var(--fg); font-weight: 700; font-size: 14px; }
.nav a:hover { background: var(--gd-off-white); text-decoration: none; }
.nav a.active { background: var(--gd-navy-800); color: var(--gd-white); }
.topbar-user { margin-left: auto; display: flex; align-items: center; gap: 14px; font-size: 14px; color: var(--fg-muted); }
.topbar-user form { margin: 0; }
.link-button { background: none; border: 0; padding: 0; font: inherit; color: var(--gd-navy-600); cursor: pointer; }
.link-button:hover { text-decoration: underline; }

main { max-width: 1120px; margin: 0 auto; padding: 32px clamp(16px, 4vw, 48px) 64px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head .overline { font-size: 12px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--fg-muted); margin-bottom: 6px; }
.lede { color: var(--fg-muted); font-size: 15px; }

/* --- cartes, grilles --- */
.card { background: var(--gd-white); border-radius: var(--radius-md); box-shadow: var(--shadow-md); padding: 28px; margin-bottom: 20px; animation: rise 320ms var(--ease-out); }
.card h2 { margin-bottom: 14px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 20px; align-items: start; }
@media (max-width: 860px) { .grid-2 { grid-template-columns: 1fr; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* --- formulaires --- */
label { display: block; font-weight: 700; font-size: 14px; margin: 18px 0 6px; }
label:first-child { margin-top: 0; }
.hint { font-weight: 400; color: var(--fg-muted); }
textarea, select, input[type=text] { width: 100%; padding: 10px 12px; border: 1px solid var(--gd-grey-200); border-radius: var(--radius-sm); font: inherit; color: var(--fg); background: var(--gd-white); }
textarea:focus, select:focus, input:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--gd-yellow-500); outline-offset: 2px; }
input[type=file] { width: 100%; font: inherit; font-size: 14px; padding: 10px; border: 1px dashed var(--gd-grey-200); border-radius: var(--radius-sm); background: var(--gd-off-white); }
[hidden] { display: none !important; }
.file-list { list-style: none; padding: 0; margin: 8px 0 0; font-size: 13px; }
.file-list li { padding: 2px 0; }
.errorlist { list-style: none; margin: 6px 0 0; padding: 0; color: var(--err); font-size: 14px; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 400; margin: 0; padding: 7px 10px; border-radius: var(--radius-sm); font-size: 15px; cursor: pointer; }
.check:hover { background: var(--gd-off-white); }
.check input { width: 17px; height: 17px; accent-color: var(--gd-navy-800); margin: 0; flex: none; }
.check.pinned { font-weight: 700; }
.check.all { font-weight: 700; background: var(--gd-off-white); margin-bottom: 8px; }
.group-list { max-height: 460px; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 6px; }
.group-list .count { font-size: 12px; color: var(--fg-muted); margin-left: auto; }

/* --- boutons --- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; background: var(--gd-navy-800); color: var(--gd-white); border: 0; border-radius: var(--radius-sm); padding: 12px 22px; font: inherit; font-weight: 700; font-size: 15px; cursor: pointer; text-decoration: none; transition: background 160ms, transform 80ms; }
.btn:hover { background: var(--gd-navy-700); text-decoration: none; color: var(--gd-white); }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: wait; transform: none; }
.btn.secondary { background: var(--gd-white); color: var(--gd-navy-800); box-shadow: inset 0 0 0 1px var(--gd-navy-800); }
.btn.secondary:hover { background: var(--gd-off-white); }
.btn.danger { background: var(--err); }
.btn.danger:hover { background: #8E1A12; }
.btn.block { width: 100%; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 20px; align-items: center; }
.actions form { margin: 0; }

/* --- alertes, pastilles, tableaux --- */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 14px; }
.alert.warn { background: var(--warn-bg); color: var(--warn); }
.alert.err { background: var(--err-bg); color: var(--err); }
.alert.info { background: #E8F1F8; color: var(--gd-navy-700); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 11px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--gd-grey-100); color: var(--gd-grey-800); white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: 0.7; }
.pill.sent, .pill.done { background: var(--ok-bg); color: var(--ok); }
.pill.sending, .pill.running, .pill.queued, .pill.pending { background: var(--warn-bg); color: var(--warn); }
.pill.failed, .pill.unknown, .pill.partial, .pill.interrupted { background: var(--err-bg); color: var(--err); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-muted); font-weight: 700; }
tr:last-child td { border-bottom: 0; }
.muted { color: var(--fg-muted); font-size: 13px; }
.mono { font-size: 12px; color: var(--fg-muted); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; margin: 16px 0 20px; }
.stat { background: var(--gd-off-white); border-radius: var(--radius-sm); padding: 14px 16px; }
.stat b { display: block; font-size: 26px; line-height: 1; margin-bottom: 4px; color: var(--gd-navy-800); }
.stat span { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-muted); }
.stat.ok b { color: var(--ok); } .stat.err b { color: var(--err); }
.message-preview { white-space: pre-wrap; background: var(--gd-off-white); border-left: 3px solid var(--gd-yellow-500); padding: 12px 16px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-size: 15px; margin: 12px 0 18px; }
.cols { columns: 3; column-gap: 24px; list-style: none; padding: 0; margin: 0; }
.cols li { break-inside: avoid; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 15px; }
@media (max-width: 700px) { .cols { columns: 1; } }
.progress { height: 6px; background: var(--gd-grey-100); border-radius: 999px; overflow: hidden; margin: 8px 0 4px; }
.progress i { display: block; height: 100%; background: var(--gd-navy-800); transition: width 400ms var(--ease-out); }

/* --- page de connexion --- */
.login-body { min-height: 100vh; background-color: var(--gd-navy-900); background-image: url("wave-pattern-light.png"); background-size: 900px auto; background-blend-mode: overlay; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-card { background: var(--gd-white); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 40px 36px 28px; width: 100%; max-width: 400px; text-align: center; animation: rise 420ms var(--ease-out); }
.login-card img { height: 96px; margin-bottom: 8px; }
.login-card .overline { font-size: 12px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--fg-muted); margin-bottom: 6px; }
.login-card h1 { font-size: 24px; margin-bottom: 8px; }
.login-card p { color: var(--fg-muted); font-size: 14px; }
.login-card .btn { margin: 20px 0 16px; }
.ms-logo { display: inline-grid; grid-template-columns: 1fr 1fr; gap: 2px; width: 18px; height: 18px; }
.ms-logo i { display: block; }
.login-sep { display: flex; align-items: center; gap: 12px; color: var(--fg-muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; margin: 4px 0 8px; }
.login-sep::before, .login-sep::after { content: ""; flex: 1; height: 1px; background: var(--gd-grey-200); }
.login-form { text-align: left; }
.login-form label { margin-top: 12px; }
.login-form input[type=text], .login-form input[type=password] { width: 100%; padding: 10px 12px; border: 1px solid var(--gd-grey-200); border-radius: var(--radius-sm); font: inherit; font-size: 15px; background: var(--gd-white); }
.login-form input:focus { outline: 2px solid var(--gd-navy-700); outline-offset: 1px; }
.login-card .login-form .btn { margin: 18px 0 12px; }
.login-foot { font-size: 12px; color: var(--gd-grey-400); margin: 0; }
