:root {
  --bg: #F6F2EB;
  --surface: #FFFFFF;
  --surface-soft: #FAF7F2;
  --surface-muted: #EFE9DF;
  --border: #E5DDD0;
  --text: #271E18;
  --text-muted: #70655C;
  --primary: #BA4712;
  --primary-hover: #9C390C;
  --primary-soft: #FDF0E8;
  --teal: #15534C;
  --teal-soft: #E6F2F0;
  --amber: #C97A16;
  --amber-soft: #FEF5E6;
  --danger: #B42318;
  --danger-soft: #FEECEB;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 2px 10px rgba(39, 30, 24, 0.05);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
}

a { color: inherit; text-decoration: none; }

/* Barre de navigation démo multi-acteurs */
.demo-bar {
  background: #211915;
  color: #F6F2EB;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 100;
}
.demo-bar .brand {
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.demo-bar .brand span.tag {
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
}
.demo-links {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.demo-links a {
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #E7DFD5;
  background: rgba(255,255,255,0.08);
  transition: background .15s;
}
.demo-links a:hover { background: rgba(255,255,255,0.16); }
.demo-links a.active { background: var(--primary); color: #fff; }

/* Conteneurs Web 1440px */
.web-shell {
  max-width: 1360px;
  margin: 0 auto;
  padding: 20px 24px 48px;
}

.topbar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}
.logo {
  font-weight: 800;
  font-size: 20px;
  color: var(--primary);
  letter-spacing: -0.02em;
}

/* Cadre Mobile 390x844 */
.mobile-stage {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 28px;
  padding: 24px 16px 48px;
  flex-wrap: wrap;
}
.phone-frame {
  width: 390px;
  min-height: 844px;
  max-height: 844px;
  background: var(--bg);
  border: 10px solid #231C18;
  border-radius: 38px;
  box-shadow: 0 24px 50px rgba(35, 28, 24, 0.18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}
.phone-status {
  padding: 10px 20px 6px;
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 700;
  background: var(--surface);
}
.phone-header {
  padding: 10px 16px 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.phone-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.phone-nav {
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  padding: 10px 8px;
}
.phone-nav button {
  background: none;
  border: none;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}
.phone-nav button.active { color: var(--primary); }

/* Cartes & Composants */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}
.card-soft {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
}
.card-teal {
  background: var(--teal-soft);
  border: 1px solid #C5E0DC;
  border-radius: var(--radius);
  padding: 14px;
  color: #0F3D38;
}
.card-amber {
  background: var(--amber-soft);
  border: 1px solid #F5D5A7;
  border-radius: var(--radius);
  padding: 14px;
  color: #7C4706;
}
.card-danger {
  background: var(--danger-soft);
  border: 1px solid #F6C5C1;
  border-radius: var(--radius);
  padding: 14px;
  color: var(--danger);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.badge-teal { background: var(--teal-soft); color: var(--teal); }
.badge-amber { background: var(--amber-soft); color: var(--amber); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-muted { background: var(--surface-muted); color: var(--text-muted); }
.badge-primary { background: var(--primary-soft); color: var(--primary); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: all .15s;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-teal { background: var(--teal); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-outline { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn-outline:hover { background: var(--surface-soft); }
.btn-sm { padding: 6px 11px; font-size: 12px; border-radius: 8px; }
.btn-block { width: 100%; }

.input, select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
}
.input:focus, select:focus, textarea:focus {
  outline: 2px solid rgba(186, 71, 18, 0.25);
  border-color: var(--primary);
}

/* Grilles & Mises en page */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-6 { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.split-main-side { display: grid; grid-template-columns: 1fr 360px; gap: 20px; align-items: start; }
.backoffice-layout { display: grid; grid-template-columns: 220px 1fr; gap: 20px; align-items: start; }

@media (max-width: 960px) {
  .grid-2, .grid-3, .grid-6, .split-main-side, .backoffice-layout {
    grid-template-columns: 1fr;
  }
}

.sidebar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sidebar button {
  text-align: left;
  padding: 10px 12px;
  border-radius: 9px;
  border: none;
  background: transparent;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}
.sidebar button.active {
  background: var(--primary-soft);
  color: var(--primary);
}

/* Tableaux */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  text-align: left;
  padding: 10px 12px;
  background: var(--surface-soft);
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
}
td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

/* Code 4 chiffres */
.code-boxes {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 10px 0;
}
.code-box {
  width: 52px;
  height: 60px;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 800;
  color: var(--text);
}

/* Carte stylisée Abidjan (CSS) */
.css-map {
  background: #EAE4D8;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  height: 220px;
  position: relative;
  overflow: hidden;
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.65) 6px, transparent 6px),
    linear-gradient(to bottom, rgba(255,255,255,0.65) 6px, transparent 6px);
  background-size: 64px 52px;
}
.map-pill {
  position: absolute;
  background: var(--teal);
  color: #fff;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(0,0,0,0.18);
}
.map-pin {
  position: absolute;
  width: 14px;
  height: 14px;
  background: var(--primary);
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.row-between { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.muted { color: var(--text-muted); font-size: 12px; }
.price { font-weight: 800; color: var(--primary); }
.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #211915;
  color: #fff;
  padding: 12px 18px;
  border-radius: 10px;
  font-weight: 600;
  z-index: 999;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}
