/* Styles partagés du panel admin (toutes les pages + login). */
:root { --primary: #33526e; --bg: #f4f6f8; --border: #dde4ea; }
* { box-sizing: border-box; }
body { font-family: system-ui, sans-serif; margin: 0; background: var(--bg); color: #1d2b38; }
.wrap { max-width: 860px; margin: 0 auto; padding: 2rem 1.25rem; }
h1 { font-size: 1.6rem; }
h1 span { color: var(--primary); }
form { display: flex; flex-wrap: wrap; gap: 0.75rem; background: #fff; padding: 1.25rem;
       border: 1px solid var(--border); border-radius: 10px; }
input[type="url"] { flex: 1 1 320px; padding: 0.7em 0.9em; border: 1px solid var(--border);
                    border-radius: 6px; font-size: 1rem; }
select { padding: 0.7em; border: 1px solid var(--border); border-radius: 6px; }
button { padding: 0.7em 1.6em; background: var(--primary); color: #fff; border: none;
         border-radius: 6px; font-size: 1rem; font-weight: 600; cursor: pointer; }
button:disabled { opacity: 0.5; cursor: default; }
label.check { display: flex; align-items: center; gap: 0.4rem; font-size: 0.9rem; color: #5a6b7a; }
#panel { display: none; margin-top: 1.5rem; }
#logs, #hunt-logs, #sweep-logs { background: #14181d; color: #c9d4de; padding: 1rem; border-radius: 10px; font-family: ui-monospace, monospace;
        font-size: 0.82rem; white-space: pre-wrap; max-height: 420px; overflow-y: auto; }
#hunt-logs, #sweep-logs { max-height: 260px; }
#result { margin-top: 1rem; display: none; gap: 0.75rem; }
#result a { display: inline-block; padding: 0.7em 1.4em; border-radius: 6px; text-decoration: none;
            font-weight: 600; margin-right: 0.75rem; }
#result .preview { background: var(--primary); color: #fff; }
#result .edit { border: 2px solid var(--primary); color: var(--primary); }
#result .save { border: 2px solid var(--primary); background: #fff; color: var(--primary);
                margin-right: 0.75rem; }
#hint { color: #5a6b7a; font-size: 0.9rem; margin: 0.9rem 0 0; }
#cost { color: #5a6b7a; font-size: 0.9rem; margin-top: 0.5rem; }
#error { display: none; margin-top: 1rem; padding: 1rem; background: #fdecea; color: #90322c;
         border-radius: 8px; border: 1px solid #f2c4c0; }
.status { font-size: 0.9rem; color: #5a6b7a; margin: 0.8rem 0 0.4rem; }
.deploy-form { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; margin-top: 1rem; }
.deploy-form input[type="text"] { flex: 1 1 220px; padding: 0.6em 0.8em; border: 1px solid var(--border);
                                  border-radius: 6px; font-size: 0.95rem; }
.deploy-msg { flex-basis: 100%; font-size: 0.9rem; color: #5a6b7a; margin: 0; }
.deploy-msg a { color: var(--primary); font-weight: 600; }
.deploy-msg.err { color: #90322c; }
h2 { font-size: 1.15rem; margin: 2.2rem 0 0.8rem; }
#sites-list { display: flex; flex-direction: column; gap: 0.6rem; }
.site-row { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; align-items: center; background: #fff;
            padding: 0.85rem 1.1rem; border: 1px solid var(--border); border-radius: 10px; }
.site-row a.domain { font-weight: 700; color: var(--primary); text-decoration: none; }
.site-row .meta { font-size: 0.82rem; color: #5a6b7a; }
.site-row .spacer { flex: 1; }
.btn-sm { padding: 0.45em 0.9em; font-size: 0.85rem; }
.btn-outline { background: #fff; color: var(--primary); border: 2px solid var(--primary); }
#sites-empty, #library-empty { color: #5a6b7a; font-size: 0.9rem; }
#library-list { display: flex; flex-direction: column; gap: 0.6rem; }
#deploy-hint { color: #5a6b7a; font-size: 0.9rem; margin-top: 1rem; }
#deploy-hint a { color: var(--primary); font-weight: 600; }
#hunt-form input[type="text"] { flex: 1 1 200px; padding: 0.7em 0.9em; border: 1px solid var(--border);
                                border-radius: 6px; font-size: 1rem; }
#hunt-panel { display: none; margin-top: 1rem; }
.prospect-filter { display: flex; align-items: center; gap: 0.45rem; color: #5a6b7a;
                   font-size: 0.9rem; cursor: pointer; margin-bottom: 0.7rem; user-select: none; }
.prospect-filter input { cursor: pointer; }
#prospects-empty { color: #5a6b7a; font-size: 0.9rem; }
#prospects-list { display: flex; flex-direction: column; gap: 0.6rem; }
.prospect { background: #fff; border: 1px solid var(--border); border-radius: 10px;
            padding: 0.85rem 1.1rem; display: flex; flex-direction: column; gap: 0.45rem; }
.prospect .head { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; align-items: center; }
.prospect a.domain { font-weight: 700; color: var(--primary); text-decoration: none; }
.score-badge { color: #fff; background: var(--primary); font-size: 0.78rem; font-weight: 700;
               border-radius: 999px; padding: 0.15em 0.75em; }
.score-badge.warn { background: #c87f0a; }
.score-badge.bad { background: #c0392b; }
.chips { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.signal-chip { background: #eef2f5; color: #5a6b7a; font-size: 0.75rem; border-radius: 999px;
               padding: 0.15em 0.7em; }
.prospect iframe { width: 100%; height: 380px; border: 1px solid var(--border); border-radius: 8px; }
.prospect .iframe-hint { font-size: 0.8rem; color: #5a6b7a; margin: 0; }
.naf-dd { position: relative; flex: 1 1 210px; }
.naf-dd summary { list-style: none; cursor: pointer; padding: 0.7em 0.9em; border: 1px solid var(--border);
                  border-radius: 6px; background: #fff; font-size: 1rem; user-select: none; }
.naf-dd summary::-webkit-details-marker { display: none; }
.naf-dd summary::after { content: " ▾"; color: #5a6b7a; }
.naf-panel { position: absolute; z-index: 10; top: calc(100% + 4px); left: 0; min-width: 330px;
             max-height: 300px; overflow-y: auto; background: #fff; border: 1px solid var(--border);
             border-radius: 8px; box-shadow: 0 8px 24px rgba(20, 40, 60, 0.15); padding: 0.5rem; }
.naf-panel label { display: flex; gap: 0.5rem; align-items: baseline; padding: 0.3em 0.4em;
                   border-radius: 6px; font-size: 0.88rem; cursor: pointer; }
.naf-panel label:hover { background: var(--bg); }
.naf-panel .code { font-family: ui-monospace, monospace; color: var(--primary); font-weight: 600;
                   white-space: nowrap; }
#hunt-cancel { display: none; margin-bottom: 0.6rem; }
#sweep-panel { display: none; margin-top: 1rem; }
#sweep-cancel, #sweep-resume { display: none; margin-bottom: 0.6rem; }
#sweep-form input[type="number"] { flex: 0 1 130px; padding: 0.7em 0.9em; border: 1px solid var(--border);
                                   border-radius: 6px; font-size: 1rem; }
.hint-text { color: #5a6b7a; font-size: 0.9rem; margin: 0.2rem 0 0.8rem; }
#sweep-hint { flex-basis: 100%; margin: 0; }
#gens-empty { color: #5a6b7a; font-size: 0.9rem; }
#gens-list { display: flex; flex-direction: column; gap: 0.6rem; }
.gen-actions { display: flex; gap: 0.4rem; }

/* --- Barre de navigation (onglets) ------------------------------------------ */
#nav { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem; margin-bottom: 1.6rem;
       background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 0.45rem 0.7rem; }
#nav .brand { font-weight: 700; color: var(--primary); text-decoration: none; margin-right: 0.7rem;
              font-size: 1.05rem; }
#nav a.tab { padding: 0.45em 0.95em; border-radius: 6px; text-decoration: none; color: #5a6b7a;
             font-weight: 600; font-size: 0.92rem; }
#nav a.tab:hover { background: var(--bg); }
#nav a.tab.active { background: var(--primary); color: #fff; }
#nav a.tab .nav-badge { margin-left: 0.4em; }
#nav .spacer { flex: 1; }
.nav-badge { display: inline-block; min-width: 1.3em; text-align: center; background: #c0392b;
             color: #fff; font-size: 0.72rem; font-weight: 700; line-height: 1.3em; border-radius: 999px;
             padding: 0 0.4em; }

/* --- Page Messages ----------------------------------------------------------- */
#inbox-empty { color: #5a6b7a; font-size: 0.9rem; }
#inbox-list { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 1.5rem; }
.inbox-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 0.9rem; text-align: left;
             background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 0.8rem 1.1rem;
             cursor: pointer; color: inherit; font: inherit; }
.inbox-row:hover { border-color: var(--primary); }
.inbox-row.active { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary) inset; }
.inbox-row .inbox-domain { font-weight: 700; color: var(--primary); }
.inbox-row .inbox-meta { font-size: 0.82rem; color: #5a6b7a; flex: 1; }
#thread { display: flex; flex-direction: column; gap: 0.7rem; }
.msg { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 1rem 1.2rem; }
.msg.unread { border-left: 4px solid var(--primary); background: #f7fafc; cursor: pointer; }
.msg-head { display: flex; flex-wrap: wrap; gap: 0.3rem 1rem; align-items: baseline; }
.msg-from { font-weight: 700; }
.msg.unread .msg-from::before { content: "● "; color: var(--primary); font-size: 0.7em; vertical-align: middle; }
.msg-when { font-size: 0.8rem; color: #5a6b7a; margin-left: auto; }
.msg-body { white-space: pre-wrap; margin: 0.6rem 0; line-height: 1.5; }
.msg-meta { font-size: 0.85rem; color: #5a6b7a; margin: 0 0 0.7rem; }
.msg-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.msg-actions a { text-decoration: none; }
#nav form { display: inline; background: none; border: none; padding: 0; margin: 0; }
#nav .logout { background: none; border: none; color: #5a6b7a; font-size: 0.85rem; font-weight: 600;
               padding: 0.45em 0.6em; }
#nav .logout:hover { color: #90322c; }

/* --- Page Comptes ------------------------------------------------------------ */
#accounts-list { display: flex; flex-direction: column; gap: 0.8rem; margin-top: 1.5rem; }
#accounts-empty { color: #5a6b7a; font-size: 0.9rem; }
.account { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 1rem 1.15rem; }
.account .acc-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.8rem; }
.account .acc-name { font-weight: 700; font-size: 1.02rem; }
.account .acc-name.off { color: #97a4b0; text-decoration: line-through; }
.role-badge { font-size: 0.72rem; font-weight: 700; border-radius: 999px; padding: 0.15em 0.7em;
              text-transform: uppercase; letter-spacing: 0.03em; }
.role-badge.admin { background: #33526e; color: #fff; }
.role-badge.client { background: #eef2f5; color: #5a6b7a; }
.account .acc-meta { font-size: 0.8rem; color: #5a6b7a; }
.account .acc-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-left: auto; }
.account .grants { margin-top: 0.9rem; border-top: 1px solid var(--border); padding-top: 0.8rem; }
.account .grants h4 { margin: 0 0 0.5rem; font-size: 0.78rem; text-transform: uppercase;
                      letter-spacing: 0.04em; color: #5a6b7a; }
.grant-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 0.35rem 0.9rem; }
.grant-opt { display: flex; align-items: center; gap: 0.5rem; font-size: 0.9rem; cursor: pointer;
             padding: 0.25em 0.1em; }
.grant-opt input { width: 1.05em; height: 1.05em; cursor: pointer; }
.grant-opt .g-online { font-size: 0.72rem; color: #1e6b3a; }
.grants-none { font-size: 0.85rem; color: #97a4b0; }
#create-account { margin-top: 0.4rem; }
#create-account input[type="text"], #create-account input[type="password"] {
  flex: 1 1 180px; padding: 0.7em 0.9em; border: 1px solid var(--border); border-radius: 6px; font-size: 1rem; }
#account-msg { flex-basis: 100%; margin: 0; font-size: 0.9rem; color: #90322c; }

/* --- Espace client (dashboard) ----------------------------------------------- */
#my-sites-list { display: flex; flex-direction: column; gap: 0.6rem; }
#my-sites-empty { color: #5a6b7a; font-size: 0.9rem; }

/* --- Page de connexion ------------------------------------------------------- */
.login-card { max-width: 380px; margin: 14vh auto 0; background: #fff; border: 1px solid var(--border);
              border-radius: 10px; padding: 2rem 2rem 1.6rem; }
.login-card h1 { margin: 0 0 1.2rem; text-align: center; }
.login-card form { flex-direction: column; align-items: stretch; background: none; border: none;
                   padding: 0; }
.login-card input { padding: 0.7em 0.9em; border: 1px solid var(--border); border-radius: 6px;
                    font-size: 1rem; }
.login-error { display: none; padding: 0.8rem 1rem; background: #fdecea; color: #90322c;
               border-radius: 8px; border: 1px solid #f2c4c0; font-size: 0.9rem; margin-bottom: 0.75rem; }
