/* =========================================================
   Leads Platform – Base Theme + Global Components
   Split from app.css
   ========================================================= */

/* =========================
   Theme tokens
   ========================= */
:root{
  /* Brand dark palette */
  --brand-bg:  #0f2a3a;
  --brand-bg2: #143a52;
  --brand-line:#1f5169;

  --brand-text:#ffffff;
  --brand-muted:#b8ccd6;

  /* Dark “glass” surfaces */
  --glass: rgba(255,255,255,0.06);
  --glass-border: rgba(255,255,255,0.14);

  /* Light surfaces (results + drawer) */
  --bg: #f6f7f9;
  --card: #ffffff;
  --text: #0b1f2b;
  --muted: rgba(11,31,43,0.62);
  --border: rgba(15,42,58,0.10);
  --border-strong: rgba(15,42,58,0.14);

  /* Accent */
  --accent: #2aa7c9;          /* teal/cyan */
  --accent-ink: #0f2a3a;

  /* Status colors */
  --danger: #e15555;
  --warn: #ffb547;
  --success: #4bce92;

  /* Radius + shadows */
  --radius-lg: 18px;
  --radius: 14px;
  --radius-sm: 12px;

  --shadow-soft: 0 10px 30px rgba(0,0,0,0.08);
  --shadow:      0 18px 60px rgba(0,0,0,0.22);
}

/* =========================
   Base
   ========================= */
*{ box-sizing: border-box; }

body{
  margin: 0;
  font-family: Arial, sans-serif;
  color: var(--brand-text);
  background:
    radial-gradient(900px 420px at 18% 10%, rgba(31,81,105,0.35), rgba(0,0,0,0)),
    radial-gradient(900px 420px at 82% 0%, rgba(31,81,105,0.25), rgba(0,0,0,0)),
    linear-gradient(180deg, var(--brand-bg2), var(--brand-bg));
}

/* Subtle geometric overlay */
body::before{
  content:"";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(135deg, rgba(255,255,255,0.05) 0, rgba(255,255,255,0.05) 2px, transparent 2px, transparent 180px),
    repeating-linear-gradient(45deg,  rgba(255,255,255,0.035) 0, rgba(255,255,255,0.035) 2px, transparent 2px, transparent 160px);
  opacity: 0.22;
  z-index: 0;
}

.container{
  position: relative;
  z-index: 1;
  max-width: 1120px;
  margin: 0 auto;
  padding: 18px;
}

h1, h2, h3{ margin: 0 0 10px; letter-spacing: 0.2px; }
.small{ font-size: 12px; }
.tiny{ font-size: 12px; margin-top: 10px; }
.muted{ color: var(--brand-muted); }

.mono{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

/* =========================================================
   Topbar (cleaner nav)
   ========================================================= */
.topbar {
  background: #ffffff;
  border-bottom: 1px solid #e6e7ea;
}

.topbar-inner{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 18px;
}

.brand{
  text-decoration: none;
  font-weight: 900;
  letter-spacing: 0.2px;
  color: #0b1f2b;
}

.topnav{
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-link{
  text-decoration: none;
  color: #0b1f2b;
  font-weight: 800;
  font-size: 14px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid transparent;
}

.nav-link:hover{
  background: rgba(42,167,201,0.08);
  border-color: rgba(42,167,201,0.20);
}

.nav-link.is-active{
  background: rgba(42,167,201,0.14);
  border-color: rgba(42,167,201,0.35);
}

.nav-link-danger:hover{
  background: rgba(225,85,85,0.10);
  border-color: rgba(225,85,85,0.25);
}

.nav-divider{
  width: 1px;
  height: 22px;
  background: rgba(11,31,43,0.18);
  margin: 0 2px;
}

.user-chip{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(15,42,58,0.12);
  background: rgba(15,42,58,0.05);
  color: rgba(11,31,43,0.86);
  font-weight: 900;
  font-size: 13px;
  white-space: nowrap;
}

.user-dot{
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(75,206,146,0.95);
  box-shadow: 0 0 0 3px rgba(75,206,146,0.18);
}

/* Responsive: stack brand and nav cleanly */
@media (max-width: 720px){
  .topbar-inner{
    flex-direction: column;
    align-items: stretch;
  }
  .topnav{
    justify-content: flex-start;
  }
}

/* =========================
   Cards (generic)
   ========================= */
.card{
  border-radius: var(--radius-lg);
  padding: 16px;
  margin: 14px 0;
}

.card-dark{
  background: var(--glass);
  border: 1px solid var(--glass-border);
  box-shadow: 0 10px 40px rgba(0,0,0,0.14);
}

.card-light{
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  box-shadow: var(--shadow-soft);
}
.card-light .muted{ color: var(--muted); }

/* =========================
   Forms (dark surface)
   ========================= */
label{
  display: block;
  margin: 10px 0 6px;
  font-weight: 900;
  letter-spacing: 0.2px;
}

input, select, textarea{
  width: 100%;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: rgba(255,255,255,0.10);
  color: var(--brand-text);
  outline: none;
}

input::placeholder, textarea::placeholder{
  color: rgba(184,204,214,0.85);
}

select option{ color: #111; }

input:focus, select:focus, textarea:focus{
  border-color: rgba(255,255,255,0.35);
  box-shadow: 0 0 0 4px rgba(31,81,105,0.25);
}

input[type="checkbox"]{
  width: auto;
  padding: 0;
  margin: 0;
}

/* =========================
   Buttons (global)
   ========================= */
.btn{
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  line-height: 1;
  white-space: nowrap;
  font-weight: 900;
  letter-spacing: 0.2px;
  transition: transform 140ms ease, opacity 140ms ease, box-shadow 140ms ease;
}

.btn:hover{ opacity: 0.94; }
.btn:active{ transform: translateY(1px); }

.btn-secondary{
  background: transparent;
  color: var(--brand-text);
  border: 1px solid var(--glass-border);
}

.btn-primary{
  background: #ffffff;
  color: var(--accent-ink);
  border: 1px solid rgba(255,255,255,0.25);
}

/* CTA ultra visible (Réclamer) */
.btn-claim{
  background: var(--accent);
  color: #fff;
  border: 1px solid rgba(0,0,0,0);
  box-shadow: 0 14px 30px rgba(42,167,201,0.22);
}
.btn-claim:hover{ opacity: 0.96; box-shadow: 0 18px 40px rgba(42,167,201,0.26); }

/* “Non merci” */
.btn-dismiss{
  background: rgba(15,42,58,0.06);
  border: 1px solid rgba(15,42,58,0.12);
  color: var(--accent-ink);
  box-shadow: none;
}
.btn-dismiss:hover{ background: rgba(15,42,58,0.10); opacity: 1; }

/* Small button variant */
.btn-sm{
  padding: 9px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

/* Normalize plain <button> */
button{ font: inherit; }

/* =========================
   Flash messages
   ========================= */
.flash-wrap{ margin: 10px 0; }
.flash{
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}
.flash-success{
  background: rgba(232,246,238,0.92);
  border: 1px solid rgba(75,206,146,0.35);
  color: #0b3b1d;
}
.flash-danger{
  background: rgba(253,236,236,0.92);
  border: 1px solid rgba(225,85,85,0.35);
  color: #5b1111;
}

/* =========================
   Page head
   ========================= */
.page-head{
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 10px 0 18px;
}
.page-head h1{ margin: 0; }
.page-head-actions{ display: flex; gap: 10px; }

/* =========================
   Filters (dark card)
   ========================= */
.filters{
  display: grid;
  grid-template-columns: 1.3fr 0.8fr 0.8fr 0.8fr 0.7fr auto;
  gap: 14px;
  align-items: end;
}

.field label{
  margin: 0 0 6px;
  font-weight: 900;
}

.filters-actions{
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  align-items: center;
}

/* Appliquer button: consistent sizing, not circular */
.filters-actions .btn{ min-width: 120px; }

/* Toggle pill */
.toggle{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.20);
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.92);
  font-weight: 800;
  white-space: nowrap;
}

.toggle input{
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  transform: translateY(1px);
}

.toggle:hover{
  background: rgba(255,255,255,0.10);
}

/* =========================
   Results header helper
   ========================= */
.table-head{
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 12px;
}

/* =========================
   Responsive (global)
   ========================= */
@media (max-width: 980px){
  .filters{ grid-template-columns: 1fr 1fr; }
  .filters-actions{
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}

@media (max-width: 860px){
  .page-head{
    flex-direction: column;
    align-items: flex-start;
  }
  .table-head{
    flex-direction: column;
    align-items: flex-start;
  }
}

.user-chip{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.7);
  border: 1px solid #e6e7ea;
}

.user-avatar{
  width: 28px;
  height: 28px;
  border-radius: 999px;
  object-fit: cover;
  display: inline-block;
  border: 1px solid #e6e7ea;
  background: #fff;
}

.user-avatar--empty{
  /* rond blanc si pas d'image */
  background: #fff;
}

.user-name{
  line-height: 1;
  font-weight: 600;
  color: #111;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
