/* ============================================================
   TC Dieppe — style.css
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --nv:  #0f1e3d;
  --nv2: #1a2f52;
  --rd:  #e03030;
  --gd:  #c8a84b;
}

body {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 14px;
  background: #f0f2f5;
  color: #1a1a1a;
  line-height: 1.5;
}

/* ── TOPBAR ─────────────────────────────────────────────── */
.topbar {
  background: var(--nv);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  height: 52px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.brand        { display: flex; align-items: center; gap: 12px; }
.logo         { width: 36px; height: 36px; border-radius: 8px; background: var(--nv2);
                border: 1px solid rgba(200,168,75,.5); display: flex; align-items: center;
                justify-content: center; font-size: 20px; color: var(--gd); }
.brand-t1     { color: #fff; font-size: 14px; font-weight: 600; }
.brand-t2     { color: #a0bcd8; font-size: 11px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-user  { color: #fff; font-size: 13px; }
.role-badge   { background: rgba(200,168,75,.2); color: var(--gd);
                border: 1px solid rgba(200,168,75,.4); border-radius: 20px;
                padding: 2px 10px; font-size: 11px; }
.topbar-logout{ color: #a0bcd8; font-size: 18px; text-decoration: none; }
.topbar-logout:hover { color: #fff; }

/* ── NAV ────────────────────────────────────────────────── */
.nav   { background: var(--nv); display: flex; border-bottom: 2px solid var(--nv2); }
.tab   { color: #fff !important; font-size: 13px; font-weight: 500;
         padding: 11px 18px; text-decoration: none;
         border-bottom: 3px solid transparent; margin-bottom: -2px;
         display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.tab:hover  { background: rgba(255,255,255,.08); }
.tab.active { color: var(--rd) !important; border-bottom-color: var(--rd);
              background: rgba(255,255,255,.05); }

/* ── CONTENU ────────────────────────────────────────────── */
.page-content { max-width: 1200px; margin: 0 auto; padding: 24px 20px; }
.page-header  { margin-bottom: 20px; }
.page-header h2 { font-size: 20px; font-weight: 600; color: var(--nv); }
.page-sub     { font-size: 13px; color: #666; margin-top: 2px; }

/* ── MÉTRIQUES ──────────────────────────────────────────── */
.metrics-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; margin-bottom: 20px; }
.metric-card  { background: var(--nv); border-radius: 10px; padding: 14px 16px;
                border: 1px solid rgba(255,255,255,.08); }
.metric-label { font-size: 12px; color: #a0bcd8; margin-bottom: 6px; }
.metric-value { font-size: 28px; font-weight: 700; color: #fff; }
.metric-value.green  { color: #5db87a; }
.metric-value.orange { color: #e09040; }
.metric-value.red    { color: #e05050; }

/* ── CARD ───────────────────────────────────────────────── */
.card       { background: #fff; border: 1px solid #e0e0e0; border-radius: 12px;
              padding: 16px 20px; margin-bottom: 16px; }
.card-title { font-size: 12px; font-weight: 700; color: #888; text-transform: uppercase;
              letter-spacing: .05em; margin-bottom: 14px; }

/* ── TABLE ──────────────────────────────────────────────── */
.table              { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th           { text-align: left; font-size: 11px; font-weight: 700; color: #888;
                      text-transform: uppercase; letter-spacing: .04em;
                      padding: 8px 10px; border-bottom: 1px solid #e8e8e8; }
.table td           { padding: 10px 10px; border-bottom: 1px solid #f0f0f0; vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover td { background: #f8f9fa; }

/* ── BADGES ─────────────────────────────────────────────── */
.badge      { display: inline-flex; padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.badge-sauv { background: #dbeeff; color: #0c447c; }
.badge-rj   { background: #fff3db; color: #6b4000; }
.badge-lj   { background: #ffe0e0; color: #6b0000; }
.badge-ljs  { background: #f0e0ff; color: #4b006b; }
.badge-actif{ background: #e0f5e0; color: #1a6b1a; }
.badge-clos { background: #efefef; color: #555; }

/* ── BARRE DE CHARGE ────────────────────────────────────── */
.bar-wrap  { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.bar-bg    { flex: 1; height: 6px; background: #eee; border-radius: 3px; overflow: hidden; }
.bar-fill  { height: 100%; border-radius: 3px; background: var(--nv); }
.bar-num   { font-size: 12px; color: #666; min-width: 22px; text-align: right; font-weight: 600; }

/* ── BOUTONS ────────────────────────────────────────────── */
.btn       { display: inline-flex; align-items: center; gap: 5px; padding: 6px 14px;
             border-radius: 8px; border: 1px solid #ccc; background: #fff;
             font-size: 13px; font-weight: 500; cursor: pointer; color: #333;
             text-decoration: none; }
.btn:hover { background: #f5f5f5; }
.btn-navy  { background: var(--nv); color: #fff !important; border-color: var(--nv); }
.btn-navy:hover { background: var(--nv2); }
.btn-danger{ color: #8b1a1a !important; border-color: #f09595; }
.btn-danger:hover { background: #fff0f0; }
.btn-sm    { padding: 3px 10px; font-size: 12px; }
.btn-full  { width: 100%; justify-content: center; }

/* ── FORMULAIRES ────────────────────────────────────────── */
.form-group       { display: flex; flex-direction: column; gap: 5px; }
.form-group label { font-size: 12px; font-weight: 600; color: #555; }
.form-row         { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 14px; }
.form-row.full    { grid-template-columns: 1fr; }
.form-actions     { display: flex; gap: 10px; margin-top: 20px; padding-top: 16px;
                    border-top: 1px solid #eee; }
input, select, textarea {
  font-size: 13px; padding: 8px 11px;
  border: 1px solid #ccc; border-radius: 8px;
  background: #fff; color: #1a1a1a; width: 100%;
}
input:focus, select:focus { outline: none; border-color: var(--nv); box-shadow: 0 0 0 3px rgba(15,30,61,.1); }

/* ── ALERTES ────────────────────────────────────────────── */
.alert         { padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; font-size: 13px; }
.alert-success { background: #e0f5e0; color: #1a6b1a; border: 1px solid #b0ddb0; }
.alert-danger  { background: #ffe0e0; color: #6b0000; border: 1px solid #f09595; }
.alert-info    { background: #dbeeff; color: #0c447c; border: 1px solid #9ac4f0; }

/* ── PAGE LOGIN ─────────────────────────────────────────── */
.login-body   { background: #e8ecf3; display: flex; align-items: center;
                justify-content: center; min-height: 100vh; }
.login-wrap   { width: 100%; max-width: 380px; padding: 20px; }
.login-card   { background: #fff; border: 1px solid #e0e0e0; border-radius: 16px; padding: 32px; }
.login-header { text-align: center; margin-bottom: 24px; }
.login-logo   { width: 52px; height: 52px; border-radius: 12px; background: var(--nv);
                margin: 0 auto 14px; display: flex; align-items: center;
                justify-content: center; font-size: 26px; color: var(--gd); }
.login-title  { font-size: 16px; font-weight: 700; color: var(--nv); margin-bottom: 4px; }
.login-sub    { font-size: 12px; color: #888; }
.login-footer { text-align: center; font-size: 11px; color: #aaa; margin-top: 20px; }

/* ── UTILITAIRES ────────────────────────────────────────── */
.text-muted  { color: #888; }
.text-center { text-align: center; }
.mt-16 { margin-top: 16px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }

/* ── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 768px) {
  .metrics-grid { grid-template-columns: repeat(2,1fr); }
  .form-row     { grid-template-columns: 1fr; }
  .page-content { padding: 16px 12px; }
}
