:root {
  --bg: #0a0e16;
  --panel: #10141f;
  --line: rgba(255, 255, 255, 0.08);
  --gold: #c8a35f;
  --txt: #eef1f6;
  --dim: #9aa3b2;
  --gratuit: #7ee2a8;
  --freemium: #c8a35f;
  --payant: #ff9d7a;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background:
    radial-gradient(80% 40% at 70% -10%, rgba(200, 163, 95, 0.08), transparent 60%),
    var(--bg);
  color: var(--txt);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
}
a { color: #ffd9a0; }
button, input, select { font: inherit; }

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: baseline; gap: 10px; }
.brand strong { font-size: 17px; letter-spacing: -0.01em; }
.tag {
  font: 600 10px/1 ui-monospace, Consolas, monospace;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--gold);
  border: 1px solid rgba(200, 163, 95, 0.4);
  border-radius: 999px;
  padding: 5px 9px;
}
.top-actions { display: flex; align-items: center; gap: 8px; }
#q {
  width: 300px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 12px;
  color: var(--txt);
  outline: none;
}
#q:focus { border-color: rgba(200, 163, 95, 0.55); }

.btn {
  padding: 9px 13px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--txt);
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 600;
}
.btn:hover { border-color: rgba(255, 255, 255, 0.3); }
.btn.primary { background: var(--gold); border-color: var(--gold); color: #171203; }
.btn.primary:hover { filter: brightness(1.06); }

.filters {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 12px 22px;
  border-bottom: 1px solid var(--line);
}
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips button {
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--dim);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
}
.chips button:hover { color: var(--txt); }
.chips button.on { background: rgba(200, 163, 95, 0.16); border-color: rgba(200, 163, 95, 0.55); color: #ffd9a0; }
.selects { display: flex; gap: 8px; }
select {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 8px 10px;
  color: var(--txt);
  font-size: 12.5px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 14px;
  padding: 18px 22px 30px;
}
.card {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.012));
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 15px 15px 13px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.card:hover { border-color: rgba(200, 163, 95, 0.45); transform: translateY(-1px); }
.card.fav { border-color: rgba(200, 163, 95, 0.6); box-shadow: 0 0 0 1px rgba(200, 163, 95, 0.2) inset; }
.card-head { display: flex; align-items: center; gap: 8px; }
.card-head h3 { margin: 0; font-size: 15px; letter-spacing: -0.01em; flex: 1; }
.badge {
  font: 700 10px/1 ui-monospace, Consolas, monospace;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 4px 7px;
  border-radius: 999px;
}
.badge.gratuit { background: rgba(126, 226, 168, 0.12); color: var(--gratuit); }
.badge.freemium { background: rgba(200, 163, 95, 0.14); color: var(--freemium); }
.badge.payant { background: rgba(255, 157, 122, 0.12); color: var(--payant); }
.cat {
  font: 600 10px/1 ui-monospace, Consolas, monospace;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dim);
}
.note { margin: 0; font-size: 12.8px; line-height: 1.55; color: #c7cdd8; }
.note.perso { color: #ffd9a0; font-style: italic; }
.tags { display: flex; gap: 5px; flex-wrap: wrap; }
.tags span {
  font: 600 10px/1 ui-monospace, Consolas, monospace;
  color: var(--dim);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 3px 6px;
}
.actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: auto; padding-top: 4px; }
.actions a, .actions button {
  font-size: 11.5px;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--txt);
  text-decoration: none;
  padding: 6px 9px;
  cursor: pointer;
}
.actions a:hover, .actions button:hover { border-color: rgba(255, 255, 255, 0.3); }
.actions .st { color: var(--dim); }
.actions .st.favori { color: #ffd9a0; border-color: rgba(200, 163, 95, 0.55); }
.actions .st.a-scraper { color: #c5a8ff; border-color: rgba(197, 168, 255, 0.4); }
.actions .st.recupere { color: #8fd0ff; border-color: rgba(143, 208, 255, 0.4); }
.actions .st.scrape { color: var(--gratuit); border-color: rgba(126, 226, 168, 0.4); }
.actions .st.integre { color: #6ee7d8; border-color: rgba(110, 231, 216, 0.4); }
.prompt {
  display: none;
  background: rgba(200, 163, 95, 0.07);
  border: 1px dashed rgba(200, 163, 95, 0.4);
  border-radius: 10px;
  padding: 10px;
  font-size: 12px;
  line-height: 1.5;
  color: #f4e3c2;
}
.card.open .prompt { display: block; }
.prompt button {
  margin-top: 7px;
  font-size: 11px;
  padding: 5px 8px;
  border-radius: 7px;
  border: 1px solid rgba(200, 163, 95, 0.5);
  background: transparent;
  color: #ffd9a0;
  cursor: pointer;
}
.edit-note {
  width: 100%;
  min-height: 54px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--txt);
  padding: 8px;
  font-size: 12.5px;
  resize: vertical;
  display: none;
}
.card.editing .edit-note { display: block; }

.modal {
  position: fixed;
  inset: 0;
  background: rgba(4, 6, 10, 0.72);
  display: grid;
  place-items: center;
  z-index: 50;
}
.modal.hidden { display: none; }
.modal-card {
  width: min(520px, 92vw);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
  display: grid;
  gap: 11px;
}
.modal-card h2 { margin: 0 0 4px; font-size: 16px; }
.modal-card label { display: grid; gap: 5px; font-size: 12px; color: var(--dim); }
.modal-card input, .modal-card select {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 9px 10px;
  color: var(--txt);
}
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row.actions { display: flex; justify-content: flex-end; }

.foot {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
  padding: 14px 22px 26px;
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-size: 12px;
}
.foot .perso { opacity: 0.75; }

.hidden { display: none !important; }

.views { display: flex; gap: 4px; background: var(--panel); border: 1px solid var(--line); padding: 4px; border-radius: 11px; }
.views button { border: 0; background: transparent; color: var(--dim); padding: 7px 12px; border-radius: 8px; font-size: 12px; font-weight: 600; cursor: pointer; }
.views button:hover { color: var(--txt); }
.views button.on { background: rgba(200, 163, 95, 0.16); color: #ffd9a0; }

.tablehost { padding: 18px 22px 30px; }
.tablewrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.008));
}
table.liste { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 780px; }
.liste th {
  text-align: left;
  font: 600 10px/1 ui-monospace, Consolas, monospace;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
  padding: 12px 14px;
  border-bottom: 1px solid rgba(200, 163, 95, 0.35);
  background: rgba(16, 20, 31, 0.65);
}
.liste td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.liste tbody tr:hover td { background: rgba(255, 255, 255, 0.02); }
.liste tbody tr:last-child td { border-bottom: 0; }
.nom-cell { display: flex; align-items: center; gap: 9px; white-space: nowrap; }
.nom-lien { color: var(--txt); text-decoration: none; font-weight: 650; font-size: 13.5px; }
.nom-lien:hover { color: #ffd9a0; }
.col-nom { width: 30%; }
.col-cat { width: 17%; color: var(--dim); }
.col-act { width: 53%; }
.actions-cell { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.actions-cell a, .actions-cell button, .det-btn, .dossier-btn {
  font-size: 11.5px;
  font-weight: 600;
  padding: 6px 9px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--txt);
  text-decoration: none;
  cursor: pointer;
}
.actions-cell a:hover, .actions-cell button:hover { border-color: rgba(255, 255, 255, 0.3); }
.details td { background: rgba(200, 163, 95, 0.05); padding: 16px 18px; }
.details .tags { margin-bottom: 9px; }
.details .note { margin: 0 0 10px; }
.dossier-btn { font-family: ui-monospace, Consolas, monospace; color: #ffd9a0; border-style: dashed; border-color: rgba(200, 163, 95, 0.45); }
.col-st, .col-dossier { width: 15%; }
.col-note { width: 26%; }
.col-lien { width: 9%; }
.note-cell { max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #c7cdd8; }
.empty {
  padding: 70px 20px;
  text-align: center;
  color: var(--dim);
  border: 1px dashed var(--line);
  border-radius: 14px;
  font-size: 13.5px;
}
.liste .st { font-size: 11.5px; font-weight: 600; padding: 6px 9px; border-radius: 8px; border: 1px solid var(--line); background: transparent; color: var(--dim); cursor: pointer; }
.liste .st.favori { color: #ffd9a0; border-color: rgba(200, 163, 95, 0.55); }
.liste .st.recupere { color: #8fd0ff; border-color: rgba(143, 208, 255, 0.4); }
.liste .st.scrape { color: var(--gratuit); border-color: rgba(126, 226, 168, 0.4); }
.liste .st.a-scraper { color: #c5a8ff; border-color: rgba(197, 168, 255, 0.4); }
.liste .st.integre { color: #6ee7d8; border-color: rgba(110, 231, 216, 0.4); }
