@charset "UTF-8";

/* ═══════════════════════════════════════════════════════════════════════════
   Sites Hub — Feuille de styles
   Police : Inter (Google Fonts)
   Thème  : Clair, professionnel
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  --bg:        #f1f5f9;
  --surface:   #ffffff;
  --border:    #e2e8f0;
  --text:      #0f172a;
  --text-soft: #64748b;
  --text-mono: #334155;
  --accent:    #3b82f6;
  --accent-dk: #2563eb;
  --danger:    #ef4444;
  --success:   #22c55e;
  --warn:      #f59e0b;
  --mono:      'SFMono-Regular','Menlo','Consolas','Liberation Mono',monospace;
  --r:         6px;
  --r-lg:      10px;
  --shadow:    0 1px 4px rgba(0,0,0,.08);
  --shadow-lg: 0 8px 30px rgba(0,0,0,.14);
  --nav-h:     52px;
  --filter-h:  46px;
}

/* ─── Reset ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; -webkit-text-size-adjust: 100%; }
body { font-family: 'Inter', system-ui, sans-serif; color: var(--text); background: var(--bg); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { cursor: pointer; font-family: inherit; font-size: inherit; }
input, select, textarea {
  font-family: inherit; font-size: inherit;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--r);
  padding: .4rem .65rem; outline: none; transition: border-color .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(59,130,246,.15); }
code { font-family: var(--mono); font-size: .85rem; color: var(--text-mono); word-break: break-all; }

/* ─── Boutons ──────────────────────────────────────────────────────────────*/
.btn {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .42rem .85rem; border-radius: var(--r); border: none;
  font-weight: 600; transition: background .15s, opacity .15s;
  white-space: nowrap;
}
.btn-primary  { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dk); }
.btn-ghost    { background: transparent; color: var(--text-soft); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--border); }
.btn-sm       { padding: .28rem .6rem; font-size: .82rem; }
.btn-full     { width: 100%; justify-content: center; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* ─── Alertes ─────────────────────────────────────────────────────────────── */
.alert-error {
  background: #fef2f2; color: var(--danger); border: 1px solid #fecaca;
  border-radius: var(--r); padding: .55rem .8rem; font-size: .88rem;
  margin-bottom: .75rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   LOGIN
   ═══════════════════════════════════════════════════════════════════════════ */
.login-body { display: flex; justify-content: center; align-items: center; min-height: 100vh; }
.login-wrap { width: 100%; max-width: 380px; padding: 1rem; }
.login-card {
  background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
  padding: 2.2rem 2rem;
}
.login-logo { font-size: 2.5rem; text-align: center; margin-bottom: .5rem; }
.login-card h1 { font-size: 1.5rem; font-weight: 700; text-align: center; margin-bottom: .2rem; }
.login-sub { color: var(--text-soft); text-align: center; margin-bottom: 1.4rem; font-size: .9rem; }
.field { margin-bottom: 1rem; }
.field label { display: block; font-weight: 600; margin-bottom: .3rem; font-size: .85rem; }
.field input { width: 100%; }

/* ═══════════════════════════════════════════════════════════════════════════
   NAVBAR
   ═══════════════════════════════════════════════════════════════════════════ */
.app-body { display: flex; flex-direction: column; min-height: 100vh; }

.navbar {
  position: sticky; top: 0; z-index: 100;
  height: var(--nav-h);
  background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: .75rem; padding: 0 1rem;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.nav-left  { display: flex; align-items: center; gap: .5rem; flex-shrink: 0; }
.nav-center { flex: 1; max-width: 420px; margin: 0 auto; }
.nav-right { display: flex; align-items: center; gap: .4rem; flex-shrink: 0; }
.nav-logo  { font-size: 1.4rem; }
.nav-title { font-weight: 700; font-size: 1rem; white-space: nowrap; }
.nav-search {
  width: 100%; padding: .38rem .7rem; border-radius: 20px;
  background: var(--bg); border-color: transparent; font-size: .9rem;
}
.nav-search:focus { background: #fff; border-color: var(--accent); }
.nav-user  { font-size: .85rem; color: var(--text-soft); }

/* ─── Filter bar ──────────────────────────────────────────────────────────── */
.filter-bar {
  position: sticky; top: var(--nav-h); z-index: 90;
  height: var(--filter-h);
  background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: .4rem;
  padding: 0 1rem; overflow-x: auto; flex-wrap: nowrap;
  scrollbar-width: none;
}
.filter-bar::-webkit-scrollbar { display: none; }

.pill {
  flex-shrink: 0;
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .28rem .75rem; border-radius: 20px;
  border: 1px solid var(--border); background: transparent;
  font-size: .82rem; font-weight: 500; color: var(--text-soft);
  transition: all .15s; cursor: pointer;
}
.pill.active, .pill:hover {
  border-color: var(--pc, var(--accent));
  background: color-mix(in srgb, var(--pc, var(--accent)) 10%, transparent);
  color: var(--pc, var(--accent));
}
.pill-count {
  background: var(--bg); border-radius: 10px; padding: .05rem .35rem;
  font-size: .75rem; font-weight: 600; color: var(--text-soft);
}

/* ═══════════════════════════════════════════════════════════════════════════
   MAIN / SECTIONS
   ═══════════════════════════════════════════════════════════════════════════ */
#main { flex: 1; padding: 1rem; max-width: 1400px; margin: 0 auto; width: 100%; }

.empty-state {
  text-align: center; padding: 4rem 2rem; color: var(--text-soft);
}
.empty-icon { font-size: 3rem; margin-bottom: 1rem; }
.empty-state p { line-height: 1.7; font-size: 1rem; }

/* ─── Section fournisseur ───────────────────────────────────────────────── */
.prov-section { margin-bottom: 1.5rem; }
.prov-header {
  display: flex; align-items: center; gap: .6rem;
  padding: .45rem .75rem; border-radius: var(--r);
  background: var(--surface); margin-bottom: .6rem;
  box-shadow: var(--shadow);
}
.prov-dot   { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.prov-name  { font-weight: 700; font-size: .95rem; }
.prov-count { font-size: .8rem; color: var(--text-soft); margin-left: .2rem; }
.prov-cards { display: flex; flex-direction: column; gap: .5rem; }

/* ═══════════════════════════════════════════════════════════════════════════
   CARTE SITE  (généré par lib.php::site_card())
   ═══════════════════════════════════════════════════════════════════════════ */
.site-card {
  background: var(--surface); border-radius: var(--r-lg);
  box-shadow: var(--shadow); overflow: hidden;
  transition: box-shadow .15s;
}
.site-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,.11); }

/* ─── En-tête carte ────────────────────────────────────────────────────── */
.sc-head, .card-hd {
  display: flex; align-items: center; flex-wrap: wrap; gap: .5rem;
  padding: .6rem .9rem;
  border-left: 4px solid var(--accent);
  background: var(--surface);
}
.sc-title, .card-title-row {
  display: flex; align-items: center; flex-wrap: wrap; gap: .4rem; flex: 1 1 200px;
}
.sc-name, .site-name {
  font-weight: 700; font-size: 1rem; color: var(--text);
}
a.sc-name:hover, a.site-name:hover { color: var(--accent); text-decoration: none; }

.sc-meta, .card-meta {
  display: flex; align-items: center; flex-wrap: wrap; gap: .3rem;
  font-size: .8rem; color: var(--text-soft); flex: 1 1 160px;
}
.sc-actions, .card-actions { display: flex; gap: .3rem; flex-shrink: 0; }
.pdot, .prov-dot-small {
  width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0;
}
.sep { color: #cbd5e1; }
.meta-item { font-size: .8rem; color: var(--text-soft); }
.meta-item.renewal { font-size: .8rem; }

/* ─── Badges ─────────────────────────────────────────────────────────────── */
.badge {
  display: inline-block; padding: .15rem .45rem; border-radius: 12px;
  font-size: .72rem; font-weight: 600; white-space: nowrap;
}
.b-cms { background: #ede9fe; color: #6d28d9; }
.b-cat { background: #d1fae5; color: #065f46; }

/* ─── Expiration ─────────────────────────────────────────────────────────── */
.exp-dead  { color: var(--danger); font-weight: 700; }
.exp-crit  { color: #dc2626; font-weight: 600; }
.exp-warn  { color: var(--warn); font-weight: 600; }
.exp-ok    { color: var(--text-soft); }

/* ─── Boutons icon (édition / suppression) ─────────────────────────────── */
.btn-edit, .btn-del {
  background: none; border: none; font-size: 1rem; padding: .15rem .3rem;
  border-radius: var(--r); opacity: .6; transition: opacity .15s, background .15s;
}
.btn-edit:hover { opacity: 1; background: #dbeafe; }
.btn-del:hover  { opacity: 1; background: #fee2e2; }

/* ─── Corps carte ─────────────────────────────────────────────────────────── */
.sc-body, .card-body { padding: .55rem .9rem .65rem; }

.cred-grid, .cred-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: .6rem;
}

/* ─── Colonne d'accréditations ───────────────────────────────────────────── */
.cred-col {
  background: var(--bg); border-radius: var(--r);
  padding: .5rem .65rem; min-width: 0;
}
.cred-col-title, .cred-title {
  font-size: .8rem; font-weight: 700; color: var(--text-soft);
  text-transform: uppercase; letter-spacing: .03em;
  margin-bottom: .4rem;
}

/* ─── Ligne d'info ────────────────────────────────────────────────────────── */
.cr, .crow {
  display: flex; align-items: center; flex-wrap: wrap; gap: .25rem;
  font-size: .83rem; padding: .12rem 0; min-width: 0;
}
.cl, .clbl {
  flex-shrink: 0; width: 52px; font-size: .75rem; font-weight: 600;
  color: var(--text-soft); text-transform: uppercase; letter-spacing: .02em;
}
.val-link, .url-lnk {
  color: var(--accent); font-size: .83rem; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; max-width: 160px;
}
.dots, .pdots {
  font-family: var(--mono); font-size: .85rem; color: var(--text-soft);
  letter-spacing: .08em;
}

/* ─── Boutons copier ──────────────────────────────────────────────────────── */
.cp, .cp-plain, .cp-enc {
  flex-shrink: 0; background: none; border: 1px solid var(--border);
  border-radius: var(--r); padding: .05rem .3rem; font-size: .8rem; line-height: 1.5;
  color: var(--text-soft); transition: all .15s;
}
.cp:hover, .cp-plain:hover, .cp-enc:hover {
  background: #dbeafe; border-color: var(--accent); color: var(--accent);
}
.cp.copied, .cp-plain.copied, .cp-enc.copied {
  background: #d1fae5; border-color: var(--success); color: #065f46;
}

/* ─── SSH bar ──────────────────────────────────────────────────────────────── */
.ssh-bar, .ssh-row {
  display: flex; align-items: center; flex-wrap: wrap; gap: .35rem;
  background: var(--bg); border-radius: var(--r);
  padding: .35rem .65rem; margin-top: .5rem;
  font-size: .83rem; color: var(--text-soft);
}

/* ─── Notes bar ───────────────────────────────────────────────────────────── */
.notes-bar, .notes-row {
  font-size: .82rem; color: var(--text-soft); margin-top: .45rem;
  padding: .3rem .5rem; border-left: 3px solid var(--border);
  background: var(--bg); border-radius: 0 var(--r) var(--r) 0;
  line-height: 1.55; white-space: pre-wrap;
}

/* ═══════════════════════════════════════════════════════════════════════════
   FAB
   ═══════════════════════════════════════════════════════════════════════════ */
.fab {
  position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 200;
  width: 52px; height: 52px;
  background: var(--accent); color: #fff; border: none;
  border-radius: 50%; font-size: 1.6rem; font-weight: 300; line-height: 1;
  box-shadow: 0 4px 16px rgba(59,130,246,.45);
  transition: background .15s, transform .15s;
  display: flex; align-items: center; justify-content: center;
}
.fab:hover { background: var(--accent-dk); transform: scale(1.08); }

/* ═══════════════════════════════════════════════════════════════════════════
   TOAST
   ═══════════════════════════════════════════════════════════════════════════ */
.toast {
  position: fixed; bottom: 4.5rem; right: 1.5rem; z-index: 300;
  background: #1e293b; color: #f1f5f9;
  padding: .6rem 1rem; border-radius: var(--r);
  font-size: .88rem; font-weight: 500;
  box-shadow: 0 4px 16px rgba(0,0,0,.25);
  opacity: 0; transform: translateY(10px);
  transition: opacity .25s, transform .25s; pointer-events: none;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.toast-err { background: #b91c1c; }

/* ═══════════════════════════════════════════════════════════════════════════
   MODAL
   ═══════════════════════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 400;
  background: rgba(0,0,0,.38); backdrop-filter: blur(2px);
  display: flex; align-items: flex-start; justify-content: center;
  overflow-y: auto; padding: 1rem;
}
.modal-box {
  background: var(--surface); border-radius: var(--r-lg);
  width: 100%; max-width: 720px; box-shadow: var(--shadow-lg);
  margin: auto; overflow: hidden;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.2rem; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--surface); z-index: 5;
}
.modal-header h2 { font-size: 1.1rem; font-weight: 700; }
.modal-close {
  background: none; border: none; font-size: 1.1rem; color: var(--text-soft); padding: .2rem;
  border-radius: var(--r); transition: background .15s;
}
.modal-close:hover { background: var(--bg); }
.modal-footer {
  display: flex; justify-content: flex-end; gap: .5rem;
  padding: .85rem 1.2rem; border-top: 1px solid var(--border);
  position: sticky; bottom: 0; background: var(--surface); z-index: 5;
}

/* ─── Formulaire modal ───────────────────────────────────────────────── */
.mform { padding: 0; }
.mfs {
  border: none; padding: .6rem 1.2rem;
  border-top: 1px solid var(--border);
}
.mfs legend {
  float: left; width: 100%;
  font-size: .78rem; font-weight: 700; color: var(--text-soft);
  text-transform: uppercase; letter-spacing: .04em;
  padding: .5rem 0 .4rem; margin-bottom: .5rem;
}
.mfs::after { content: ''; display: table; clear: both; }

.fg { display: flex; flex-direction: column; gap: .25rem; min-width: 0; }
.fg label { font-size: .82rem; font-weight: 600; color: var(--text-soft); }
.fg input, .fg select, .fg textarea { width: 100%; min-width: 0; }
.fg textarea { resize: vertical; min-height: 70px; }

.fgrid1 { display: grid; grid-template-columns: 1fr; gap: .55rem; }
.fgrid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; }
.fgrid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .55rem; }
.span2 { grid-column: span 2; }

/* Password avec œil */
.pw-wrap { position: relative; display: flex; }
.pw-input { flex: 1; padding-right: 2.2rem; }
.pw-eye {
  position: absolute; right: .4rem; top: 50%; transform: translateY(-50%);
  background: none; border: none; font-size: .95rem; color: var(--text-soft);
  padding: .1rem; border-radius: var(--r); transition: color .15s;
}
.pw-eye:hover { color: var(--accent); }

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 720px) {
  .fgrid3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .span2 { grid-column: span 1; }
}
@media (max-width: 640px) {
  .navbar { gap: .4rem; }
  .nav-center { display: none; }
  #main { padding: .6rem; }
  .cred-grid, .cred-cols { grid-template-columns: 1fr; }
  .fgrid2, .fgrid3 { grid-template-columns: 1fr; }
  .span2 { grid-column: span 1; }
  .sc-head, .card-hd { flex-direction: column; align-items: flex-start; }
}
@media (min-width: 900px) {
  .prov-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(640px, 1fr)); gap: .5rem; }
}
