:root {
  --gr-blue: #3558e0;
  --gr-blue-dark: #22399c;
  --gr-blue-soft: #eef1fd;
  --gr-ink: #14161c;
  --gr-text: #2c2f36;
  --gr-muted: #868c98;
  --gr-bg: #f5f6f8;
  --gr-card: #ffffff;
  --gr-line: #e5e7eb;
  --gr-win: #12855e;
  --gr-win-soft: #e7f6ef;
  --gr-lose: #d13b3b;
  --gr-lose-soft: #fbeaea;
  --gr-amber: #9a6b08;
  --gr-amber-soft: #fbf2df;
  --gr-amber-border: #f0dfa6;
  --gr-amber-strong: #d9a521;
  --gr-amber-text: #6b5006;
  --gr-warn: #c47f0e;
  --gr-lose-border: #f3c6c6;
  --gr-lose-text: #9a2224;
  --gr-star: #d99a1b;
  --gr-star-empty: #d8dce3;
  --gr-card-hover-border: #ccd2db;
  --gr-sidebar: #161a24;
  --gr-sidebar-hover: rgba(255, 255, 255, 0.06);
  --gr-sidebar-active-bg: rgba(53, 88, 224, 0.22);
  --gr-sidebar-text: #9aa1b1;
  --gr-sidebar-text-active: #ffffff;
  --sidebar-w: 228px;
  --r-xs: 4px;
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-md: 0 6px 16px rgba(16, 24, 40, 0.10);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: "Inter", -apple-system, "Segoe UI", Arial, sans-serif;
  background: var(--gr-bg);
  color: var(--gr-text);
  -webkit-font-smoothing: antialiased;
  font-size: 13.5px;
  line-height: 1.45;
}

a:focus-visible, button:focus-visible, input:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--gr-blue);
  outline-offset: 2px;
}

/* ---------- Coquille applicative (barre du haut + contenu) ---------- */
.topnav {
  background: var(--gr-card);
  border-bottom: 1px solid var(--gr-line);
  height: 52px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 30;
}
.topnav-left { display: flex; align-items: center; gap: 30px; height: 100%; }
.topnav-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}
.topnav-brand img { height: 22px; }
.topnav-brand span {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--gr-ink);
  letter-spacing: -0.01em;
}
.topnav-menu { display: flex; align-items: center; gap: 22px; height: 100%; }
.topnav-link {
  font-size: 13px;
  font-weight: 500;
  color: var(--gr-text);
  text-decoration: none;
  height: 100%;
  display: flex;
  align-items: center;
  border-bottom: 2px solid transparent;
}
.topnav-link:hover { color: var(--gr-blue); }
.topnav-link.active {
  color: var(--gr-ink);
  font-weight: 700;
  border-bottom-color: var(--gr-blue);
}
.topnav-right { display: flex; align-items: center; gap: 10px; }
.topnav-icon-btn {
  width: 34px; height: 34px;
  border-radius: var(--r-pill);
  display: flex; align-items: center; justify-content: center;
  background: var(--gr-bg);
  border: 1px solid var(--gr-line);
  text-decoration: none;
  font-size: 14px;
  color: var(--gr-text);
  cursor: pointer;
  transition: all 0.15s;
}
.topnav-icon-btn:hover { background: var(--gr-blue-soft); border-color: var(--gr-blue); }

.app-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  background: var(--gr-card);
  border-bottom: 1px solid var(--gr-line);
  padding: 15px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 52px;
  z-index: 20;
}
.topbar h1, .page-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--gr-ink);
  letter-spacing: -0.01em;
  margin: 0;
}
.topbar-actions { display: flex; align-items: center; gap: 10px; }

.banner-error {
  background: var(--gr-lose-soft);
  color: var(--gr-lose-text);
  padding: 10px 28px;
  border-bottom: 1px solid #f6c8ca;
  font-size: 13px;
}

.notif-bell-wrap { position: relative; display: inline-flex; align-items: center; vertical-align: middle; }
.notif-bell {
  position: relative;
  background: var(--gr-bg);
  border: 1px solid var(--gr-line);
  border-radius: var(--r-pill);
  width: 36px;
  height: 36px;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.notif-bell:hover { background: var(--gr-blue-soft); border-color: var(--gr-blue); }
.notif-bell.has-unread { border-color: var(--gr-lose); animation: notif-bell-shake 4s ease-in-out infinite; }
@keyframes notif-bell-shake {
  0%, 92%, 100% { transform: rotate(0deg); }
  93% { transform: rotate(-12deg); }
  94% { transform: rotate(10deg); }
  95% { transform: rotate(-8deg); }
  96% { transform: rotate(6deg); }
  97% { transform: rotate(0deg); }
}
.notif-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: var(--gr-lose);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1;
  border-radius: var(--r-pill);
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--gr-card);
  box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.6);
  animation: notif-badge-pulse 2s ease-out infinite;
}
@keyframes notif-badge-pulse {
  0% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.55); }
  70% { box-shadow: 0 0 0 6px rgba(220, 38, 38, 0); }
  100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); }
}
.notif-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 420px;
  max-height: 480px;
  overflow-y: auto;
  background: var(--gr-card);
  border: 1px solid var(--gr-line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  z-index: 30;
  padding: 12px;
}
.notif-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 4px 10px;
  gap: 8px;
}
.notif-panel-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--gr-text);
}
.notif-resolve-all {
  background: none;
  border: 1px solid var(--gr-line);
  border-radius: var(--r-md);
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--gr-muted);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.notif-resolve-all:hover { background: var(--gr-win-soft); border-color: var(--gr-win); color: var(--gr-win); }
.notif-list { display: flex; flex-direction: column; gap: 8px; }
.notif-empty { font-size: 13px; color: var(--gr-muted); padding: 8px 4px; }
.notification-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  background: var(--gr-amber-soft);
  border: 1px solid var(--gr-amber-border);
  border-left: 3px solid var(--gr-amber-strong);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  font-size: 12.5px;
  color: var(--gr-amber-text);
}
.notification-item.severity-error {
  background: var(--gr-lose-soft);
  border-color: var(--gr-lose-border);
  border-left-color: var(--gr-lose);
  color: var(--gr-lose-text);
}
.notification-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.notification-msg {
  line-height: 1.45;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: pre-line;
}
.notification-time {
  font-size: 10px;
  opacity: 0.7;
}
.notification-resolve {
  flex-shrink: 0;
  background: var(--gr-card);
  border: 1px solid var(--gr-line);
  border-radius: var(--r-md);
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 600;
  color: var(--gr-text);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.notification-resolve:hover { background: var(--gr-win-soft); border-color: var(--gr-win); color: var(--gr-win); }

.kpis {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  padding: 22px 28px 4px;
}
.kpi {
  background: var(--gr-card);
  border: 1px solid var(--gr-line);
  border-radius: var(--r-md);
  padding: 15px 18px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
.kpi::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--gr-blue);
}
.kpi-win::before { background: var(--gr-win); }
.kpi-lose::before { background: var(--gr-lose); }
.kpi-label {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gr-muted);
  margin-bottom: 6px;
}
.kpi-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--gr-ink);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.board {
  display: flex;
  gap: 18px;
  padding: 20px 28px 40px;
  overflow-x: auto;
}
.column {
  min-width: 232px;
  max-width: 232px;
  flex-shrink: 0;
  transition: min-width 0.15s ease, max-width 0.15s ease;
}
.column.collapsed {
  min-width: 128px;
  max-width: 128px;
}
.column h2 {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gr-muted);
  margin: 2px 4px 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  cursor: grab;
  border-radius: var(--r-sm);
  padding: 6px 4px;
}
.column h2:active { cursor: grabbing; }
.col-toggle {
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  color: var(--gr-muted);
  user-select: none;
  width: 22px;
  height: 22px;
  min-width: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-sm);
  flex-shrink: 0;
}
.col-toggle:hover { color: var(--gr-blue); background: var(--gr-blue-soft); }
.column.collapsed .cards,
.column.collapsed .col-bar {
  display: none;
}
.column.col-dragover {
  outline: 2px dashed var(--gr-blue);
  outline-offset: 4px;
  border-radius: var(--r-md);
  background: var(--gr-blue-soft);
}
.col-bar {
  display: flex;
  height: 4px;
  border-radius: var(--r-pill);
  overflow: hidden;
  margin: 0 4px 14px;
  background: var(--gr-line);
}
.col-bar span { display: block; }
.col-bar span.ok { background: var(--gr-win); }
.col-bar span.warn { background: var(--gr-warn); }
.col-bar span.risk { background: var(--gr-lose); }
.col-bar-empty { background: var(--gr-line); }
.col-count {
  background: var(--gr-line);
  color: var(--gr-text);
  border-radius: var(--r-pill);
  min-width: 18px;
  text-align: center;
  padding: 1px 6px;
  font-size: 10.5px;
  font-weight: 700;
}
.col-total {
  margin-left: auto;
  font-weight: 700;
  color: var(--gr-ink);
  font-size: 11.5px;
}
.col-copy-emails {
  margin-left: auto;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  opacity: 0.55;
  padding: 0;
}
.col-copy-emails:hover { opacity: 1; }
.cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 70px;
  border-radius: var(--r-md);
  transition: background 0.15s;
}
.cards.dragover {
  background: var(--gr-blue-soft);
  outline: 2px dashed var(--gr-blue);
  outline-offset: 2px;
}

.card {
  border: 1px solid var(--gr-line);
  border-radius: var(--r-md);
  padding: 14px;
  background: var(--gr-card);
  font-size: 12.5px;
  cursor: grab;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.15s, transform 0.15s, border-color 0.15s;
}
.card:hover { box-shadow: var(--shadow-md); border-color: var(--gr-card-hover-border); }
.card.dragging { opacity: 0.4; }

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 6px;
}
.card-head strong {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--gr-ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.card .age {
  color: var(--gr-muted); font-size: 10.5px; white-space: nowrap; font-weight: 500;
  display: flex; align-items: center; gap: 5px; flex-shrink: 0;
}
.urgency-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; background: var(--gr-win); }
.urgency-dot.urgency-yellow { background: var(--gr-warn); }
.urgency-dot.urgency-red { background: var(--gr-lose); }

.card-amount {
  font-size: 15px;
  font-weight: 700;
  color: var(--gr-ink);
  margin-bottom: 6px;
  font-variant-numeric: tabular-nums;
}

.stars { display: flex; gap: 2px; }
.star { color: var(--gr-star-empty); font-size: 13px; cursor: pointer; line-height: 1; user-select: none; }
.star.filled { color: var(--gr-star); }
.star:hover { color: var(--gr-star); }

.card-footer {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--gr-line);
}
.send-status-icon {
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-pill);
  font-size: 12px;
  flex-shrink: 0;
}
.send-status-icon.sent { background: var(--gr-win-soft); color: var(--gr-win); }
.send-status-icon.error { background: var(--gr-lose-soft); color: var(--gr-lose); }
.quick-icon {
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-sm);
  background: var(--gr-bg);
  border: 1px solid var(--gr-line);
  font-size: 11px;
  text-decoration: none;
  cursor: pointer;
}
.quick-icon:hover { background: var(--gr-blue-soft); border-color: var(--gr-blue); }
.quick-icon.disabled { opacity: 0.3; pointer-events: none; }
.avatar {
  margin-left: auto;
  width: 24px; height: 24px;
  border-radius: 50%;
  color: white;
  font-size: 9.5px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.field {
  margin: 4px 0;
  display: flex;
  gap: 7px;
  align-items: baseline;
  color: var(--gr-text);
}
.field .ico { font-size: 10.5px; opacity: 0.55; flex-shrink: 0; }
.field .adresse {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.field .ville { flex-shrink: 0; color: var(--gr-muted); }
.field .telephone, .field .courriel {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.copy-courriel { cursor: pointer; font-size: 11px; opacity: 0.55; margin-left: 2px; flex-shrink: 0; }
.copy-courriel:hover { opacity: 1; }

.tag-row { display: flex; flex-wrap: wrap; gap: 5px; margin: 8px 0; }
.tag {
  border-radius: var(--r-sm);
  padding: 2px 7px;
  font-size: 10px;
  font-weight: 600;
  display: inline-block;
  line-height: 1.6;
  white-space: nowrap;
}
.tag-more { background: var(--gr-bg); color: var(--gr-muted); }

.message {
  font-style: italic;
  color: var(--gr-muted);
  font-size: 11.5px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.message:empty { display: none; }

.checkbox {
  display: flex; align-items: center; gap: 8px; margin: 10px 0 2px;
  cursor: pointer; font-size: 11.5px; font-weight: 600; color: var(--gr-text);
}
.checkbox input { accent-color: var(--gr-blue); width: 15px; height: 15px; }

.stage-nav {
  margin-top: 10px;
  text-align: center;
}
.stage-current {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--gr-blue-dark);
  background: var(--gr-blue-soft);
  border-radius: var(--r-pill);
  padding: 4px 12px;
}

.followup-badges { display: flex; gap: 4px; margin-top: 8px; }
.followup-badge {
  width: 18px; height: 18px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 9.5px;
  font-weight: 700;
  border: 1.5px solid var(--gr-line);
  color: var(--gr-star-empty);
  background: var(--gr-card);
}
.followup-badge.sent {
  border-color: var(--gr-win);
  color: #fff;
  background: var(--gr-win);
}

.actions { display: flex; gap: 8px; margin-top: 10px; }

.btn {
  border: 1px solid transparent;
  border-radius: var(--r-md);
  padding: 7px 12px;
  font-size: 12px;
  cursor: pointer;
  font-weight: 600;
  font-family: inherit;
  transition: filter 0.15s, background 0.15s, border-color 0.15s;
}
.btn:hover { filter: brightness(0.97); }
.btn-ghost {
  background: var(--gr-card);
  color: var(--gr-text);
  border-color: var(--gr-line);
}
.btn-ghost:hover { background: var(--gr-bg); }
.btn-win { background: var(--gr-win-soft); color: var(--gr-win); flex: 1; }
.btn-win:hover { background: var(--gr-win); color: white; filter: none; }
.btn-lose { background: var(--gr-lose-soft); color: var(--gr-lose); flex: 1; }
.btn-lose:hover { background: var(--gr-lose); color: white; filter: none; }
.btn-primary { background: var(--gr-blue); color: white; padding: 8px 16px; }
.btn-primary:hover { background: var(--gr-blue-dark); filter: none; }

.decision-summary { margin-top: 10px; font-weight: 700; font-size: 12px; }
.decision-summary.gagne { color: var(--gr-win); }
.decision-summary.perdu { color: var(--gr-lose); }
.undo-link { font-weight: 500; font-size: 11px; margin-left: 6px; color: var(--gr-muted); text-decoration: none; }
.undo-link:hover { text-decoration: underline; }

.confetti-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  overflow: hidden;
}
.confetti-piece {
  position: absolute;
  top: -20px;
  width: 9px;
  height: 14px;
  opacity: 0.9;
  animation: confetti-fall linear forwards;
}
@keyframes confetti-fall {
  to { transform: translateY(105vh) rotate(600deg); opacity: 0.3; }
}
.celebrate-face {
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  text-align: center;
  animation: celebrate-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
.celebrate-emoji { font-size: 56px; }
.celebrate-text {
  margin-top: 6px;
  font-size: 22px;
  font-weight: 800;
  color: var(--gr-win);
  text-shadow: 0 2px 12px rgba(255,255,255,0.9);
}
@keyframes celebrate-pop {
  0% { transform: translate(-50%, -50%) scale(0); }
  60% { transform: translate(-50%, -50%) scale(1.15); }
  100% { transform: translate(-50%, -50%) scale(1); }
}

.options-form { max-width: 640px; margin: 28px auto; padding: 0 20px; }
.options-section {
  background: var(--gr-card);
  border-radius: var(--r-lg);
  padding: 20px 22px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gr-line);
}
.options-section h2 { margin: 0 0 6px; font-size: 14.5px; font-weight: 700; color: var(--gr-ink); }
.hint { color: var(--gr-muted); font-size: 12px; margin: 0 0 14px; line-height: 1.5; }
.field-inline { display: block; font-size: 12px; font-weight: 600; color: var(--gr-muted); margin-bottom: 14px; }
.field-inline input { display: block; width: 100%; margin-top: 5px; }
.stage-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.stage-row input[type=text], .stage-row input[type=number] {
  flex: 1; padding: 8px 10px; border: 1px solid var(--gr-line); border-radius: var(--r-sm);
  font-family: inherit; font-size: 13px;
}
.stage-row input:focus { outline: none; border-color: var(--gr-blue); }
#add-stage, #add-estimation { background: var(--gr-blue-soft); color: var(--gr-blue-dark); margin-top: 4px; }
.btn-remove-row { background: var(--gr-bg); color: var(--gr-muted); border-color: var(--gr-line); width: 28px; padding: 6px; }
.stage-row-days { flex: 0 0 auto; width: 70px; }
.stage-row-price { flex: 0 0 auto; width: 90px; }

input[type=text], input[type=number] { color: var(--gr-text); }

.add-stage-tile {
  min-width: 160px;
  max-width: 160px;
  flex-shrink: 0;
  padding-top: 2px;
}
.add-stage-btn {
  width: 100%;
  height: 40px;
  border: 1.5px dashed var(--gr-line);
  background: transparent;
  border-radius: var(--r-md);
  color: var(--gr-muted);
  font-weight: 600;
  font-size: 12.5px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.add-stage-btn:hover { border-color: var(--gr-blue); color: var(--gr-blue-dark); background: var(--gr-blue-soft); }
.add-stage-form {
  background: var(--gr-card);
  border: 1px solid var(--gr-line);
  border-radius: var(--r-md);
  padding: 12px;
  box-shadow: var(--shadow-sm);
}
.add-stage-form input[type=text] {
  width: 100%;
  padding: 7px 9px;
  border: 1px solid var(--gr-line);
  border-radius: var(--r-sm);
  font-family: inherit;
  font-size: 13px;
  margin-bottom: 8px;
}
.add-stage-days-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--gr-muted);
  margin-bottom: 10px;
}
.add-stage-days-row input {
  padding: 5px 6px;
  border: 1px solid var(--gr-line);
  border-radius: var(--r-sm);
  font-family: inherit;
}
.add-stage-actions { display: flex; gap: 6px; justify-content: flex-end; }
.add-stage-actions .btn { padding: 6px 10px; font-size: 11px; }

@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Accueil (app launcher) ---------- */
.home-content {
  padding: 48px 32px;
}
.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 24px;
  max-width: 620px;
}
.app-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--gr-text);
}
.app-icon {
  width: 72px; height: 72px;
  border-radius: var(--r-lg);
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-sm);
  transition: transform 0.12s, box-shadow 0.12s;
}
.app-icon svg { width: 36px; height: 36px; }
.app-tile:hover .app-icon { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.app-icon-leads { background: var(--gr-blue); }
.app-icon-donnees { background: #3d4148; }
.app-icon-options { background: #6b7280; }
.app-label { font-size: 12.5px; font-weight: 600; color: var(--gr-text); }

/* ---------- Connexion ---------- */
.home-body {
  background: var(--gr-bg);
  min-height: 100vh;
}
.home-brand { display: flex; align-items: center; gap: 12px; }
.home-app-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--gr-muted);
  border-left: 1px solid var(--gr-line);
  padding-left: 12px;
  letter-spacing: 0.02em;
}
.login-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
}
.login-logo { height: 44px; }
.login-card {
  background: var(--gr-card);
  border-radius: var(--r-lg);
  padding: 28px 30px;
  width: 300px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--gr-line);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.login-card label { font-size: 12px; font-weight: 600; color: var(--gr-muted); display: block; }
.login-card input {
  display: block; width: 100%; margin-top: 5px;
  padding: 9px 10px; border: 1px solid var(--gr-line); border-radius: var(--r-sm);
  font-size: 14px; font-family: inherit; color: var(--gr-text);
}
.login-card input:focus { outline: none; border-color: var(--gr-blue); }
.login-card .btn-primary { width: 100%; padding: 10px; font-size: 14px; }
.login-error { background: var(--gr-lose-soft); color: var(--gr-lose-text); font-size: 12px; padding: 8px 10px; border-radius: var(--r-sm); }
.btn-touchid { width: 100%; padding: 10px; font-size: 13px; margin-top: 8px; background: var(--gr-ink); color: white; }
.btn-touchid:disabled { opacity: 0.6; }

.donnees-wrap { max-width: 1400px; margin: 20px auto; padding: 0 20px 40px; }
.donnees-toolbar {
  display: flex; align-items: center; gap: 14px; margin-bottom: 14px;
}
.donnees-table-wrap {
  background: var(--gr-card);
  border: 1px solid var(--gr-line);
  border-radius: var(--r-lg);
  overflow: auto;
  max-height: 75vh;
  box-shadow: var(--shadow-sm);
}
.donnees-table { border-collapse: collapse; width: 100%; font-size: 12.5px; white-space: nowrap; }
.donnees-table thead th {
  position: sticky; top: 0;
  background: var(--gr-bg);
  text-align: left;
  padding: 9px 12px;
  font-weight: 700;
  color: var(--gr-muted);
  text-transform: uppercase;
  font-size: 10.5px;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--gr-line);
}
.donnees-table tbody td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--gr-line);
  color: var(--gr-text);
}
.donnees-table tbody tr:hover { background: var(--gr-blue-soft); }
.unarchive-btn { background: var(--gr-blue-soft); color: var(--gr-blue-dark); white-space: nowrap; }

/* ---------- Fiche detaillee d'un lead (clic sur une carte) ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 22, 28, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.modal-overlay[hidden] { display: none; }
.modal-panel {
  background: var(--gr-card);
  border-radius: var(--r-lg);
  width: 460px;
  max-width: calc(100vw - 40px);
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  box-shadow: var(--shadow-md);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--gr-line);
  position: sticky;
  top: 0;
  background: var(--gr-card);
}
.modal-header h2 { margin: 0; font-size: 16px; font-weight: 700; color: var(--gr-ink); }
.modal-close {
  width: 30px; height: 30px;
  border-radius: var(--r-pill);
  border: 1px solid var(--gr-line);
  background: var(--gr-bg);
  color: var(--gr-muted);
  cursor: pointer;
  font-size: 13px;
}
.modal-close:hover { background: var(--gr-blue-soft); border-color: var(--gr-blue); color: var(--gr-blue-dark); }
.modal-body { padding: 18px 22px 22px; display: flex; flex-direction: column; gap: 14px; }
.detail-row { display: flex; flex-direction: column; gap: 3px; }
.detail-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gr-muted);
}
.detail-row > span:last-child { font-size: 13px; color: var(--gr-text); white-space: pre-line; overflow-wrap: anywhere; }

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--gr-ink);
  color: #fff;
  padding: 10px 18px;
  border-radius: var(--r-md);
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-md);
  z-index: 200;
}
