/* ===========================================================================
   ATEM+ — Design system & UI for the demo
   Brand colors extracted from the official ATEM+ logo (favicon.svg):
     green  #45AC34   ·   gray/anthracite  #575756
   This stylesheet covers the layout (sidebar + topbar), components and all
   the animations (page transitions, sidebar, login, counters, hover FX).
   =========================================================================== */

:root {
  --green: #45AC34;
  --green-dark: #2f8a23;
  --green-light: #eaf7e7;
  --green-glow: rgba(69, 172, 52, 0.35);
  --gray: #575756;
  --ink: #2b2b2a;
  --muted: #8a8a89;
  --line: #e8eae8;
  --bg: #f4f6f4;
  --card: #ffffff;
  --amber: #f0a020;
  --amber-light: #fdf3e0;
  --danger: #e2483d;
  --danger-light: #fdecea;
  --blue: #3b82c4;
  --blue-light: #e8f1f9;
  --purple: #8b5cf6;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 6px 24px rgba(43, 43, 42, 0.07);
  --shadow-lg: 0 18px 50px rgba(43, 43, 42, 0.14);
  --sidebar-w: 264px;
  --topbar-h: 68px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

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

::selection { background: var(--green-glow); }

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #d4d8d4; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #bcc1bc; }

/* ===========================================================================
   APP SHELL  (sidebar + topbar + content)
   =========================================================================== */

.app { display: flex; min-height: 100vh; }

/* ---- Sidebar ---- */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  background: linear-gradient(180deg, #ffffff 0%, #fbfcfb 100%);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  z-index: 40;
  transition: transform 0.4s var(--ease);
}

.sidebar__brand {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
}
.sidebar__brand img { width: 30px; height: auto; }
.sidebar__brand .name {
  font-weight: 700;
  font-size: 1.32rem;
  letter-spacing: -0.5px;
  color: var(--gray);
}
.sidebar__brand .name b { color: var(--green); }

.sidebar__nav { padding: 18px 14px; flex: 1; }
.nav-section {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--muted);
  margin: 8px 12px 10px;
}

.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  color: var(--gray);
  font-size: 0.93rem;
  font-weight: 500;
  margin-bottom: 4px;
  overflow: hidden;
  transition: color 0.25s var(--ease), background 0.25s var(--ease), transform 0.25s var(--ease);
}
.nav-link i { font-size: 1.15rem; transition: transform 0.3s var(--ease); }
.nav-link::before {
  content: "";
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%) scaleY(0);
  width: 4px; height: 60%;
  border-radius: 0 4px 4px 0;
  background: var(--green);
  transition: transform 0.3s var(--ease);
}
.nav-link:hover { background: var(--green-light); transform: translateX(3px); }
.nav-link:hover i { transform: scale(1.15); }
.nav-link.active { background: var(--green-light); color: var(--green-dark); font-weight: 600; }
.nav-link.active::before { transform: translateY(-50%) scaleY(1); }
.nav-link.active i { color: var(--green); }

.sidebar__foot {
  padding: 14px 16px;
  border-top: 1px solid var(--line);
  font-size: 0.78rem;
  color: var(--muted);
}
.sync-row { display: flex; align-items: center; gap: 10px; }
.sync-dot {
  width: 9px; height: 9px; flex: 0 0 auto; border-radius: 50%;
  background: var(--green); box-shadow: 0 0 0 3px var(--green-light);
  animation: pulse 2s infinite;
}
.sync-txt b { display: block; color: var(--ink); font-size: 0.78rem; font-weight: 600; }
.sync-txt span { font-size: 0.7rem; color: var(--muted); }
.app-version {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 12px; padding-top: 11px; border-top: 1px solid var(--line);
  font-size: 0.7rem; color: var(--muted);
}
.app-version i { color: var(--green); font-size: 0.66rem; margin-right: 5px; }
.app-version .v { font-weight: 600; }

/* ---- Main column ---- */
.main {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  height: var(--topbar-h);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 26px;
  z-index: 30;
}
.topbar h1 { font-size: 1.18rem; font-weight: 600; margin: 0; }
.topbar .spacer { flex: 1; }

.burger {
  display: none;
  background: none; border: none; cursor: pointer;
  font-size: 1.5rem; color: var(--gray); padding: 4px;
}

.search {
  display: flex; align-items: center; gap: 9px;
  background: var(--bg); border: 1px solid var(--line);
  padding: 9px 15px; border-radius: 30px; color: var(--muted);
  font-size: 0.88rem; min-width: 230px;
  transition: box-shadow 0.25s var(--ease), border-color 0.25s var(--ease);
}
.search:focus-within { border-color: var(--green); box-shadow: 0 0 0 4px var(--green-glow); }
.search input { border: none; background: none; outline: none; flex: 1; color: var(--ink); font-family: inherit; }

.icon-btn {
  position: relative;
  width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--card);
  display: grid; place-items: center; cursor: pointer; color: var(--gray);
  font-size: 1.15rem; transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.icon-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow); color: var(--green); }
.icon-btn .dot {
  position: absolute; top: 8px; right: 9px;
  width: 8px; height: 8px; border-radius: 50%; background: var(--danger);
  box-shadow: 0 0 0 3px var(--card);
  animation: pulse 1.8s infinite;
}

.user-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 5px 6px 5px 12px; border-radius: 30px;
  border: 1px solid var(--line); background: var(--card); cursor: pointer;
  transition: box-shadow 0.2s var(--ease);
}
.user-chip:hover { box-shadow: var(--shadow); }
.user-chip .meta { text-align: right; line-height: 1.15; }
.user-chip .meta .nm { font-size: 0.85rem; font-weight: 600; }
.user-chip .meta .rl { font-size: 0.72rem; color: var(--muted); }
.user-chip .chev { color: var(--muted); font-size: 0.8rem; transition: transform 0.25s var(--ease); }
.user-menu.open .user-chip .chev { transform: rotate(180deg); }

/* User dropdown menu */
.user-menu { position: relative; }
.user-dropdown {
  position: absolute; top: calc(100% + 10px); right: 0;
  width: 230px; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); padding: 8px;
  opacity: 0; visibility: hidden; transform: translateY(-8px) scale(0.98);
  transform-origin: top right; transition: opacity 0.2s var(--ease), transform 0.2s var(--ease), visibility 0.2s;
  z-index: 50;
}
.user-menu.open .user-dropdown { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }
.user-dropdown__head { display: flex; align-items: center; gap: 11px; padding: 8px 10px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.user-dropdown__head .nm { font-size: 0.88rem; font-weight: 600; }
.user-dropdown__head .rl { font-size: 0.74rem; color: var(--muted); }
.user-dropdown a {
  display: flex; align-items: center; gap: 11px; padding: 11px 12px;
  border-radius: 9px; font-size: 0.88rem; font-weight: 500; color: var(--gray);
  transition: background 0.18s var(--ease), color 0.18s var(--ease);
}
.user-dropdown a i { font-size: 1.05rem; }
.user-dropdown a:hover { background: var(--green-light); color: var(--green-dark); }
.user-dropdown a.danger:hover { background: var(--danger-light); color: var(--danger); }
.user-dropdown__sep { height: 1px; background: var(--line); margin: 6px 4px; }

/* Profile page */
.profile-hero {
  display: flex; align-items: center; gap: 22px; flex-wrap: wrap;
  background: linear-gradient(135deg, var(--green-dark), var(--green)); color: #fff;
  border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow);
}
.profile-hero .big-avatar {
  width: 84px; height: 84px; border-radius: 50%; background: rgba(255,255,255,0.18);
  display: grid; place-items: center; font-size: 2rem; font-weight: 700;
  border: 3px solid rgba(255,255,255,0.4);
}
.profile-hero h2 { margin: 0; font-size: 1.7rem; }
.profile-hero .role-tag { display: inline-block; margin-top: 6px; background: rgba(255,255,255,0.2); padding: 4px 12px; border-radius: 20px; font-size: 0.82rem; }
.info-row { display: flex; align-items: center; gap: 13px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.info-row:last-child { border-bottom: none; }
.info-row .ic { width: 40px; height: 40px; border-radius: 10px; background: var(--green-light); color: var(--green); display: grid; place-items: center; font-size: 1.15rem; flex: 0 0 auto; }
.info-row .lab { font-size: 0.76rem; color: var(--muted); }
.info-row .val { font-size: 0.92rem; font-weight: 500; }
.avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, var(--green), var(--green-dark));
  color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 0.9rem;
}

.content { padding: 28px 26px 60px; }

/* ===========================================================================
   GENERIC COMPONENTS
   =========================================================================== */

.page-head { margin-bottom: 22px; }
.page-head .lead { color: var(--muted); margin: 4px 0 0; font-size: 0.92rem; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-pad { padding: 22px; }

/* ---- Dossiers list (module 2) ---- */
.dossier-group { margin-top: 22px; }
.group-head {
  display: flex; align-items: center; gap: 9px;
  font-size: 0.82rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.6px;
  color: var(--muted); margin: 0 2px 12px;
}
.group-head i { font-size: 1rem; }
.group-head .group-count {
  margin-left: 2px; background: #eef0ee; color: var(--gray);
  font-size: 0.72rem; padding: 1px 8px; border-radius: 20px; letter-spacing: 0;
}
.group-blocked i { color: var(--danger); }
.group-active i { color: var(--blue); }
.group-closed i { color: var(--green); }

/* Compact clickable dossier card */
.dossier-card {
  display: flex; flex-direction: column; padding: 16px;
  text-decoration: none; color: inherit;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), border-color 0.2s var(--ease);
}
.dossier-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.08);
  border-color: var(--green);
}
.dc-top { display: flex; align-items: center; gap: 12px; }
.dc-avatar { width: 42px; height: 42px; font-size: 0.92rem; flex-shrink: 0; }
.dc-id { flex: 1; min-width: 0; }
.dc-id .ref-pill { font-size: 0.78rem; }
.dc-id h3 {
  margin: 1px 0 0; font-size: 0.98rem; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dc-chev { color: var(--muted); font-size: 1rem; transition: transform 0.2s var(--ease), color 0.2s var(--ease); }
.dossier-card:hover .dc-chev { color: var(--green); transform: translateX(3px); }
.dc-status { align-self: flex-start; margin: 12px 0 0; }
.dc-meta {
  margin: 8px 0 0; color: var(--muted); font-size: 0.82rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dc-progress { display: flex; align-items: center; gap: 10px; margin: 14px 0 0; }
.dc-progress .bar { flex: 1; }
.dc-progress > span { font-size: 0.76rem; color: var(--muted); white-space: nowrap; }
.dc-foot {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line);
}
.dc-foot .lead { font-size: 0.8rem; margin: 0; }
.dc-amount { font-weight: 700; color: var(--green-dark); }
.card-title { font-size: 1rem; font-weight: 600; margin: 0 0 4px; display: flex; align-items: center; gap: 9px; }
.card-title i { color: var(--green); }
.card-sub { color: var(--muted); font-size: 0.82rem; margin: 0 0 16px; }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 0.72rem; font-weight: 600; padding: 4px 10px; border-radius: 20px;
}
.badge.green { background: var(--green-light); color: var(--green-dark); }
.badge.amber { background: var(--amber-light); color: #b9760a; }
.badge.danger { background: var(--danger-light); color: var(--danger); }
.badge.blue { background: var(--blue-light); color: var(--blue); }
.badge.gray { background: #eef0ee; color: var(--gray); }
.badge.purple { background: #f1ebfe; color: var(--purple); }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  border: none; cursor: pointer; font-family: inherit; font-weight: 600;
  padding: 11px 20px; border-radius: 30px; font-size: 0.9rem;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease);
}
.btn-primary { background: var(--green); color: #fff; box-shadow: 0 8px 20px var(--green-glow); }
.btn-primary:hover { background: var(--green-dark); transform: translateY(-2px); box-shadow: 0 12px 26px var(--green-glow); }
.btn-ghost { background: var(--card); color: var(--gray); border: 1px solid var(--line); }
.btn-ghost:hover { border-color: var(--green); color: var(--green); transform: translateY(-2px); }

/* ===========================================================================
   PAGE / STAGGER ANIMATIONS
   =========================================================================== */

/* Each route transitions in */
.page-enter { animation: pageIn 0.5s var(--ease) both; }
@keyframes pageIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Reveal-on-load, staggered via inline --d */
.reveal { opacity: 0; animation: revealUp 0.6s var(--ease) forwards; animation-delay: var(--d, 0s); }
@keyframes revealUp {
  from { opacity: 0; transform: translateY(22px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes pulse {
  0%   { box-shadow: 0 0 0 3px var(--card), 0 0 0 0 rgba(226,72,61,0.5); }
  70%  { box-shadow: 0 0 0 3px var(--card), 0 0 0 9px rgba(226,72,61,0); }
  100% { box-shadow: 0 0 0 3px var(--card), 0 0 0 0 rgba(226,72,61,0); }
}

@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }

/* ===========================================================================
   DASHBOARD
   =========================================================================== */

.grid { display: grid; gap: 20px; }
.kpi-grid { grid-template-columns: repeat(4, 1fr); }
.cols-2 { grid-template-columns: 1.5fr 1fr; }
.cols-3 { grid-template-columns: repeat(3, 1fr); }

.kpi {
  position: relative; overflow: hidden;
  padding: 20px; border-radius: var(--radius);
  background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.kpi:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
.kpi__icon {
  width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center;
  font-size: 1.4rem; margin-bottom: 14px;
}
.kpi__icon.green { background: var(--green-light); color: var(--green); }
.kpi__icon.gray { background: #eef0ee; color: var(--gray); }
.kpi__icon.danger { background: var(--danger-light); color: var(--danger); }
.kpi__icon.amber { background: var(--amber-light); color: #b9760a; }
.kpi.is-danger { border-left: 4px solid var(--danger); }
.kpi.is-danger .kpi__val { color: var(--danger); }
.kpi.is-amber { border-left: 4px solid var(--amber); }
.kpi.is-amber .kpi__val { color: #b9760a; }
.kpi__val { font-size: 1.9rem; font-weight: 700; letter-spacing: -1px; line-height: 1; }
.kpi__label { color: var(--muted); font-size: 0.85rem; margin-top: 6px; }

/* Top alert banner (soft red, subtle) */
.alert-banner {
  display: flex; align-items: center; gap: 15px; flex-wrap: wrap;
  background: var(--danger-light); color: var(--ink);
  border: 1px solid #f3cdc9; border-left: 4px solid var(--danger);
  border-radius: var(--radius); padding: 14px 20px; margin-bottom: 22px;
}
.alert-banner .ab-icon {
  width: 40px; height: 40px; flex: 0 0 auto; border-radius: 11px;
  display: grid; place-items: center; font-size: 1.25rem;
  background: #fff; color: var(--danger);
}
.alert-banner .ab-txt { flex: 1; min-width: 200px; }
.alert-banner .ab-txt b { font-size: 0.98rem; }
.alert-banner .ab-txt span { display: block; color: var(--muted); font-size: 0.84rem; }
.alert-banner .ab-btn {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--danger); color: #fff; border: none; cursor: pointer;
  font-family: inherit; font-weight: 600; font-size: 0.84rem;
  padding: 10px 16px; border-radius: 30px; transition: transform 0.2s var(--ease), background 0.2s var(--ease);
}
.alert-banner .ab-btn:hover { transform: translateY(-2px); background: #c93b30; }
.kpi__delta { position: absolute; top: 20px; right: 20px; font-size: 0.78rem; font-weight: 600; }
.kpi__delta.up { color: var(--green); }
.kpi__delta.flat { color: var(--muted); }
.kpi::after {
  content: ""; position: absolute; right: -30px; bottom: -30px;
  width: 110px; height: 110px; border-radius: 50%;
  background: radial-gradient(circle, var(--green-glow), transparent 70%);
  opacity: 0.5;
}

/* Alerts (semaphore) list */
.alert-row {
  display: flex; align-items: center; gap: 14px; padding: 13px 14px;
  border-radius: var(--radius-sm); margin-bottom: 8px;
  border: 1px solid var(--line); background: var(--card);
  transition: transform 0.2s var(--ease);
}
.alert-row:hover { transform: translateX(4px); }
.alert-row .light { width: 11px; height: 11px; border-radius: 50%; flex: 0 0 auto; }
.alert-row.danger .light { background: var(--danger); box-shadow: 0 0 0 4px var(--danger-light); }
.alert-row.warning .light { background: var(--amber); box-shadow: 0 0 0 4px var(--amber-light); }
.alert-row.info .light { background: var(--blue); box-shadow: 0 0 0 4px var(--blue-light); }
.alert-row .txt { flex: 1; }
.alert-row .txt .t { font-weight: 600; font-size: 0.9rem; }
.alert-row .txt .d { color: var(--muted); font-size: 0.8rem; }

/* table */
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line);
}
.table td { padding: 13px 12px; border-bottom: 1px solid var(--line); font-size: 0.88rem; }
.table tr { transition: background 0.2s var(--ease); }
.table tbody tr:hover { background: var(--bg); }
.ref-pill { font-weight: 600; color: var(--green-dark); }

/* ===========================================================================
   CRM KANBAN
   =========================================================================== */

.kanban { display: flex; gap: 16px; overflow-x: auto; padding-bottom: 14px; }
.kcol { flex: 0 0 280px; background: #eef1ee; border-radius: var(--radius); padding: 12px; }

/* Phase-based kanban: columns stretch to fill the width → no wide scroll */
.phase-board { display: flex; gap: 16px; padding-bottom: 6px; }
.phase-board .kcol { flex: 1 1 0; min-width: 200px; max-width: 340px; }
.kcol__empty { text-align: center; color: var(--muted); font-size: 0.8rem; padding: 22px 0; border: 1px dashed var(--line); border-radius: 10px; }

/* Phase tabs */
.phase-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.phase-tab {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 11px 18px; border-radius: 12px; cursor: pointer;
  background: var(--card); border: 1px solid var(--line);
  font-family: inherit; font-size: 0.9rem; font-weight: 600; color: var(--gray);
  transition: transform 0.2s var(--ease), border-color 0.2s var(--ease), background 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.phase-tab i { font-size: 1.05rem; }
.phase-tab:hover { transform: translateY(-2px); border-color: var(--green); color: var(--green-dark); }
.phase-tab .pcount { background: var(--bg); color: var(--muted); border-radius: 20px; padding: 1px 9px; font-size: 0.76rem; }
.phase-tab.active { background: var(--green); color: #fff; border-color: var(--green); box-shadow: 0 8px 18px var(--green-glow); }
.phase-tab.active .pcount { background: rgba(255,255,255,0.25); color: #fff; }

@media (max-width: 760px) {
  .phase-board { flex-direction: column; }
  .phase-board .kcol { max-width: none; }
}
.kcol__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 8px 12px; font-weight: 600; font-size: 0.9rem;
}
.kcol__head .count { background: #fff; color: var(--muted); border-radius: 20px; padding: 2px 9px; font-size: 0.76rem; }
.kcol__head .pip { width: 9px; height: 9px; border-radius: 50%; display: inline-block; margin-right: 8px; }
.pip.green { background: var(--green); } .pip.blue { background: var(--blue); }
.pip.amber { background: var(--amber); } .pip.gray { background: var(--gray); }

.deal {
  background: #fff; border-radius: 12px; padding: 14px; margin-bottom: 10px;
  border: 1px solid var(--line); box-shadow: 0 2px 6px rgba(0,0,0,0.03);
  cursor: grab; transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.deal:hover { transform: translateY(-3px) rotate(-0.4deg); box-shadow: var(--shadow); }
.deal .client { font-weight: 600; font-size: 0.92rem; }
.deal .meta { color: var(--muted); font-size: 0.78rem; margin: 3px 0 10px; }
.deal .row { display: flex; align-items: center; justify-content: space-between; }
.deal .amount { font-weight: 700; color: var(--green-dark); font-size: 0.95rem; }
.deal .mini-avatar {
  width: 26px; height: 26px; border-radius: 50%; background: var(--gray); color: #fff;
  display: grid; place-items: center; font-size: 0.68rem; font-weight: 600;
}

/* ===========================================================================
   CRM — funnel bar + responsive deal grid (replaces wide kanban scroll)
   =========================================================================== */

.funnel-bar { display: flex; flex-wrap: wrap; gap: 8px; }
.fstage {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 9px 14px; border-radius: 12px; cursor: pointer;
  background: var(--card); border: 1px solid var(--line);
  font-size: 0.85rem; font-weight: 500; color: var(--gray);
  transition: transform 0.2s var(--ease), border-color 0.2s var(--ease), background 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.fstage:hover { transform: translateY(-2px); border-color: var(--green); }
.fstage .dot { width: 9px; height: 9px; border-radius: 50%; }
.fstage .dot.green { background: var(--green); } .fstage .dot.blue { background: var(--blue); }
.fstage .dot.amber { background: var(--amber); } .fstage .dot.gray { background: var(--gray); }
.fstage .dot.danger { background: var(--danger); }
.fstage .n { background: var(--bg); color: var(--muted); border-radius: 20px; padding: 1px 9px; font-size: 0.76rem; font-weight: 600; }
.fstage.active { background: var(--green); color: #fff; border-color: var(--green); box-shadow: 0 6px 16px var(--green-glow); }
.fstage.active .n { background: rgba(255,255,255,0.25); color: #fff; }
.fstage.active .dot { background: #fff !important; }

.deal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.deal-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 15px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.03);
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
  animation: revealUp 0.4s var(--ease) both;
}
.deal-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.deal-card .top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.deal-card .stage-tag { font-size: 0.7rem; font-weight: 600; padding: 3px 9px; border-radius: 20px; display: inline-flex; align-items: center; gap: 5px; }
.deal-card .client { font-weight: 600; font-size: 0.95rem; }
.deal-card .meta { color: var(--muted); font-size: 0.78rem; margin: 3px 0 12px; }
.deal-card .row { display: flex; align-items: center; justify-content: space-between; }
.deal-card .amount { font-weight: 700; color: var(--green-dark); font-size: 1rem; }
.deal-card .mini-avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--gray); color: #fff; display: grid; place-items: center; font-size: 0.68rem; font-weight: 600; }
.deal-card.hidden { display: none; }
.empty-hint { text-align: center; color: var(--muted); padding: 40px; font-size: 0.9rem; }

/* ===========================================================================
   DOSSIER (locked workflow)
   =========================================================================== */

.workflow { position: relative; padding-left: 8px; }
.wstep {
  display: flex; gap: 16px; padding-bottom: 22px; position: relative;
}
.wstep::before {
  content: ""; position: absolute; left: 21px; top: 38px; bottom: -4px; width: 2px; background: var(--line);
}
.wstep:last-child::before { display: none; }
.wstep .node {
  width: 44px; height: 44px; border-radius: 50%; flex: 0 0 auto;
  display: grid; place-items: center; font-size: 1.15rem; z-index: 1;
  border: 2px solid var(--line); background: #fff; color: var(--muted);
}
.wstep.done .node { background: var(--green); border-color: var(--green); color: #fff; }
.wstep.current .node {
  background: #fff; border-color: var(--green); color: var(--green);
  box-shadow: 0 0 0 6px var(--green-glow); animation: pulseRing 2s infinite;
}
.wstep.locked .node { background: #f7f8f7; color: #c3c7c3; }
.wstep .body { padding-top: 9px; }
.wstep .body .l { font-weight: 600; font-size: 0.95rem; }
.wstep .body .s { font-size: 0.8rem; color: var(--muted); }
.wstep.locked .body .l { color: var(--muted); }
@keyframes pulseRing {
  0% { box-shadow: 0 0 0 0 var(--green-glow); } 70% { box-shadow: 0 0 0 10px transparent; } 100% { box-shadow: 0 0 0 0 transparent; }
}

.doc-row {
  display: flex; align-items: center; gap: 12px; padding: 12px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 9px;
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.doc-row:hover { border-color: var(--green); transform: translateX(3px); }
.doc-row .di { width: 38px; height: 38px; border-radius: 9px; display: grid; place-items: center; background: var(--bg); color: var(--gray); font-size: 1.1rem; }
.doc-row .dn { flex: 1; font-size: 0.88rem; font-weight: 500; }

.tl-item { display: flex; gap: 13px; padding-bottom: 18px; position: relative; }
.tl-item::before { content: ""; position: absolute; left: 17px; top: 36px; bottom: -2px; width: 2px; background: var(--line); }
.tl-item:last-child::before { display: none; }
.tl-item .ti { width: 36px; height: 36px; border-radius: 50%; background: var(--green-light); color: var(--green); display: grid; place-items: center; flex: 0 0 auto; }
.tl-item .tb .who { font-weight: 600; font-size: 0.85rem; }
.tl-item .tb .what { font-size: 0.84rem; color: var(--gray); }
.tl-item .tb .when { font-size: 0.74rem; color: var(--muted); margin-top: 2px; }

/* ===========================================================================
   PLANNING
   =========================================================================== */

.legend { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.legend span { display: inline-flex; align-items: center; gap: 7px; font-size: 0.82rem; color: var(--gray); }
.legend .sw { width: 13px; height: 13px; border-radius: 4px; }
.sw.green { background: var(--green); } .sw.blue { background: var(--blue); }
.sw.amber { background: var(--amber); } .sw.purple { background: var(--purple); }

.cal { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; min-width: 720px; }
.cal__col { background: var(--bg); border-radius: var(--radius-sm); padding: 10px; min-height: 320px; }
.cal__day { text-align: center; font-weight: 600; font-size: 0.85rem; padding: 6px 0 12px; color: var(--gray); }
.ev {
  border-radius: 10px; padding: 11px 12px; margin-bottom: 9px; color: #fff;
  cursor: pointer; transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
  animation: revealUp 0.5s var(--ease) both;
}
.ev:hover { transform: scale(1.04); box-shadow: var(--shadow); }
.ev .c { font-weight: 600; font-size: 0.85rem; }
.ev .p { font-size: 0.75rem; opacity: 0.92; }
.ev .ev-time { font-size: 0.72rem; opacity: 0.95; margin-top: 5px; display: flex; align-items: center; gap: 5px; font-weight: 500; }
.ev .sl { font-size: 0.7rem; opacity: 0.85; margin-top: 5px; display: inline-block; background: rgba(255,255,255,0.22); padding: 1px 7px; border-radius: 10px; }
.ev.green { background: linear-gradient(135deg, var(--green), var(--green-dark)); }
.ev.blue { background: linear-gradient(135deg, #4f97d6, var(--blue)); }
.ev.amber { background: linear-gradient(135deg, #f4b450, var(--amber)); }
.ev.purple { background: linear-gradient(135deg, #a98bfa, var(--purple)); }

/* ---- Modal (pose detail) ---- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center;
  padding: 20px; background: rgba(30, 30, 29, 0.45); backdrop-filter: blur(3px);
  opacity: 0; visibility: hidden; transition: opacity 0.25s var(--ease), visibility 0.25s;
}
.modal-overlay.open { opacity: 1; visibility: visible; }
.modal {
  position: relative; width: 100%; max-width: 460px;
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 26px;
  transform: translateY(14px) scale(0.97); transition: transform 0.3s var(--ease);
}
.modal-overlay.open .modal { transform: translateY(0) scale(1); }
.modal__close {
  position: absolute; top: 16px; right: 16px; width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--card); color: var(--gray); cursor: pointer;
  display: grid; place-items: center; font-size: 0.9rem; transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.modal__close:hover { background: var(--bg); color: var(--danger); }
.modal__head { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; padding-right: 36px; }
.modal__pose-team { width: 10px; height: 44px; border-radius: 6px; flex: 0 0 auto; }
.modal__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.modal__cell span { display: flex; align-items: center; gap: 7px; font-size: 0.74rem; color: var(--muted); }
.modal__cell span i { color: var(--green); }
.modal__cell b { display: block; margin-top: 3px; font-size: 0.92rem; }
.modal__actions { display: flex; gap: 10px; margin-top: 24px; }
.modal__actions .btn { flex: 1; justify-content: center; }
.modal__late {
  display: flex; align-items: center; gap: 9px; margin-bottom: 18px;
  background: var(--danger-light); color: var(--danger); border-radius: var(--radius-sm);
  padding: 11px 14px; font-size: 0.82rem; font-weight: 600;
}
.modal__late[hidden] { display: none; }
.modal__desc {
  margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line);
  font-size: 0.86rem; color: var(--gray); line-height: 1.5;
}

/* ===========================================================================
   ESPACE CLIENT (mobile phone mockup)
   =========================================================================== */

.client-stage { display: grid; grid-template-columns: 340px 1fr; gap: 44px; align-items: start; }

/* ---- Phone mockup ---- */
/* The wrapper carries the .reveal entrance so it doesn't clash with the
   phone's own floaty animation (which would otherwise leave opacity at 0). */
.phone-wrap { display: flex; justify-content: center; }
.phone {
  width: 320px; height: 660px; background: #1c1c1b; border-radius: 44px; padding: 11px;
  box-shadow: var(--shadow-lg); position: relative;
  animation: floaty 5s ease-in-out infinite;
}
.phone__notch {
  position: absolute; top: 11px; left: 50%; transform: translateX(-50%);
  width: 120px; height: 26px; background: #1c1c1b; border-radius: 0 0 16px 16px; z-index: 5;
}
.phone__screen {
  width: 100%; height: 100%; background: var(--bg); border-radius: 34px; overflow: hidden;
  display: flex; flex-direction: column; position: relative;
}
.phone__status {
  flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between;
  background: #fff; color: var(--ink); padding: 13px 24px 5px; font-size: 0.74rem; font-weight: 600;
}
.phone__status .ic { display: inline-flex; gap: 5px; font-size: 0.78rem; }

/* Light app bar (replaces the heavy green hero) */
.phone__appbar {
  flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between;
  background: #fff; padding: 6px 18px 14px; border-bottom: 1px solid var(--line);
}
.phone__brand { display: flex; align-items: center; gap: 7px; }
.phone__brand img { width: 22px; }
.phone__brand span { font-weight: 700; font-size: 1.05rem; color: var(--gray); }
.phone__brand b { color: var(--green); }
.phone__appbar-actions { display: flex; align-items: center; gap: 12px; }
.phone__appbar-actions > i { font-size: 1.15rem; color: var(--gray); }
.phone-avatar {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: var(--green-light); color: var(--green-dark); font-weight: 700; font-size: 0.74rem;
}
.phone-avatar.lg { width: 48px; height: 48px; font-size: 0.95rem; flex: 0 0 auto; }

.phone__body { flex: 1; overflow-y: auto; padding: 16px; }

/* Tab panels */
.phone-panel { display: none; animation: revealUp 0.35s var(--ease) both; }
.phone-panel.active { display: block; }
.panel-title { font-size: 1.05rem; font-weight: 700; margin: 2px 2px 14px; }

/* Greeting (Accueil) */
.phone__greet { margin: 4px 2px 16px; }
.phone__greet .g-hi { font-size: 0.85rem; color: var(--muted); }
.phone__greet .g-nm { font-size: 1.35rem; font-weight: 700; line-height: 1.2; }
.phone__greet .g-ref { font-size: 0.76rem; color: var(--muted); margin-top: 6px; display: flex; align-items: center; gap: 6px; }

/* Progress card (Accueil) */
.prog-card .pcard-top { display: flex; align-items: center; justify-content: space-between; font-size: 0.82rem; margin-bottom: 10px; }
.prog-card .pcard-top b { color: var(--green-dark); font-size: 0.95rem; }
.prog-card .pcard-next { font-size: 0.76rem; color: var(--muted); margin-top: 11px; display: flex; align-items: center; gap: 6px; }
.prog-card .pcard-next i { color: var(--green); }
.prog-card .pcard-next b { color: var(--ink); }

.mini-card { background: #fff; border-radius: 14px; padding: 15px; box-shadow: var(--shadow); margin-bottom: 14px; }
.mini-card h4 { margin: 0 0 12px; font-size: 0.88rem; display: flex; align-items: center; gap: 8px; }
.mini-card h4 i { color: var(--green); }
.mstep { display: flex; align-items: center; gap: 11px; padding: 6px 0; font-size: 0.84rem; }
.mstep .mn { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 0.7rem; flex: 0 0 auto; }
.mstep .ml { flex: 1; display: flex; flex-direction: column; }
.mstep .ml small { font-size: 0.68rem; color: var(--muted); font-weight: 400; margin-top: 1px; }
.mstep .mtag { font-size: 0.66rem; font-weight: 600; color: var(--green-dark); background: var(--green-light); padding: 2px 8px; border-radius: 20px; }
.mstep.done .mn { background: var(--green); color: #fff; }
.mstep.current .mn { background: #fff; border: 2px solid var(--green); color: var(--green); }
.mstep.current { font-weight: 600; }
.mstep.locked .mn { background: #eef0ee; color: #bcc0bc; }
.mstep.locked { color: var(--muted); }

.pay-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pay-card .pc-l { font-size: 0.72rem; color: var(--muted); }
.pay-card .pc-v { font-size: 1.25rem; font-weight: 700; color: var(--green-dark); line-height: 1.2; }
.pay-card .pc-s { font-size: 0.68rem; color: var(--muted); margin-top: 2px; }
.pay-card .pc-btn { padding: 10px 18px; font-size: 0.82rem; flex: 0 0 auto; }

.mdoc { display: flex; align-items: center; gap: 10px; padding: 7px 0; font-size: 0.82rem; }
.mdoc i { color: var(--green); font-size: 1rem; }
.mdoc .badge { margin-left: auto; font-size: 0.66rem; }

.avis-btn {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px;
  background: #fff; color: var(--green-dark); border: 1.5px solid var(--green);
  border-radius: 14px; padding: 13px; font-family: inherit; font-size: 0.84rem; font-weight: 600;
  cursor: pointer; margin-bottom: 14px; transition: background 0.2s var(--ease);
}
.avis-btn:hover { background: var(--green-light); }
.avis-btn i { color: var(--amber); }

.club-banner { background: linear-gradient(135deg, #2b2b2a, #575756); color: #fff; border-radius: 14px; padding: 16px; }
.club-banner .k { font-size: 0.72rem; opacity: 0.85; letter-spacing: 1px; text-transform: uppercase; display: flex; align-items: center; gap: 6px; }
.club-banner .v { font-size: 1.02rem; font-weight: 700; margin-top: 5px; }

/* Contact panel */
.advisor-card { display: flex; align-items: center; gap: 13px; }
.advisor-card b { display: block; font-size: 0.92rem; }
.advisor-card span { font-size: 0.76rem; color: var(--muted); }
.contact-actions { display: flex; gap: 10px; margin-bottom: 14px; }
.contact-actions button {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 7px;
  border: none; border-radius: 12px; padding: 12px; font-family: inherit; font-size: 0.82rem;
  font-weight: 600; cursor: pointer; background: var(--green); color: #fff;
  transition: transform 0.15s var(--ease), filter 0.15s var(--ease);
}
.contact-actions button.wa { background: #25d366; }
.contact-actions button:hover { transform: translateY(-2px); filter: brightness(1.05); }
.fake-input { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; font-size: 0.8rem; color: var(--muted); }
.agency-line { display: flex; align-items: center; gap: 9px; font-size: 0.8rem; padding: 5px 0; }
.agency-line i { color: var(--green); }

/* Compte panel */
.account-head { display: flex; align-items: center; gap: 13px; }
.account-head b { display: block; font-size: 0.92rem; }
.account-head span { display: block; font-size: 0.74rem; color: var(--muted); }
.account-summary { display: grid; gap: 9px; }
.account-summary > div { display: flex; align-items: center; justify-content: space-between; font-size: 0.82rem; }
.account-summary span { color: var(--muted); }
.account-rows { padding: 6px 15px; }
.arow { display: flex; align-items: center; gap: 11px; padding: 11px 0; font-size: 0.84rem; border-bottom: 1px solid var(--line); }
.arow:last-child { border-bottom: none; }
.arow i:first-child { color: var(--green); font-size: 1rem; }
.arow .ar-chev { margin-left: auto; color: var(--muted); font-size: 0.85rem; }
.arow .ar-val { margin-left: auto; color: var(--muted); font-size: 0.78rem; }
.logout-btn {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--danger-light); color: var(--danger); border: none; border-radius: 14px;
  padding: 13px; font-family: inherit; font-size: 0.84rem; font-weight: 600; cursor: pointer;
  transition: filter 0.15s var(--ease);
}
.logout-btn:hover { filter: brightness(0.97); }

.phone__tabbar {
  flex: 0 0 auto; display: flex; justify-content: space-around;
  background: #fff; border-top: 1px solid var(--line); padding: 9px 6px 11px;
}
.phone__tabbar span { cursor: pointer; transition: color 0.15s var(--ease); }
.phone__tabbar span {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  font-size: 0.62rem; color: var(--muted);
}
.phone__tabbar span i { font-size: 1.1rem; }
.phone__tabbar span.active { color: var(--green); }

/* ---- Features + Club (right column) ---- */
.client-side { display: flex; flex-direction: column; gap: 20px; }
.feature-list { list-style: none; padding: 0; margin: 0; }
.feature-list li { display: flex; gap: 13px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.feature-list li:last-child { border-bottom: none; padding-bottom: 0; }
.feature-list li i { color: var(--green); font-size: 1.3rem; }
.feature-list li b { display: block; font-size: 0.95rem; }
.feature-list li span { color: var(--muted); font-size: 0.85rem; }

.club-card { background: linear-gradient(135deg, #2b2b2a, #575756); color: #fff; border: none; }
.club-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.club-item { display: flex; gap: 11px; align-items: flex-start; }
.club-item i { font-size: 1.25rem; color: var(--green); margin-top: 2px; }
.club-item b { display: block; font-size: 0.88rem; }
.club-item span { font-size: 0.76rem; opacity: 0.72; }

/* ===========================================================================
   LOGIN
   =========================================================================== */

.login-wrap { display: grid; grid-template-columns: 1fr 1fr; min-height: 100vh; }
.login-aside {
  position: relative; overflow: hidden; color: #fff;
  background: linear-gradient(150deg, var(--green-dark) 0%, var(--green) 60%, #5cc24a 100%);
  display: flex; flex-direction: column; justify-content: space-between; padding: 48px;
}
.login-aside .blob { position: absolute; border-radius: 50%; background: rgba(255,255,255,0.12); animation: floaty 7s ease-in-out infinite; }
.login-aside .blob.b1 { width: 280px; height: 280px; top: -80px; right: -60px; }
.login-aside .blob.b2 { width: 180px; height: 180px; bottom: 40px; left: -50px; animation-delay: 1.5s; }
.login-aside .blob.b3 { width: 90px; height: 90px; top: 45%; right: 18%; animation-delay: 0.8s; }
.login-aside__brand { display: flex; align-items: center; gap: 12px; position: relative; z-index: 2; }
.login-aside__brand img { width: 40px; filter: brightness(0) invert(1); }
.login-aside__brand span { font-size: 1.6rem; font-weight: 700; }
.login-aside__pitch { position: relative; z-index: 2; }
.login-aside__pitch h2 { font-size: 2.1rem; font-weight: 700; line-height: 1.2; margin: 0 0 14px; }
.login-aside__pitch p { font-size: 1rem; opacity: 0.92; max-width: 380px; line-height: 1.6; }
.login-aside__feats { position: relative; z-index: 2; display: flex; flex-direction: column; gap: 12px; }
.login-aside__feats div { display: flex; align-items: center; gap: 11px; font-size: 0.92rem; }
.login-aside__feats i { background: rgba(255,255,255,0.2); width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; }

.login-main { display: grid; place-items: center; padding: 40px; background: var(--card); }
.login-box { width: 100%; max-width: 360px; }
.login-box .lg-logo { display: none; }
.login-box h1 { font-size: 1.7rem; font-weight: 700; margin: 0 0 6px; }
.login-box .sub { color: var(--muted); margin: 0 0 30px; }
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 0.82rem; font-weight: 600; margin-bottom: 7px; color: var(--gray); }
.field .inp {
  display: flex; align-items: center; gap: 10px; border: 1.5px solid var(--line);
  border-radius: 12px; padding: 13px 15px; transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.field .inp:focus-within { border-color: var(--green); box-shadow: 0 0 0 4px var(--green-glow); }
.field .inp i { color: var(--muted); }
.field .inp input { border: none; outline: none; flex: 1; font-family: inherit; font-size: 0.95rem; background: none; }
.login-box .btn-primary { width: 100%; justify-content: center; margin-top: 8px; padding: 14px; }
.login-row { display: flex; align-items: center; justify-content: space-between; font-size: 0.83rem; color: var(--muted); }
.login-row a { color: var(--green-dark); font-weight: 600; }

/* ===========================================================================
   EXTRAS  (retention / sav / finance / roles)
   =========================================================================== */

/* Restricted-access banner (finance) */
.locked-banner {
  display: flex; align-items: center; gap: 14px;
  background: linear-gradient(135deg, #2b2b2a, #575756); color: #fff;
  border-radius: var(--radius); padding: 16px 20px; margin-bottom: 22px;
}
.locked-banner i { font-size: 1.5rem; }
.locked-banner b { font-size: 0.95rem; }
.locked-banner span { opacity: 0.82; font-size: 0.84rem; }

/* Mini progress bar */
.bar { height: 8px; border-radius: 6px; background: var(--line); overflow: hidden; min-width: 90px; }
.bar > i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--green), #5cc24a); animation: barGrow 1s var(--ease) both; }
@keyframes barGrow { from { width: 0 !important; } }

/* Relance pips (retention) */
.relances { display: inline-flex; gap: 4px; }
.relances i { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.relances i.on { background: var(--amber); }
.relances i.max { background: var(--danger); }

/* Permission matrix */
.matrix { width: 100%; border-collapse: collapse; }
.matrix th, .matrix td { padding: 12px; text-align: center; border-bottom: 1px solid var(--line); font-size: 0.85rem; }
.matrix th:first-child, .matrix td:first-child { text-align: left; }
.matrix thead th { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); }
.matrix .role { font-weight: 600; }
.matrix .scope { font-size: 0.74rem; color: var(--muted); font-weight: 400; display: block; }
.perm { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; font-size: 0.9rem; }
.perm.edit { background: var(--green-light); color: var(--green-dark); }
.perm.view { background: var(--blue-light); color: var(--blue); }
.perm.none { background: #f3f4f3; color: #cfd3cf; }

/* Two-flow columns header */
.flow-title { display: flex; align-items: center; gap: 9px; font-weight: 600; margin-bottom: 14px; }
.flow-title .pip { width: 10px; height: 10px; border-radius: 50%; }

/* Donut wrapper */
.donut-wrap { display: flex; align-items: center; justify-content: center; }

/* Connected tools strip (integrations) */
.integrations {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 14px 18px; border-radius: var(--radius); background: var(--card);
  border: 1px solid var(--line); box-shadow: var(--shadow);
}
.integrations .lbl { font-size: 0.78rem; font-weight: 600; color: var(--muted); margin-right: 4px; }
.tool {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 13px; border-radius: 30px; background: var(--bg);
  border: 1px solid var(--line); font-size: 0.82rem; font-weight: 500;
  transition: transform 0.2s var(--ease), border-color 0.2s var(--ease);
}
.tool:hover { transform: translateY(-2px); border-color: var(--green); }
.tool i { color: var(--green); font-size: 1rem; }
.tool .ok { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px var(--green-light); }

/* Filter chips */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  padding: 8px 16px; border-radius: 30px; border: 1px solid var(--line);
  background: var(--card); font-size: 0.84rem; font-weight: 500; color: var(--gray);
  cursor: pointer; transition: all 0.2s var(--ease);
}
.chip:hover { border-color: var(--green); color: var(--green-dark); }
.chip.active { background: var(--green); color: #fff; border-color: var(--green); box-shadow: 0 6px 16px var(--green-glow); }

/* Lost-deal motif badge on kanban cards */
.deal .motif { display: inline-flex; align-items: center; gap: 5px; font-size: 0.72rem; font-weight: 600; color: var(--danger); background: var(--danger-light); padding: 3px 9px; border-radius: 20px; }

/* Star rating */
.stars { color: #f5b50a; font-size: 0.95rem; letter-spacing: 1px; }

/* Clickable table rows */
.row-link { cursor: pointer; }
.row-link:hover { background: var(--green-light) !important; }
.row-link:hover .bi-chevron-right { color: var(--green) !important; transform: translateX(3px); transition: transform .2s var(--ease); }

/* Back link */
.back-link { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: .85rem; font-weight: 500; margin-bottom: 14px; }
.back-link:hover { color: var(--green-dark); }

/* LinkedIn post preview */
.post {
  border: 1px solid var(--line); border-radius: 12px; padding: 15px; margin-bottom: 12px;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.post:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.post .head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; }
.post .head .li { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 0.85rem; color: #0a66c2; }
.post .body { font-size: 0.88rem; color: var(--gray); line-height: 1.5; }
.post .post-actions { margin-top: 12px; display: flex; gap: 8px; }

/* Editable LinkedIn text inside the modal (auto-grows, no scroll) */
.li-edit {
  display: block; width: calc(100% - 28px); margin: 4px 14px 12px;
  border: 1px solid #0a66c2; border-radius: 10px; padding: 11px 13px;
  font-family: inherit; font-size: 0.9rem; color: var(--ink); line-height: 1.55;
  resize: none; overflow: hidden; background: #fbfdff;
  box-shadow: 0 0 0 3px rgba(10,102,194,0.12);
}
.li-edit:focus { outline: none; }

/* LinkedIn-style preview (modal) */
.li-modal-head { display: flex; align-items: center; gap: 9px; font-weight: 600; font-size: 0.92rem; color: #0a66c2; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.li-modal-head i { font-size: 1.2rem; }
.li-modal-actions { display: flex; gap: 10px; padding: 16px 18px; border-top: 1px solid var(--line); }
.li-modal-actions .btn { flex: 1; justify-content: center; }
.li-card { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.li-top { display: flex; align-items: flex-start; gap: 11px; padding: 14px 14px 8px; }
.li-avatar { width: 48px; height: 48px; flex: 0 0 auto; border-radius: 50%; background: var(--green-light); display: grid; place-items: center; }
.li-avatar img { width: 28px; }
.li-id { flex: 1; line-height: 1.25; }
.li-id b { font-size: 0.92rem; }
.li-id span { display: block; font-size: 0.74rem; color: var(--muted); }
.li-id .li-time { margin-top: 2px; }
.li-net { color: #0a66c2; font-size: 1.3rem; }
.li-text { padding: 4px 14px 12px; font-size: 0.9rem; color: var(--ink); line-height: 1.55; }
.li-tags { padding: 0 14px 12px; display: flex; flex-wrap: wrap; gap: 6px; }
.li-tags span { color: #0a66c2; font-size: 0.82rem; font-weight: 500; }
.li-img { background: var(--bg); }
.li-img img { width: 100%; max-height: 240px; object-fit: cover; display: block; }
.li-stats { display: flex; justify-content: space-between; padding: 10px 14px; font-size: 0.78rem; color: var(--muted); border-top: 1px solid var(--line); }
.li-stats span { display: inline-flex; align-items: center; gap: 4px; }
.li-actions { display: flex; justify-content: space-around; padding: 6px; border-top: 1px solid var(--line); }
.li-actions span { display: inline-flex; align-items: center; gap: 6px; font-size: 0.82rem; font-weight: 600; color: var(--gray); padding: 9px 8px; border-radius: 8px; cursor: pointer; transition: background 0.2s var(--ease); }
.li-actions span:hover { background: var(--bg); }

/* ===========================================================================
   RESPONSIVE  (mobile / tablet / desktop)
   =========================================================================== */

.scrim { display: none; }

@media (max-width: 1100px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .cols-2 { grid-template-columns: 1fr; }
  .cols-3 { grid-template-columns: repeat(2, 1fr); }
  .client-stage { grid-template-columns: 1fr; }
}

@media (max-width: 880px) {
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .burger { display: block; }
  .search { display: none; }
  .scrim.show { display: block; position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 39; animation: pageIn 0.3s; }

  .login-wrap { grid-template-columns: 1fr; }
  .login-aside { display: none; }
  .login-box .lg-logo { display: flex; align-items: center; gap: 10px; justify-content: center; margin-bottom: 26px; }
  .login-box .lg-logo img { width: 34px; }
  .login-box .lg-logo span { font-size: 1.5rem; font-weight: 700; color: var(--gray); }
  .login-box .lg-logo b { color: var(--green); }
}

@media (max-width: 560px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .cols-3 { grid-template-columns: 1fr; }
  .content { padding: 18px 14px 50px; }
  .topbar { padding: 0 14px; }
  .user-chip .meta { display: none; }
}

/* ===========================================================================
   ROLES — "view as" chrome, menus, sheets & role homes (TANDA 1)
   =========================================================================== */

/* ---- Generic dropdown popover (notifications / role switcher) ---- */
.js-menu { position: relative; }
.menu-pop {
  position: absolute; top: calc(100% + 10px); right: 0;
  width: 296px; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); padding: 8px;
  opacity: 0; visibility: hidden; transform: translateY(-8px) scale(0.98);
  transform-origin: top right; transition: opacity 0.2s var(--ease), transform 0.2s var(--ease), visibility 0.2s;
  z-index: 60;
}
.js-menu.open .menu-pop { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }
.js-menu.open .chev { transform: rotate(180deg); }
.chev { transition: transform 0.25s var(--ease); }

.dd-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px; }
.dd-head b { font-size: 0.9rem; }
.dd-count { background: var(--green-light); color: var(--green-dark); font-size: 0.7rem; font-weight: 700; padding: 1px 8px; border-radius: 20px; }
.dd-label { font-size: 0.66rem; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); margin: 8px 10px 4px; }
.dd-role { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; color: var(--gray); transition: background 0.18s var(--ease); }
.dd-role:hover, .dd-role.is-current { background: var(--green-light); }
.dd-ava { width: 30px; height: 30px; flex: 0 0 auto; border-radius: 50%; background: linear-gradient(135deg, var(--green), var(--green-dark)); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 0.72rem; }
.dd-rl { flex: 1; line-height: 1.15; }
.dd-rl b { font-size: 0.85rem; }
.dd-rl small { display: block; font-size: 0.72rem; color: var(--muted); }
.dd-on { color: var(--green); }

/* Notifications list */
.notif-item { display: flex; gap: 11px; padding: 10px; border-radius: 10px; transition: background 0.18s var(--ease); }
.notif-item:hover { background: var(--bg); }
.notif-ic { width: 34px; height: 34px; flex: 0 0 auto; border-radius: 9px; display: grid; place-items: center; font-size: 1rem; }
.notif-ic.danger { background: var(--danger-light); color: var(--danger); }
.notif-ic.amber { background: var(--amber-light); color: #b9760a; }
.notif-ic.info { background: var(--blue-light); color: var(--blue); }
.notif-ic.green { background: var(--green-light); color: var(--green-dark); }
.notif-tx { flex: 1; min-width: 0; }
.notif-tx b { font-size: 0.83rem; }
.notif-tx span { display: block; font-size: 0.78rem; color: var(--gray); }
.notif-tx small { font-size: 0.7rem; color: var(--muted); }
.notif-all { display: block; text-align: center; padding: 9px; font-size: 0.8rem; font-weight: 600; color: var(--green-dark); border-top: 1px solid var(--line); margin-top: 4px; }
.notif-empty { text-align: center; color: var(--muted); font-size: 0.85rem; padding: 16px; }

/* "Vue : role" pill in the desktop topbar */
.view-as-pill { display: inline-flex; align-items: center; gap: 7px; font-size: 0.78rem; font-weight: 600; color: var(--gray); background: var(--amber-light); border: 1px solid #f0dcae; padding: 7px 13px; border-radius: 30px; }
.view-as-pill:hover { border-color: var(--amber); color: #b9760a; }
.view-as-pill .bi-x-circle { color: var(--muted); }

/* ---- Mobile chrome: phone shell ---- */
.role-stage { min-height: 100vh; display: flex; flex-direction: column; align-items: center; padding: 18px 14px 28px; background: radial-gradient(120% 80% at 50% 0%, #e9efe9 0%, var(--bg) 55%); }
.role-stage__bar { width: 100%; max-width: 440px; display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.rs-tag { font-size: 0.78rem; color: var(--gray); display: inline-flex; align-items: center; gap: 7px; }
.rs-tag i { color: var(--green); }
.rs-tag b { color: var(--ink); }
.rs-btn { display: inline-flex; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 30px; padding: 8px 14px; font-family: inherit; font-size: 0.8rem; font-weight: 600; color: var(--gray); cursor: pointer; box-shadow: var(--shadow); }
.rs-btn:hover { border-color: var(--green); color: var(--green-dark); }
.rs-pop { right: 0; }

.mobile-shell { width: 100%; max-width: 440px; height: min(86vh, 880px); background: var(--bg); border: 1px solid var(--line); border-radius: 38px; box-shadow: var(--shadow-lg); overflow: hidden; display: flex; flex-direction: column; position: relative; }
.mobile-shell .phone__appbar { padding: 8px 18px 14px; }
.ms-ic { position: relative; background: none; border: none; cursor: pointer; color: var(--gray); font-size: 1.2rem; padding: 2px; }
.ms-ic .dot { position: absolute; top: 0; right: 0; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 0 2px #fff; }
.mobile-shell .phone-avatar { border: none; cursor: pointer; }
.ms-body { flex: 1; overflow-y: auto; padding: 16px; }
.ms-tabs { flex: 0 0 auto; display: flex; justify-content: space-around; background: #fff; border-top: 1px solid var(--line); padding: 8px 4px 10px; }
.ms-tab { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 0.62rem; color: var(--muted); flex: 1; }
.ms-tab i { font-size: 1.15rem; }
.ms-tab.active { color: var(--green); font-weight: 600; }

/* Slide-up sheets */
.sheet { position: absolute; inset: 0; z-index: 70; display: flex; align-items: flex-end; background: rgba(30, 30, 29, 0.4); opacity: 0; visibility: hidden; transition: opacity 0.25s var(--ease), visibility 0.25s; }
.sheet.open { opacity: 1; visibility: visible; }
.sheet__card { width: 100%; background: var(--card); border-radius: 22px 22px 0 0; padding: 8px 14px 18px; max-height: 80%; overflow-y: auto; transform: translateY(100%); transition: transform 0.3s var(--ease); }
.sheet.open .sheet__card { transform: translateY(0); }
.sheet__head { display: flex; align-items: center; justify-content: space-between; padding: 12px 6px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.sheet__head b { font-size: 0.92rem; display: inline-flex; align-items: center; gap: 8px; }
.sheet__head b i { color: var(--green); }
.sheet__close { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); cursor: pointer; color: var(--gray); }
.sheet__body { display: flex; flex-direction: column; gap: 2px; }
.sheet-link { display: flex; align-items: center; gap: 11px; padding: 12px 10px; border-radius: 10px; font-weight: 500; color: var(--gray); }
.sheet-link:hover { background: var(--green-light); }
.sheet-link.danger { color: var(--danger); }
.sheet-link i { font-size: 1.05rem; }

/* ---- Role-home shared components ---- */
.home-head { margin-bottom: 16px; }
.home-head .hi { font-size: 0.85rem; color: var(--muted); }
.home-head h2 { margin: 1px 0 0; font-size: 1.35rem; font-weight: 700; }
.home-head .sub { color: var(--muted); font-size: 0.86rem; margin: 3px 0 0; }
.home-sec { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; color: var(--gray); margin: 18px 2px 10px; display: flex; align-items: center; gap: 8px; }
.home-sec i { color: var(--green); }

/* Spotlight (hero task / chantier) */
.spotlight { border-radius: var(--radius); padding: 18px; margin-bottom: 16px; color: #fff; box-shadow: var(--shadow); }
.spotlight--danger { background: linear-gradient(135deg, #e2483d, #b5362d); }
.spotlight--green { background: linear-gradient(135deg, var(--green-dark), var(--green)); }
.spotlight .sl-k { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 1px; opacity: 0.85; display: flex; align-items: center; gap: 7px; }
.spotlight h3 { margin: 7px 0 6px; font-size: 1.12rem; }
.spotlight p { margin: 0; font-size: 0.84rem; opacity: 0.92; line-height: 1.5; }
.spotlight .sl-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.spotlight .sl-chip { background: rgba(255, 255, 255, 0.2); border-radius: 20px; padding: 4px 11px; font-size: 0.76rem; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.spotlight .sl-actions { display: flex; gap: 9px; margin-top: 14px; }
.spotlight .sl-btn { flex: 1; justify-content: center; background: #fff; color: var(--ink); box-shadow: none; }
.spotlight .sl-btn.ghost { background: rgba(255, 255, 255, 0.16); color: #fff; }
.spotlight .sl-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

/* To-do / task rows (relances, confirmations, finitions, flow…) */
.todo { display: flex; align-items: center; gap: 12px; padding: 13px; border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 9px; background: var(--card); color: inherit; transition: transform 0.2s var(--ease), border-color 0.2s var(--ease); }
.todo:hover { transform: translateX(3px); border-color: var(--green); }
.todo__ic { width: 38px; height: 38px; flex: 0 0 auto; border-radius: 10px; display: grid; place-items: center; font-size: 1.1rem; }
.todo__ic.green { background: var(--green-light); color: var(--green-dark); }
.todo__ic.blue { background: var(--blue-light); color: var(--blue); }
.todo__ic.amber { background: var(--amber-light); color: #b9760a; }
.todo__ic.danger { background: var(--danger-light); color: var(--danger); }
.todo__ic.gray { background: #eef0ee; color: var(--gray); }
.todo__bd { flex: 1; min-width: 0; }
.todo__bd .t { font-weight: 600; font-size: 0.9rem; }
.todo__bd .s { font-size: 0.8rem; color: var(--muted); }
.todo__bd .who { color: var(--green-dark); font-weight: 600; }
.todo__cta { flex: 0 0 auto; font-size: 0.78rem; font-weight: 600; color: var(--green-dark); background: var(--green-light); padding: 7px 13px; border-radius: 30px; border: none; cursor: pointer; font-family: inherit; }
.todo__cta:hover { background: var(--green); color: #fff; }
.todo__meta { flex: 0 0 auto; font-size: 0.74rem; color: var(--muted); text-align: right; }

/* Commission card */
.comm-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 0; border-bottom: 1px dashed var(--line); }
.comm-line:last-of-type { border-bottom: none; }
.comm-line .cl { font-size: 0.85rem; }
.comm-line .cl small { display: block; color: var(--muted); font-size: 0.72rem; }
.comm-total { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; padding-top: 11px; border-top: 1px solid var(--line); font-weight: 700; }
.comm-total b { color: var(--green-dark); font-size: 1.05rem; }

/* Stat line (mobile mini stats) */
.statline { display: flex; gap: 10px; }
.statline .stat { flex: 1; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 11px; text-align: center; }
.statline .stat b { display: block; font-size: 1.2rem; font-weight: 700; color: var(--ink); }
.statline .stat span { font-size: 0.7rem; color: var(--muted); }

/* Blocked (locked) note */
.locked-note { display: flex; align-items: center; gap: 11px; padding: 12px 13px; border-radius: var(--radius-sm); background: #f7f8f7; border: 1px dashed var(--line); color: var(--muted); font-size: 0.84rem; margin-bottom: 9px; }
.locked-note i { color: var(--danger); font-size: 1.15rem; flex: 0 0 auto; }
.locked-note b { color: var(--gray); }

/* Tool placeholders (Plaud dictée / stylet / actions) */
.tool-row { display: flex; gap: 10px; margin-top: 10px; }
.tool-ph { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 12px; border: 1.5px dashed var(--line); border-radius: 12px; background: var(--card); color: var(--gray); font-family: inherit; font-size: 0.74rem; font-weight: 600; cursor: pointer; }
.tool-ph:hover { border-color: var(--green); }
.tool-ph i { font-size: 1.3rem; color: var(--green); }
.tool-ph small { color: var(--muted); font-weight: 400; font-size: 0.66rem; }

/* Map placeholder (poseur) */
.map-ph { height: 120px; border-radius: 12px; margin-top: 12px; position: relative; overflow: hidden; background: linear-gradient(135deg, #dfe7df, #eef1ee); border: 1px solid rgba(255, 255, 255, 0.4); }
.map-ph .pin { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -100%); color: var(--danger); font-size: 1.6rem; }
.map-ph .addr { position: absolute; left: 10px; bottom: 10px; background: #fff; border-radius: 8px; padding: 6px 10px; font-size: 0.74rem; font-weight: 600; color: var(--ink); box-shadow: var(--shadow); display: inline-flex; align-items: center; gap: 6px; }
.map-ph .addr i { color: var(--green); }

@media (max-width: 560px) {
  .role-stage { padding: 10px; }
  .mobile-shell { max-width: none; height: calc(100vh - 84px); border-radius: 24px; }
}

/* ---------------------------------------------------------------------------
   Reflow inherited (desktop-first) pages when rendered inside the phone shell.
   Scoped to .ms-body so the desktop chrome is untouched. The shell is a narrow
   container (~408px) on a wide viewport, so viewport media queries don't fire —
   these container-scoped rules do the reordering instead.
   --------------------------------------------------------------------------- */
.ms-body .page-head h2 { font-size: 1.2rem !important; }

/* 4-KPI rows → 2×2; keep values from truncating */
.ms-body .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
.ms-body .kpi { padding: 15px; }
.ms-body .kpi__val { font-size: 1.4rem; }
.ms-body .kpi__delta { position: static; display: inline-block; margin-bottom: 4px; }
.ms-body .kpi::after { display: none; }

/* 2- and 3-column sections → stacked (beats inline grid-template-columns) */
.ms-body .cols-2,
.ms-body .cols-3 { grid-template-columns: 1fr !important; }

/* CRM kanban → single stacked column (no horizontal scroll) */
.ms-body .kanban { overflow-x: visible; }
.ms-body .phase-board { flex-direction: column; }
.ms-body .phase-board .kcol { max-width: none; min-width: 0; flex: 1 1 auto; }
.ms-body .deal-grid { grid-template-columns: 1fr; }

/* Planning weekly grid → vertical day list */
.ms-body .cal { grid-template-columns: 1fr !important; min-width: 0; gap: 10px; }
.ms-body .cal__col { min-height: 0; }

/* Espace-client mockup, if ever opened in the shell */
.ms-body .client-stage { grid-template-columns: 1fr; }

/* Tables fit by wrapping; compact them a touch on mobile */
.ms-body .table { font-size: 0.78rem; }
.ms-body .table th, .ms-body .table td { padding: 9px 7px; }

/* Hard guard: nothing in the body may exceed the shell width */
.ms-body img, .ms-body table, .ms-body .card { max-width: 100%; }
/* Let grid/flex children shrink below their content (long product names in
   .dc-meta use white-space:nowrap, which otherwise pins the card min-width). */
.ms-body .grid > *, .ms-body .dossier-card { min-width: 0; }
/* Tables fit the shell by distributing columns and wrapping long cells. */
.ms-body .table { table-layout: fixed; }
.ms-body .table th, .ms-body .table td { word-break: break-word; }
