@import url('https://fonts.googleapis.com/css2?family=Sora:wght@400;600;700&family=Inter:wght@400;500&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #000;
  --card: #161b22;
  --border: #30363d;
  --cyan: #00c8f0;
  --cyan-dim: #0099b8;
  --text: #e6edf3;
  --text-dim: #8b949e;
  --danger: #f85149;
  --success: #3fb950;
  --warn: #d29922;
}

body { background: var(--bg); color: var(--text); font-family: 'Inter', sans-serif; min-height: 100vh; }

h1, h2, h3, h4 { font-family: 'Sora', sans-serif; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.55rem 1.2rem;
  border-radius: 8px; border: none; cursor: pointer;
  font-family: 'Inter', sans-serif; font-size: 0.9rem; font-weight: 500;
  transition: opacity .15s, transform .1s;
}
.btn:hover { opacity: .85; }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--cyan); color: #000; }
.btn-danger  { background: var(--danger); color: #fff; }
.btn-ghost   { background: transparent; color: var(--text-dim); border: 1px solid var(--border); }

input, select, textarea {
  background: #0d1117; color: var(--text);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 0.55rem 0.9rem; font-size: 1rem; font-family: 'Inter', sans-serif;
  width: 100%; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--cyan); }

label { display: block; font-size: 0.85rem; color: var(--text-dim); margin-bottom: 0.3rem; }

.field { margin-bottom: 1rem; }

.badge {
  display: inline-block; padding: 0.2em 0.6em;
  border-radius: 20px; font-size: 0.75rem; font-weight: 500;
}
.badge-success { background: #1a3a1a; color: var(--success); }
.badge-warn    { background: #3a2e1a; color: var(--warn); }
.badge-danger  { background: #3a1a1a; color: var(--danger); }
.badge-info    { background: #0d2a30; color: var(--cyan); }

.info-box {
  background: #0d1117; border-left: 3px solid var(--cyan);
  border-radius: 0 8px 8px 0; padding: 0.9rem 1.1rem;
  font-size: 0.88rem; color: var(--text-dim); margin-bottom: 1.5rem;
}

.tooltip-wrap { position: relative; display: inline-flex; align-items: center; gap: .35rem; }
.tooltip-icon { color: var(--text-dim); cursor: help; font-size: 0.85rem; }
.tooltip-icon:hover + .tooltip-text { display: block; }
.tooltip-text {
  display: none; position: absolute; left: 1.5rem; top: -0.5rem; z-index: 100;
  background: #21262d; border: 1px solid var(--border);
  border-radius: 8px; padding: .6rem .9rem; font-size: .8rem;
  width: 260px; color: var(--text); line-height: 1.5;
  box-shadow: 0 4px 20px rgba(0,0,0,.5);
}

table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th { background: #0d1117; color: var(--cyan); padding: .6rem 1rem; text-align: left; border-bottom: 1px solid var(--border); }
td { padding: .55rem 1rem; border-bottom: 1px solid #21262d; }
tr:hover td { background: #0d1117; }

/* Colonne Actions épinglée à droite : reste visible même quand le tableau
   déborde horizontalement (tableaux à nombreuses colonnes type Prospects). */
th.col-actions, td.col-actions { position: sticky; right: 0; box-shadow: -10px 0 10px -8px rgba(0,0,0,.55); }
th.col-actions { background: #0d1117; z-index: 3; }
td.col-actions { background: var(--card); z-index: 1; }
tr:hover td.col-actions { background: #0d1117; }

/* ── Texte secondaire / icônes de contact ─────────────────────── */
.muted-sub { color: var(--text-dim); font-size: .78rem; }
.row-tags { display: flex; flex-wrap: wrap; gap: .25rem; margin-top: .35rem; }
.row-tags .badge { font-size: .68rem; padding: .1rem .4rem; }
.contact-icons { display: flex; gap: .5rem; font-size: 1rem; }
.contact-icons .ci { text-decoration: none; }

/* ── Boutons d'action par ligne (icône + libellé) ─────────────── */
.row-actions { display: flex; gap: .35rem; flex-wrap: wrap; align-items: center; }
.act-btn { display: inline-flex; align-items: center; gap: .3rem; font-size: .76rem; padding: .3rem .55rem; line-height: 1.1; white-space: nowrap; }
.act-btn .act-ico { font-size: .85rem; }
.act-badge { align-self: center; }

/* ── Barre de cases à cocher des filtres (répartie) ───────────── */
.filter-toggles { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; margin-top: .85rem; }
.filter-toggles .chk { display: flex; align-items: center; gap: .4rem; font-size: .85rem; color: var(--text-dim); cursor: pointer; flex: 0 0 auto; white-space: nowrap; }
.filter-toggles .btn { margin-left: auto; }

/* ── Timeline d'activité ──────────────────────────────────────── */
.act-item { border: 1px solid var(--border); border-radius: 8px; padding: .6rem .75rem; margin-bottom: .6rem; background: #0d1117; }
.act-item-head { display: flex; align-items: center; gap: .6rem; margin-bottom: .25rem; }
.act-item-type { font-size: .82rem; font-weight: 600; color: var(--cyan); }
.act-date { font-size: .76rem; color: var(--text-dim); margin-left: auto; }
.act-del { background: none; border: none; color: var(--danger); cursor: pointer; font-size: .8rem; padding: 0 .2rem; }
.act-item-body { font-size: .88rem; white-space: pre-wrap; word-break: break-word; }

/* ── Website Creator (pleine largeur, 3 colonnes) ─────────────── */
.page.wc-page { max-width: none; padding: 1.5rem 2rem; }
.wc-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; align-items: start; }
.wc-col { display: flex; flex-direction: column; min-height: 200px; }
.wc-h { font-size: 1rem; margin: 0 0 .6rem; display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.wc-search { width: 100%; margin-bottom: .6rem; }
.wc-list { display: flex; flex-direction: column; gap: .5rem; max-height: 70vh; overflow: auto; }
.wc-item { display: flex; align-items: flex-start; justify-content: space-between; gap: .6rem; padding: .55rem .65rem; border: 1px solid var(--border); border-radius: 8px; background: #0d1117; }
.wc-item-main { min-width: 0; flex: 1; }
.wc-item-main strong { display: block; font-size: .88rem; white-space: normal; overflow-wrap: anywhere; line-height: 1.25; }
.wc-item-actions { display: flex; gap: .3rem; flex-wrap: wrap; justify-content: flex-end; flex-shrink: 0; }
.wc-variants { display: flex; gap: .25rem; flex-wrap: wrap; margin-top: .2rem; }
.wc-mini { font-size: .74rem; padding: .28rem .5rem; white-space: nowrap; text-decoration: none; }
.wc-cat-head { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--cyan); font-weight: 700; margin: .5rem 0 .1rem; padding-left: .2rem; }
.tpl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.tpl-card { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: #0d1117; }
.tpl-prev-wrap { position: relative; aspect-ratio: 1 / 1; overflow: hidden; background: #fff; }
.tpl-prev { width: 100%; height: 1400px; border: none; display: block; background: #fff; pointer-events: none; transform: translateY(0); transition: transform 6s ease; }
.tpl-prev-wrap:hover .tpl-prev { transform: translateY(-72%); }   /* défile vers le bas au survol */
.tpl-noprev { height: 100%; display: flex; align-items: center; justify-content: center; color: var(--text-dim); font-size: .8rem; background: #0d1117; transform: none; }
.tpl-overlay { position: absolute; inset: 0; display: flex; gap: .5rem; align-items: center; justify-content: center; background: rgba(13,17,23,.55); opacity: 0; transition: opacity .15s; }
.tpl-prev-wrap:hover .tpl-overlay { opacity: 1; }
.tpl-overlay .btn { pointer-events: auto; }
.tpl-card-info { display: flex; align-items: center; justify-content: center; padding: .35rem .5rem; }
.tpl-card-name { font-size: .8rem; font-weight: 600; }
.wc-cat-head:first-child { margin-top: 0; }
.wc-tabs { display: flex; gap: .5rem; border-bottom: 1px solid var(--border); margin-bottom: .6rem; }
.wc-tab { padding: .45rem 1rem; background: none; border: none; border-bottom: 2px solid transparent; color: var(--text-dim); cursor: pointer; font-family: inherit; font-size: .85rem; }
.wc-tab-on { color: var(--cyan); border-bottom-color: var(--cyan); font-weight: 600; }

/* Onglets mobile (cachés sur desktop) */
.wc-mtabs { display: none; gap: .5rem; margin-bottom: 1rem; }
.wc-mtab { flex: 1; padding: .55rem; background: var(--card); border: 1px solid var(--border); border-radius: 8px; color: var(--text-dim); cursor: pointer; font-family: inherit; font-size: .85rem; }
.wc-mtab-on { color: #06121a; background: var(--cyan); border-color: var(--cyan); font-weight: 600; }

@media (max-width: 900px) {
  .wc-page { padding: 1rem; }
  .wc-mtabs { display: flex; }
  .wc-grid { grid-template-columns: 1fr; }
  .wc-grid[data-m="prospects"] .col-sites,
  .wc-grid[data-m="prospects"] .col-templates,
  .wc-grid[data-m="sites"] .col-prospects,
  .wc-grid[data-m="sites"] .col-templates,
  .wc-grid[data-m="templates"] .col-prospects,
  .wc-grid[data-m="templates"] .col-sites { display: none; }
  .wc-list { max-height: none; }
  .wc-item { flex-direction: column; align-items: stretch; }
  .wc-item-actions { justify-content: flex-start; }
}

/* ── Onglet Scrapper ──────────────────────────────────────────── */
.scr-chip { display: inline-flex; align-items: center; gap: .4rem; background: #0d1117; border: 1px solid var(--border); border-radius: 999px; padding: .25rem .6rem; font-size: .82rem; }
.scr-chip button { background: none; border: none; color: var(--danger); cursor: pointer; font-size: .8rem; padding: 0; line-height: 1; }
.scr-add { font-size: .78rem; padding: .25rem .6rem; }

/* ── Responsive : lignes -> cartes sur mobile ─────────────────── */
@media (max-width: 640px) {
  .resp-table thead { display: none; }
  .resp-table, .resp-table tbody, .resp-table tr, .resp-table td { display: block; width: 100%; }
  .resp-table tr { border: 1px solid var(--border); border-radius: 10px; margin: 0 .25rem .75rem; padding: .4rem .6rem; }
  .resp-table td { border: none; padding: .35rem 0; display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; text-align: right; }
  .resp-table td::before { content: attr(data-label); color: var(--text-dim); font-size: .78rem; font-weight: 600; text-align: left; flex: 0 0 auto; }
  .resp-table td.col-actions { position: static; box-shadow: none; display: block; }
  .resp-table td.col-actions::before { display: block; margin-bottom: .4rem; }
  .resp-table .row-actions { justify-content: flex-start; }
  .resp-table .act-btn { flex: 1 1 auto; justify-content: center; }
}

/* ── Topbar ─────────────────────────────────────────────────── */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; height: 56px; z-index: 100;
  background: var(--card); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 1rem; padding: 0 1.25rem;
}
.topbar-brand { font-family: 'Sora', sans-serif; color: var(--cyan); font-weight: 700; font-size: 1.1rem; text-decoration: none; flex: 1; }
.hamburger { display: none; background: none; border: none; color: var(--text); font-size: 1.4rem; cursor: pointer; padding: 0 .25rem; line-height: 1; }

/* ── Sidebar ────────────────────────────────────────────────── */
.sidebar {
  position: fixed; top: 56px; left: 0; bottom: 0; width: 240px; z-index: 90;
  background: var(--card); border-right: 1px solid var(--border);
  overflow-y: auto; padding: 1rem .75rem 2rem; display: flex; flex-direction: column; gap: .35rem;
}
.nav-group { display: flex; flex-direction: column; gap: .1rem; margin-top: .9rem; }
.nav-group-title {
  font-size: .68rem; text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-dim); font-weight: 600; padding: .3rem .75rem .25rem;
}
.nav-group-bottom { margin-top: auto; border-top: 1px solid var(--border); padding-top: .75rem; }
.nav-link {
  color: var(--text-dim); text-decoration: none; padding: .5rem .75rem;
  border-radius: 7px; font-size: .875rem; transition: background .15s, color .15s;
  display: block;
}
.nav-link:hover { background: #21262d; color: var(--text); }
.nav-link.active { background: #0d2a30; color: var(--cyan); font-weight: 500; }
.nav-top { font-weight: 500; }

.sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 80; }
.sidebar-backdrop.open { display: block; }

/* ── Content ────────────────────────────────────────────────── */
.content { margin-left: 240px; margin-top: 56px; min-height: calc(100vh - 56px); }

@media (max-width: 820px) {
  .hamburger { display: block; }
  .sidebar { transform: translateX(-100%); transition: transform .25s ease; }
  .sidebar.open { transform: translateX(0); }
  .content { margin-left: 0; }
}

.page { max-width: 960px; margin: 0 auto; padding: 2rem 1.5rem; }
.page-title { font-family: 'Sora', sans-serif; font-size: 1.4rem; margin-bottom: .5rem; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat-card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 1.25rem; }
.stat-label { font-size: .8rem; color: var(--text-dim); margin-bottom: .3rem; }
.stat-value { font-family: 'Sora', sans-serif; font-size: 1.6rem; color: var(--cyan); }
.stat-sub { font-size: .78rem; color: var(--text-dim); margin-top: .2rem; }

.progress-bar { height: 8px; background: #21262d; border-radius: 4px; overflow: hidden; margin-top: .5rem; }
.progress-fill { height: 100%; border-radius: 4px; background: var(--cyan); transition: width .3s; }
.progress-fill.warn { background: var(--warn); }
.progress-fill.danger { background: var(--danger); }

.alert { padding: .75rem 1rem; border-radius: 8px; font-size: .875rem; margin-bottom: 1rem; }
.alert-warn { background: #3a2e1a; border: 1px solid var(--warn); color: var(--warn); }
.alert-danger { background: #3a1a1a; border: 1px solid var(--danger); color: var(--danger); }

.modal-overlay { display:none; position:fixed; inset:0; background:rgba(0,0,0,.7); z-index:200; align-items:center; justify-content:center; }
.modal-overlay.open { display:flex; }
.modal { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 1.75rem; width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto; }
.modal-title { font-family: 'Sora', sans-serif; font-size: 1.1rem; margin-bottom: 1.25rem; }
.modal-actions { display: flex; gap: .75rem; justify-content: flex-end; margin-top: 1.25rem; }

/* Page Mes projets */
.proj-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:.7rem}
.proj-card{display:flex;flex-direction:column;gap:.2rem;padding:.8rem .9rem;border:1px solid var(--border);border-radius:10px;background:var(--card);text-decoration:none;color:var(--ink);transition:border-color .15s}
.proj-card:hover{border-color:var(--cyan)}
.proj-nom{font-weight:600;font-size:.9rem}
.proj-url{color:var(--text-dim);font-size:.76rem}

.wizard-overlay { position: fixed; inset: 0; z-index: 1000; background: var(--bg, #0d1117);
  display: flex; align-items: flex-start; justify-content: center; overflow-y: auto; padding: 3rem 1rem; }
.wizard-card { width: 100%; max-width: 560px; background: var(--card, #161b22);
  border: 1px solid var(--border, #30363d); border-radius: 14px; padding: 2rem; }
.wizard-progress { color: var(--cyan, #39d0d8); font-size: .8rem; margin-bottom: .4rem; }
.wizard-card h2 { margin: 0 0 1.2rem; }
.wizard-fields .field { margin-bottom: 1rem; }
.wizard-fields label { display: block; margin-bottom: .3rem; font-size: .85rem; }
.wizard-fields input, .wizard-fields select { width: 100%; padding: .6rem .75rem;
  background: var(--bg, #0d1117); border: 1px solid var(--border, #30363d);
  border-radius: 8px; color: inherit; font-family: inherit; }
.wizard-actions { display: flex; justify-content: space-between; margin-top: 1.5rem; }
.wizard-group-title { font-size: .8rem; font-weight: 600; color: var(--cyan, #39d0d8);
  margin: 1.3rem 0 .6rem; padding-top: .9rem; border-top: 1px solid var(--border, #30363d); }
.wizard-group-title:first-child { margin-top: 0; padding-top: 0; border-top: none; }

.tour-pop { position: fixed; z-index: 1100; max-width: 280px; background: var(--card, #161b22);
  border: 1px solid var(--cyan, #39d0d8); border-radius: 10px; padding: 1rem; box-shadow: 0 8px 30px rgba(0,0,0,.5); }
.tour-title { font-weight: 600; margin-bottom: .35rem; }
.tour-text { font-size: .85rem; color: var(--text-dim, #8b949e); margin-bottom: .8rem; }
.tour-actions { display: flex; justify-content: space-between; gap: .5rem; }
.tour-highlight { outline: 2px solid var(--cyan, #39d0d8); border-radius: 6px; }
