/* ============================================================
   Émotions Crew — Charte 2026 v2
   Inspiré du design Transfer : header top, contenu centré
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,400&family=Barlow+Condensed:wght@500;600&display=swap');

:root {
  --bg:          #faf9f7;
  --bg2:         #f2f0ed;
  --bg3:         #e8e5e1;
  --white:       #ffffff;
  --text:        #1a1a1a;
  --muted:       #888;
  --muted2:      #bbb;
  --teal:        #3C9AA8;
  --teal-light:  #e8f4f6;
  --teal-border: rgba(60,154,168,0.25);
  --slate:       #55828B;
  --border:      rgba(0,0,0,0.08);
  --border2:     rgba(0,0,0,0.14);
  --red:         #c0392b;
  --red-light:   #fdf0ee;
  --green:       #27ae60;
  --green-light: #e8f5ec;
  --orange:      #e67e22;
  --radius:      4px;
  --radius-lg:   8px;
  --max-w:       860px;
  --header-h:    52px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--teal); text-decoration: none; }
a:hover { color: var(--slate); }
@keyframes fadeIn { from { opacity:0; transform:translateY(6px); } to { opacity:1; transform:translateY(0); } }

/* ── Header ────────────────────────────────────────────────── */
.app-header {
  height: var(--header-h);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.8rem;
  position: sticky;
  top: 0;
  z-index: 100;
}
.app-header img { height: 22px; opacity: .82; }
.header-nav { display: flex; align-items: center; gap: 1.4rem; }
.header-nav a {
  font-size: .68rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  transition: color .15s;
  padding: .3rem 0;
  border-bottom: 1.5px solid transparent;
}
.header-nav a:hover { color: var(--text); }
.header-nav a.active { color: var(--text); border-bottom-color: var(--text); }
.header-right { display: flex; align-items: center; gap: 1.2rem; }
.header-user { font-size: .68rem; color: var(--muted); }
.btn-logout {
  font-size: .65rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted2);
  cursor: pointer;
  background: none;
  border: none;
  font-family: 'DM Sans', sans-serif;
  transition: color .15s;
}
.btn-logout:hover { color: var(--red); }

/* ── Page layout ───────────────────────────────────────────── */
.page-wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 2.4rem 1.8rem;
  animation: fadeIn .35s ease both;
}
.page-wrap-wide {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2.4rem 1.8rem;
  animation: fadeIn .35s ease both;
}
.page-title {
  font-size: .6rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.8rem;
  padding-bottom: .7rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ── Login ─────────────────────────────────────────────────── */
.login-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.4rem;
  padding: 2rem;
  animation: fadeIn .4s ease both;
}
.login-logo { display: flex; flex-direction: column; align-items: center; gap: .5rem; }
.login-logo img { height: 28px; opacity: .78; }
.login-logo span {
  font-size: .6rem;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--muted);
}
.login-card {
  width: 100%;
  max-width: 320px;
  background: var(--white);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  padding: 1.8rem;
}

/* ── Cards ─────────────────────────────────────────────────── */
.card {
  background: var(--white);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  padding: 1.4rem 1.6rem;
  margin-bottom: 1rem;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: .7rem;
  border-bottom: 1px solid var(--border);
}
.card-title {
  font-size: .6rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

/* ── Stats grid ────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: .8rem;
  margin-bottom: 1.4rem;
}
.stat-card {
  background: var(--white);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  padding: 1rem 1.2rem;
}
.stat-value { font-size: 1.8rem; font-weight: 600; color: var(--text); line-height: 1; }
.stat-label { font-size: .6rem; color: var(--muted); margin-top: 4px; letter-spacing: .1em; text-transform: uppercase; }
.stat-card.teal  .stat-value { color: var(--teal); }
.stat-card.slate .stat-value { color: var(--slate); }
.stat-card.green .stat-value { color: var(--green); }

/* ── Boutons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border-radius: var(--radius);
  font-family: 'DM Sans', sans-serif;
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .08em;
  cursor: pointer;
  border: 1px solid transparent;
  transition: opacity .15s, border-color .15s, color .15s;
  white-space: nowrap;
  text-decoration: none;
  text-transform: uppercase;
}
.btn-primary   { background: var(--text); color: var(--bg); border-color: var(--text); }
.btn-primary:hover { opacity: .8; color: var(--bg); }
.btn-teal      { background: var(--teal); color: #fff; border-color: var(--teal); }
.btn-teal:hover { background: var(--slate); border-color: var(--slate); color: #fff; }
.btn-secondary { background: transparent; color: var(--muted); border-color: var(--border2); }
.btn-secondary:hover { color: var(--text); border-color: #999; }
.btn-danger    { background: transparent; color: var(--red); border-color: var(--red); }
.btn-danger:hover { background: var(--red-light); }
.btn-ghost     { background: transparent; color: var(--muted); border: none; padding: 5px 8px; }
.btn-ghost:hover { color: var(--text); background: var(--bg2); border-radius: var(--radius); }
.btn-sm  { padding: 4px 10px; font-size: .64rem; }
.btn-icon { width: 28px; height: 28px; padding: 0; justify-content: center; border-radius: var(--radius); }
.btn-full { width: 100%; justify-content: center; }

/* ── Formulaires ───────────────────────────────────────────── */
.form-group { margin-bottom: 1rem; }
.form-label {
  display: block;
  font-size: .6rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: .4rem;
}
.form-control {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: .62rem .9rem;
  font-family: 'DM Sans', sans-serif;
  font-size: .88rem;
  color: var(--text);
  transition: border-color .15s;
  outline: none;
}
.form-control:focus { border-color: #999; }
.form-control::placeholder { color: var(--muted2); }
textarea.form-control { resize: vertical; min-height: 72px; }
select.form-control { cursor: pointer; }
.form-row   { display: grid; grid-template-columns: 1fr 1fr;     gap: 1rem; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }
.form-hint  { font-size: .64rem; color: var(--muted2); margin-top: .25rem; }

/* ── Alertes ───────────────────────────────────────────────── */
.alert {
  padding: .6rem 1rem;
  border-radius: var(--radius);
  font-size: .78rem;
  margin-bottom: 1rem;
  border-left: 2px solid;
}
.alert-success { background: var(--green-light); border-color: var(--green); color: #1e8449; }
.alert-error   { background: var(--red-light);   border-color: var(--red);   color: var(--red); }
.alert-info    { background: var(--teal-light);  border-color: var(--teal);  color: var(--slate); }
.alert-warning { background: #fff8e6; border-color: var(--orange); color: #b8860b; }

/* ── Tables ────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .82rem; }
thead tr { border-bottom: 1px solid var(--border2); }
thead th {
  padding: .5rem .8rem;
  text-align: left;
  font-size: .58rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted2);
  font-weight: 500;
}
tbody tr { border-bottom: 1px solid var(--border); transition: background .1s; }
tbody tr:hover { background: var(--bg2); }
tbody td { padding: .65rem .8rem; }
tbody tr:last-child { border-bottom: none; }

/* ── Badges ────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: .15rem .6rem;
  border-radius: 99px;
  font-size: .6rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.badge-admin   { background: var(--teal-light);  color: var(--slate); border: 1px solid var(--teal-border); }
.badge-crew    { background: var(--bg3);          color: var(--muted); border: 1px solid var(--border2); }
.badge-client  { background: var(--bg2);          color: var(--muted2); border: 1px solid var(--border); }

.badge-nouveau    { background: var(--teal-light);   color: var(--slate);  border: 1px solid var(--teal-border); }
.badge-en_cours   { background: #fff8e6;             color: #b8860b;       border: 1px solid #ffe58f; }
.badge-en_attente { background: #f5f0ff;             color: #7a4fa0;       border: 1px solid #d9c9f0; }
.badge-livre      { background: var(--green-light);  color: #1e8449;       border: 1px solid #b8dfc4; }
.badge-archive    { background: var(--bg3);           color: var(--muted);  border: 1px solid var(--border2); }

.badge-facture { background: var(--green-light); color: #1e8449;   border: 1px solid #b8dfc4; }
.badge-devis   { background: var(--teal-light);  color: var(--slate); border: 1px solid var(--teal-border); }
.badge-contrat { background: #fff8e6;            color: #b8860b;   border: 1px solid #ffe58f; }
.badge-autre   { background: var(--bg3);          color: var(--muted); border: 1px solid var(--border2); }

/* ── Tabs ──────────────────────────────────────────────────── */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--border2);
  margin-bottom: 1.6rem;
  gap: 0;
}
.tab-btn {
  padding: .55rem 1.1rem;
  font-family: 'DM Sans', sans-serif;
  font-size: .72rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color .15s;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--text); border-bottom-color: var(--text); font-weight: 600; }
.tab-pane { display: none; }
.tab-pane.active { display: block; animation: fadeIn .25s ease both; }

/* ── Projet card ───────────────────────────────────────────── */
.project-card {
  background: var(--white);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  padding: 1rem 1.2rem;
  margin-bottom: .7rem;
  transition: border-color .15s;
}
.project-card:hover { border-color: #bbb; }

/* ── Lien client ───────────────────────────────────────────── */
.link-box {
  display: flex;
  align-items: center;
  gap: .6rem;
  background: var(--bg);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: .55rem .9rem;
}
.link-box .url {
  flex: 1;
  font-size: .7rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Cloud ─────────────────────────────────────────────────── */
.file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: .7rem;
}
.file-card {
  background: var(--white);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  padding: 1rem;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s;
  position: relative;
}
.file-card:hover { border-color: #bbb; }
.file-icon { font-size: 1.6rem; margin-bottom: .5rem; }
.file-name { font-size: .72rem; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-meta { font-size: .62rem; color: var(--muted2); margin-top: 2px; }
.file-actions { position: absolute; top: 6px; right: 6px; display: none; gap: 3px; }
.file-card:hover .file-actions { display: flex; }

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: .78rem;
  color: var(--muted);
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.breadcrumb a { color: var(--teal); }
.breadcrumb span { color: var(--muted2); }

/* ── Drop zone ─────────────────────────────────────────────── */
.drop-zone {
  border: 1.5px dashed var(--border2);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s;
  position: relative;
}
.drop-zone:hover, .drop-zone.dragover { border-color: #999; background: var(--bg2); }
.drop-zone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }

/* ── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 640px) {
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .page-wrap, .page-wrap-wide { padding: 1.4rem 1rem; }
  .app-header { padding: 0 1rem; }
}

/* ── Utilitaires ───────────────────────────────────────────── */
.mt-1 { margin-top: .6rem; }
.mt-2 { margin-top: 1.2rem; }
.mb-0 { margin-bottom: 0; }
.flex  { display: flex; }
.flex-1 { flex: 1; }
.gap-1 { gap: 6px; }
.gap-2 { gap: 12px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.text-muted  { color: var(--muted); }
.text-muted2 { color: var(--muted2); }
.text-teal   { color: var(--teal); }
.text-red    { color: var(--red); }
.text-green  { color: var(--green); }
.text-sm  { font-size: .78rem; }
.text-xs  { font-size: .68rem; }
.text-xxs { font-size: .6rem; }
.font-medium { font-weight: 500; }
.font-bold   { font-weight: 600; }
.text-right  { text-align: right; }
.w-full { width: 100%; }
