*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --navy: #1d1675; --gold: #fbb03b; --blue: #1d72aa;
  --white: #fff; --off: #f7f8fc; --border: #e2e8f0;
  --text: #1a1a2e; --muted: #64748b; --red: #e53e3e; --green: #38a169;
  --r: 8px; --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
}
body { font-family: 'Inter', system-ui, sans-serif; background: var(--off); color: var(--text); font-size: 14px; line-height: 1.6; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* NAV */
.nav { background: var(--navy); color: #fff; display: flex; align-items: center; justify-content: space-between; padding: 0 1.5rem; height: 56px; position: fixed; top: 0; left: 0; right: 0; z-index: 100; box-shadow: 0 2px 8px rgba(0,0,0,.2); }
.nav-brand { font-weight: 700; font-size: 15px; letter-spacing: -.01em; display: flex; align-items: center; gap: 8px; }
.nav-brand span { color: var(--gold); }
.nav-links { display: flex; gap: .25rem; }
.nav-links a { color: rgba(255,255,255,.75); padding: .5rem .9rem; border-radius: 6px; font-size: 13px; font-weight: 500; transition: background .15s, color .15s; }
.nav-links a:hover, .nav-links a.active { background: rgba(255,255,255,.1); color: #fff; text-decoration: none; }
.nav-right { display: flex; align-items: center; gap: 1rem; font-size: 12px; color: rgba(255,255,255,.5); }
.nav-right a { color: rgba(255,255,255,.5); font-size: 12px; }

/* LAYOUT */
.wrap { max-width: 1100px; margin: 0 auto; padding: 1.5rem; margin-top: 56px; }
.page-title { font-size: 20px; font-weight: 700; color: var(--navy); margin-bottom: 1.5rem; display: flex; align-items: center; justify-content: space-between; }

/* CARDS */
.card { background: var(--white); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow); padding: 1.5rem; margin-bottom: 1.25rem; }
.card-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 1rem; }

/* STATS */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat { background: var(--white); border: 1px solid var(--border); border-radius: var(--r); padding: 1.2rem 1.5rem; box-shadow: var(--shadow); }
.stat-n { font-size: 2rem; font-weight: 700; color: var(--navy); line-height: 1; }
.stat-l { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* TABLE */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); padding: .75rem 1rem; border-bottom: 2px solid var(--border); }
td { padding: .75rem 1rem; border-bottom: 1px solid var(--border); font-size: 13px; vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #fafbff; }

/* BADGES */
.badge { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.badge-nouveau    { background: #e8f4fd; color: var(--blue); }
.badge-en_cours   { background: #fef3cd; color: #856404; }
.badge-répondu    { background: #d1f5e0; color: #1a6e42; }
.badge-converti   { background: #d0f0e8; color: #0f5132; }
.badge-archivé    { background: #f0f0f0; color: #666; }
.badge-actif      { background: #d1f5e0; color: #1a6e42; }
.badge-pause      { background: #fef3cd; color: #856404; }
.badge-termine    { background: #f0f0f0; color: #666; }
.badge-envoyé     { background: #d1f5e0; color: #1a6e42; }
.badge-erreur     { background: #fde8e8; color: var(--red); }
.badge-en_attente { background: #e8f4fd; color: var(--blue); }

/* BUTTONS */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: .55rem 1.1rem; border-radius: 6px; font-size: 13px; font-weight: 600; border: none; cursor: pointer; transition: all .15s; text-decoration: none !important; }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: #150e5e; }
.btn-gold { background: var(--gold); color: var(--navy); }
.btn-gold:hover { opacity: .9; }
.btn-sm { padding: .35rem .8rem; font-size: 12px; }
.btn-outline { background: transparent; color: var(--navy); border: 1.5px solid var(--navy); }
.btn-outline:hover { background: var(--navy); color: #fff; }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { opacity: .85; }
.btn-success { background: var(--green); color: #fff; }
.btn-success:hover { opacity: .9; }

/* FORMS */
.form-group { margin-bottom: 1rem; }
label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: .4rem; }
input[type=text], input[type=email], input[type=password], input[type=number], select, textarea {
  width: 100%; padding: .6rem .9rem; border: 1.5px solid var(--border); border-radius: 6px;
  font-size: 13px; color: var(--text); background: #fff; transition: border-color .15s;
  font-family: inherit;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); }
textarea { min-height: 140px; resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-actions { display: flex; gap: .75rem; margin-top: 1.5rem; }

/* ALERTS */
.alert { padding: .85rem 1.2rem; border-radius: 6px; margin-bottom: 1rem; font-size: 13px; }
.alert-success { background: #d1f5e0; color: #1a6e42; border: 1px solid #a3e9c0; }
.alert-error   { background: #fde8e8; color: var(--red); border: 1px solid #fbc5c5; }
.alert-info    { background: #e8f4fd; color: var(--blue); border: 1px solid #b8d9f5; }

/* TODAY HIGHLIGHT */
.today-row td { background: #fffbf0 !important; }
.today-row:hover td { background: #fff8e6 !important; }

/* EMPTY */
.empty { text-align: center; padding: 3rem 1rem; color: var(--muted); }
.empty-icon { font-size: 2.5rem; margin-bottom: .75rem; }

/* LOGIN */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--navy); }
.login-box { background: #fff; border-radius: 12px; padding: 2.5rem; width: 100%; max-width: 380px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.login-logo { text-align: center; font-size: 22px; font-weight: 700; color: var(--navy); margin-bottom: 1.8rem; }
.login-logo span { color: var(--gold); }

/* UTIL */
.flex { display: flex; align-items: center; gap: .75rem; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.text-muted { color: var(--muted); }
.text-sm { font-size: 12px; }
.mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: .5rem; } .mb-2 { margin-bottom: 1rem; }

@media(max-width: 640px) {
  .nav-links a span { display: none; }
  .form-row { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
}
