/* ============================================================
   G-Missions — Charte graphique CFAO Consumer
   Orange #E85D0C · Navy #2E2B4A · Gold #F0A124
   ============================================================ */

:root {
  --cfao-orange:       #E85D0C;
  --cfao-orange-light: #F0A124;
  --cfao-orange-soft:  #FDE8D6;
  --cfao-navy:         #2E2B4A;
  --cfao-navy-light:   #5A567B;
  --cfao-navy-soft:    #E8E7EE;
  --cfao-grey:         #F4F4F7;
  --cfao-dark-grey:    #555555;
  --cfao-red:          #C0392B;
  --cfao-green:        #278A5B;
  --cfao-white:        #FFFFFF;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', 'Calibri', system-ui, -apple-system, sans-serif;
  color: #222;
  background: #F8F8FB;
  line-height: 1.5;
}

a { color: var(--cfao-orange); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ------- HEADER ------- */
.topbar {
  background: var(--cfao-navy);
  color: #fff;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 4px solid var(--cfao-orange);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.topbar .brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 18px;
  color: #fff;
}
.topbar .brand img { height: 38px; background: #fff; padding: 4px 8px; border-radius: 4px; }
.topbar .brand span.tag { color: var(--cfao-orange-light); font-weight: 400; font-size: 13px; }
.topbar nav { display: flex; gap: 4px; align-items: center; }
.topbar nav a {
  color: #fff;
  padding: 8px 14px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  transition: background .15s;
}
.topbar nav a:hover { background: rgba(255,255,255,0.1); text-decoration: none; }
.topbar nav a.active { background: var(--cfao-orange); }
.topbar .user-chip {
  display: flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,.08); padding: 6px 12px;
  border-radius: 20px; font-size: 13px;
}
.topbar .user-chip strong { color: var(--cfao-orange-light); }

/* ------- LAYOUT ------- */
.container {
  max-width: 1280px;
  margin: 24px auto;
  padding: 0 24px;
}

/* ------- FLASH ------- */
.flash {
  padding: 14px 20px;
  border-radius: 6px;
  margin-bottom: 18px;
  font-weight: 500;
  border-left: 6px solid;
}
.flash.success { background: #E9F7EF; border-color: var(--cfao-green); color: #1e4d33; }
.flash.error   { background: #FDECEA; border-color: var(--cfao-red); color: #7a1f15; }

/* ------- CARDS ------- */
.card {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(46,43,74,0.06);
  overflow: hidden;
  margin-bottom: 20px;
}
.card .card-header {
  background: var(--cfao-navy);
  color: #fff;
  padding: 14px 20px;
  font-weight: 600;
  display: flex; align-items: center; justify-content: space-between;
  border-left: 5px solid var(--cfao-orange);
}
.card .card-header h2, .card .card-header h3 {
  margin: 0; font-size: 16px;
}
.card .card-body { padding: 20px; }

/* ------- TITLES ------- */
.page-title {
  margin: 0 0 4px 0;
  font-size: 26px;
  color: var(--cfao-navy);
  font-weight: 700;
  border-left: 6px solid var(--cfao-orange);
  padding-left: 14px;
}
.page-subtitle { color: var(--cfao-navy-light); margin: 0 0 24px 0; font-style: italic; }

/* ------- BUTTONS ------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px;
  background: var(--cfao-orange);
  color: #fff; border: none;
  border-radius: 6px; cursor: pointer;
  font-weight: 600; font-size: 14px;
  transition: all .15s; text-decoration: none;
}
.btn:hover { background: #C94B00; text-decoration: none; color: #fff; }
.btn.secondary { background: var(--cfao-navy); }
.btn.secondary:hover { background: #1C1A35; }
.btn.ghost { background: transparent; color: var(--cfao-navy); border: 2px solid var(--cfao-navy); }
.btn.ghost:hover { background: var(--cfao-navy); color: #fff; }
.btn.sm { padding: 6px 12px; font-size: 12px; }
.btn.danger { background: var(--cfao-red); }
.btn.success { background: var(--cfao-green); }

.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }

/* ------- FORMS ------- */
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; color: var(--cfao-navy); margin-bottom: 6px; font-size: 14px; }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--cfao-orange);
  box-shadow: 0 0 0 3px rgba(232, 93, 12, 0.15);
}
.field .hint { color: var(--cfao-navy-light); font-size: 12px; margin-top: 4px; font-style: italic; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.grid-4 { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 16px; }
@media (max-width: 760px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* ------- TABLES ------- */
table.data {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
  background: #fff;
  border-radius: 8px; overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
table.data thead th {
  background: var(--cfao-navy);
  color: #fff; padding: 12px 14px;
  text-align: left; font-weight: 600;
}
table.data tbody td { padding: 12px 14px; border-bottom: 1px solid #eee; }
table.data tbody tr:hover { background: var(--cfao-orange-soft); }
table.data tbody tr:last-child td { border-bottom: none; }

/* ------- BADGES / STATUS ------- */
.badge {
  display: inline-block; padding: 4px 12px; border-radius: 12px;
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .3px;
}
.badge.brouillon     { background: #ddd; color: #555; }
.badge.soumise       { background: var(--cfao-orange-soft); color: var(--cfao-orange); }
.badge.validee_manager { background: #CEE6FF; color: #1a4e8a; }
.badge.validee_rh    { background: var(--cfao-navy-soft); color: var(--cfao-navy); }
.badge.validee_daf   { background: #D8F0E1; color: var(--cfao-green); }
.badge.payee         { background: var(--cfao-green); color: #fff; }
.badge.refusee       { background: var(--cfao-red); color: #fff; }

/* ------- KPI CARDS ------- */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 24px; }
.kpi-card {
  background: #fff; padding: 20px; border-radius: 10px;
  border-left: 5px solid var(--cfao-orange);
  box-shadow: 0 2px 8px rgba(46,43,74,0.06);
}
.kpi-card .label { font-size: 12px; color: var(--cfao-navy-light); text-transform: uppercase; letter-spacing: .5px; }
.kpi-card .value { font-size: 28px; font-weight: 700; color: var(--cfao-navy); margin-top: 4px; }
.kpi-card.accent { border-left-color: var(--cfao-navy); }
.kpi-card.accent .value { color: var(--cfao-orange); }

/* ------- LOGIN ------- */
.login-wrap {
  min-height: 100vh;
  background: var(--cfao-navy);
  display: flex; align-items: center; justify-content: center;
  position: relative;
  overflow: hidden;
}
.login-wrap::before {
  content: ''; position: absolute; bottom: 0; right: 0;
  width: 60%; height: 32%;
  background:
    linear-gradient(to top, var(--cfao-orange-light) 30%, transparent 30%),
    linear-gradient(to top, var(--cfao-orange) 45%, transparent 45%);
  clip-path: polygon(
    0% 100%, 10% 100%, 10% 40%, 14% 40%, 14% 100%,
    20% 100%, 20% 20%, 24% 20%, 24% 100%,
    30% 100%, 30% 50%, 34% 50%, 34% 100%,
    40% 100%, 40% 10%, 44% 10%, 44% 100%,
    50% 100%, 50% 35%, 54% 35%, 54% 100%,
    60% 100%, 60% 25%, 64% 25%, 64% 100%,
    70% 100%, 70% 45%, 74% 45%, 74% 100%,
    80% 100%, 80% 15%, 84% 15%, 84% 100%,
    90% 100%, 90% 30%, 94% 30%, 94% 100%, 100% 100%
  );
  opacity: .9;
}
.login-card {
  position: relative; z-index: 2;
  background: rgba(255,255,255,0.05);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 16px;
  padding: 48px 40px;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 16px 48px rgba(0,0,0,.35);
}
.login-card img.logo { background: #fff; padding: 6px 12px; border-radius: 8px; height: 50px; margin-bottom: 24px; }
.login-card h1 { color: #fff; font-size: 28px; font-weight: 700; margin: 0 0 8px 0; letter-spacing: 1px; }
.login-card h1 span.highlight { color: var(--cfao-orange-light); }
.login-card p.sub { color: #d5d4df; margin: 0 0 28px 0; font-size: 14px; }
.login-card .field label { color: #fff; }
.login-card .field input {
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.2);
  color: #fff;
  font-size: 16px;
}
.login-card .field input::placeholder { color: rgba(255,255,255,.5); }
.login-card .btn { width: 100%; justify-content: center; padding: 14px; font-size: 15px; }
.login-card .footer-hint { margin-top: 20px; font-size: 12px; color: rgba(255,255,255,.6); text-align: center; }
.login-card .quick-login {
  background: rgba(255,255,255,.08);
  color: #fff;
  border: 1px solid rgba(255,255,255,.2);
  padding: 5px 10px;
  border-radius: 14px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .3px;
  cursor: pointer;
  font-family: inherit;
  transition: all .15s;
}
.login-card .quick-login:hover {
  background: var(--cfao-orange);
  border-color: var(--cfao-orange);
  color: #fff;
}
.login-wrap .corner-brand {
  position: absolute; top: 32px; left: 32px; z-index: 2;
  color: var(--cfao-orange-light); letter-spacing: 8px; font-weight: 700; font-size: 24px;
}
.login-wrap .tagline {
  position: absolute; bottom: 24px; left: 32px; z-index: 2;
  color: #fff; font-weight: 500; font-size: 13px;
}
.login-wrap .tagline strong { color: var(--cfao-orange-light); }

/* ------- FOOTER ------- */
footer.app-footer {
  background: var(--cfao-navy);
  color: #bcbacc;
  padding: 14px 24px;
  text-align: center;
  font-size: 12px;
  border-top: 3px solid var(--cfao-orange);
}

/* ------- MISC ------- */
.empty-state {
  text-align: center; padding: 40px 20px; color: var(--cfao-navy-light);
}
.empty-state .icon { font-size: 40px; display: block; margin-bottom: 10px; color: var(--cfao-orange); }

.info-box {
  background: var(--cfao-orange-soft);
  border-left: 5px solid var(--cfao-orange);
  padding: 14px 18px; border-radius: 6px;
  margin: 16px 0; font-size: 14px;
}
.info-box strong { color: var(--cfao-navy); }

.conditional-block {
  background: var(--cfao-grey);
  padding: 14px 18px; border-radius: 6px;
  border: 1px dashed var(--cfao-navy-light);
  margin-top: 10px;
}

/* ------- PRINT ------- */
@media print {
  .topbar, footer.app-footer, .no-print, nav, .btn, .btn-row { display: none !important; }
  body { background: #fff; }
  .container { margin: 0; padding: 0; max-width: 100%; }
}
