/* ================================================================
   CAMALARM CRM — Layout v2
   Header · Sidebar · Landing Premium · Tabs
   ================================================================ */

/* ══════════════════════════════════════════════════════════════
   HEADER
   ══════════════════════════════════════════════════════════════ */
.hdr {
  background: var(--gradient-brand);
  padding: 0 var(--s5);
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 0 rgba(255,255,255,.06), 0 4px 16px rgba(15,23,42,.18);
}
.hdr-l { display: flex; align-items: center; gap: var(--s4); }
.hdr-logo { height: 36px; cursor: pointer; transition: opacity var(--tr-fast); filter: brightness(0) invert(1); }
.hdr-logo:hover { opacity: .85; }
.hdr-t { color: rgba(255,255,255,.7); font-size: var(--text-sm); font-weight: var(--fw-medium); letter-spacing: -.01em; display: none; }
.hdr-b {
  background: rgba(249,115,22,.9);
  color: var(--text-inverse);
  font-size: 9px;
  font-weight: var(--fw-bold);
  padding: 2px 10px;
  border-radius: var(--radius-full);
  letter-spacing: .6px;
  text-transform: uppercase;
}
.hdr-r { display: flex; align-items: center; gap: var(--s1); }
.hb {
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.8);
  border: 1px solid rgba(255,255,255,.12);
  padding: 0;
  width: 34px; height: 34px;
  border-radius: var(--radius-md);
  font-size: 16px;
  cursor: pointer;
  display: none;
  transition: all var(--tr-fast);
  align-items: center;
  justify-content: center;
}
.hb.s { display: inline-flex; }
.hb:hover { background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.2); }
.ub {
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.85);
  padding: 0 var(--s3);
  height: 34px;
  border-radius: var(--radius-md);
  font: var(--fw-medium) var(--text-sm)/1 var(--font);
  cursor: pointer;
  border: 1px solid rgba(255,255,255,.12);
  transition: all var(--tr-fast);
  white-space: nowrap;
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: var(--s1);
}
.ub:hover { background: rgba(255,255,255,.16); }

/* ══════════════════════════════════════════════════════════════
   LANDING — Direction Linear/Stripe
   Fond neutre propre · Cartes nettes · Hiérarchie claire
   ══════════════════════════════════════════════════════════════ */
#landP {
  background: var(--neutral-50);
  min-height: calc(100vh - 56px);
}

.land {
  padding: var(--s6) var(--s5) var(--s8);
  max-width: 1080px;
  margin: 0 auto;
  box-sizing: border-box;
  width: 100%;
}

/* ── En-tête landing ── */
.land-h {
  margin-bottom: var(--s7);
  animation: fadeUp .4s var(--ease) both;
}
.land-h h1 {
  font-size: var(--text-2xl);
  font-weight: var(--fw-black);
  color: var(--text-primary);
  letter-spacing: -.06em;
  line-height: var(--lh-tight);
}
.land-h h1 span {
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.land-h p {
  font-size: var(--text-base);
  color: var(--text-secondary);
  margin-top: var(--s2);
  font-weight: var(--fw-normal);
}
@keyframes fadeUp {
  from { opacity:0; transform:translateY(10px); }
}

/* ── Section label ── */
.sl {
  font-size: var(--text-xs);
  font-weight: var(--fw-bold);
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: var(--s3);
  display: flex;
  align-items: center;
  gap: var(--s2);
}
.sl::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Grille landing ── */
.la {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: var(--s2);
  margin-bottom: var(--s6);
}

/* ── Carte landing — sobres, nettes ── */
.ac {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: var(--s4);
  display: flex;
  align-items: center;
  gap: var(--s3);
  cursor: pointer;
  transition: all var(--tr-base);
  box-shadow: var(--shadow-xs);
  animation: cardFade .3s var(--ease) both;
  position: relative;
  overflow: hidden;
}
.ac::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  background: var(--gradient-brand);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--tr-base);
}
.ac:hover {
  border-color: var(--neutral-300);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.ac:hover::after { transform: scaleX(1); }
.ac:active { transform: scale(.98) translateY(0); }

/* Stagger d'entrée */
@keyframes cardFade {
  from { opacity:0; transform:translateY(8px); }
  to   { opacity:1; transform:none; }
.la .ac:nth-child(1) { animation-delay:.03s; }
.la .ac:nth-child(2) { animation-delay:.06s; }
.la .ac:nth-child(3) { animation-delay:.09s; }
.la .ac:nth-child(4) { animation-delay:.12s; }
.la .ac:nth-child(5) { animation-delay:.15s; }
.la .ac:nth-child(6) { animation-delay:.18s; }
.la .ac:nth-child(7) { animation-delay:.21s; }
.la .ac:nth-child(8) { animation-delay:.24s; }

/* ── Icônes cartes ── */
.ai2 {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 18px;
  transition: transform var(--tr-fast);
}
.ac:hover .ai2 { transform: scale(1.08); }

/* Palette par catégorie — sobres */
.ai2.b  { background: var(--blue-100);   color: var(--blue-700); }
.ai2.o  { background: var(--orange-100); color: var(--orange-600); }
.ai2.g  { background: var(--green-50);   color: var(--green-700); }
.ai2.r  { background: var(--red-50);     color: var(--red-700); }
.ai2:not(.b):not(.o):not(.g):not(.r) {
  background: var(--orange-50);
  color: var(--orange-600);
}

/* ── Texte cartes ── */
.at2 {
  font-size: var(--text-sm);
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
  letter-spacing: -.01em;
  line-height: 1.3;
}
.as2 {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  font-weight: var(--fw-normal);
  margin-top: 2px;
}

/* ══════════════════════════════════════════════════════════════
   LEGACY LANDING CLASSES (lg, cc, ci, cn, cds)
   ══════════════════════════════════════════════════════════════ */
.lg { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px,1fr)); gap: var(--s3); margin-bottom: var(--s6); }
.cc {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: var(--s5) var(--s3);
  text-align: center;
  cursor: pointer;
  transition: all var(--tr-base);
  box-shadow: var(--shadow-xs);
}
.cc:hover { border-color: var(--neutral-300); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.ci { width: 48px; height: 48px; margin: 0 auto var(--s2); display: flex; align-items: center; justify-content: center; border-radius: var(--radius-md); transition: transform var(--tr-fast); }
.cc:hover .ci { transform: scale(1.08); }
.ci.c1 { background: var(--blue-100); }
.ci.c2 { background: var(--orange-100); }
.ci.c3 { background: #e8eaf6; }
.ci.c4 { background: #e0f2f1; }
.ci.c5 { background: var(--yellow-50); }
.ci.c6 { background: #fce4ec; }
.cn { font-size: var(--text-sm); font-weight: var(--fw-semibold); color: var(--text-primary); }
.cds { font-size: var(--text-xs); color: var(--text-tertiary); margin-top: 2px; }

/* ══════════════════════════════════════════════════════════════
   TABS NAV
   ══════════════════════════════════════════════════════════════ */
.tn {
  background: var(--surface);
  display: none;
  border-bottom: 1px solid var(--border);
  padding: 0 var(--s5);
  overflow-x: auto;
  box-shadow: var(--shadow-xs);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  max-width: 100%;
  box-sizing: border-box;
}
.tn::-webkit-scrollbar { display: none; }
.tn.s { display: flex; }

.tb {
  padding: 0 var(--s3);
  height: 48px;
  font: var(--fw-medium) var(--text-sm)/1 var(--font);
  color: var(--text-secondary);
  background: none;
  border: none;
  cursor: pointer;
  position: relative;
  white-space: nowrap;
  transition: color var(--tr-fast);
  letter-spacing: -.01em;
  display: flex;
  align-items: center;
  gap: var(--s1);
}
.tb:hover { color: var(--text-primary); }
.tb.a { color: var(--brand); font-weight: var(--fw-semibold); }
.tb.a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: var(--s2); right: var(--s2);
  height: 2px;
  background: var(--brand);
  border-radius: 2px 2px 0 0;
}
.tb:active { opacity: .7; }
.tc {
  background: var(--brand-mid);
  color: var(--brand);
  font-size: 10px;
  font-weight: var(--fw-bold);
  padding: 2px 6px;
  border-radius: var(--radius-full);
  line-height: 1;
}

/* ══════════════════════════════════════════════════════════════
   MAIN CONTENT
   ══════════════════════════════════════════════════════════════ */
.mn {
  padding: var(--s4) 0;
  max-width: 1200px;
  margin: 0 auto;
  display: none;
  box-sizing: border-box;
  width: 100%;
  overflow-x: hidden;
}
.mn.s { display: block; }
.tp { display: none; animation: pageIn .25s var(--ease); }
.tp.a { display: block; padding: 0 var(--s5); box-sizing: border-box; }


/* ══════════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════════ */
@media(max-width:768px) {
  .hdr { padding: 0 var(--s4); height: 52px; }
  .hdr-logo { height: 30px; }
  .land { padding: var(--s4) var(--s3) var(--s7); }
  .land-h { margin-bottom: var(--s5); }
  .land-h h1 { font-size: var(--text-xl); }
  .la { grid-template-columns: repeat(2, 1fr); gap: var(--s2); }
  .ai2 { width: 36px; height: 36px; font-size: 16px; }
  .at2 { font-size: var(--text-xs); }
  .mn { padding: var(--s2) 0; }
  .tp.a { padding: 0 var(--s3); }
  .tb { padding: 0 var(--s2); height: 44px; font-size: var(--text-xs); }
}
@media(max-width:480px) {
  .la { grid-template-columns: 1fr 1fr; }
  .hdr-t { display: none; }
}
}
