/* ============================== Tableau de bord (Mes TGP) ============================== */
body.dash { display: block; overflow: auto; height: auto; min-height: 100%; }

.dash-top {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between;
  height: 56px; padding: 0 28px; background: var(--panel); border-bottom: 1px solid var(--line);
}
.dash-brand { display: flex; align-items: center; gap: 10px; font-size: 14px; letter-spacing: .01em; }
.dash-brand img { display: block; }
.dash-top .btn.primary { height: 32px; padding: 0 14px; text-decoration: none; }

.dash-main { max-width: 1680px; margin: 0 auto; padding: 24px 28px 60px; }
.dash-bar { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; flex-wrap: wrap; }
.dash-bar h1 { margin: 0 auto 0 0; font-size: 18px; font-weight: 600; }
.dash-bar h1 small { font-size: 13px; font-weight: 400; color: var(--mute); margin-left: 6px; }
.dash-bar .seg button { flex: none; padding: 0 12px; }
.dash-search { width: 220px; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 24px; }

.card {
  position: relative; display: flex; flex-direction: column; border-radius: 10px; overflow: hidden; cursor: pointer;
  background: var(--panel); border: 1px solid var(--line); outline: none; transition: border-color .12s;
}
.card:hover, .card:focus-visible, .card.menu-on { border-color: #5a5a5a; }
.card:focus-visible { box-shadow: 0 0 0 2px var(--accent); }
.card__cover { aspect-ratio: 4 / 3; background: #181818; border-bottom: 1px solid var(--line); overflow: hidden; }
.card__cover img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.card__cover .ph { height: 100%; display: grid; place-items: center; color: var(--dim); font-size: 12px; }
.card__foot { display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 14px; min-height: 64px; }
.card__info { flex: 1; min-width: 0; }
.card__name { display: block; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card__sub { display: flex; align-items: center; gap: 6px; margin-top: 3px; font-size: 11.5px; color: var(--mute); white-space: nowrap; overflow: hidden; }
.card__sub span { overflow: hidden; text-overflow: ellipsis; }
.dot { width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--ok); }
.card.off .dot { background: var(--dim); }
.card.off .card__cover img { filter: grayscale(1); opacity: .45; }
.card.draft .dot { background: var(--warn); }
.card.draft .card__cover img { opacity: .75; }
.card .badge {
  position: absolute; top: 10px; left: 10px; padding: 3px 8px; border-radius: 4px; font-size: 11px; font-weight: 600;
  background: rgba(0,0,0,.72); color: var(--text);
}
.card .badge.warn { background: rgba(245,166,35,.9); color: #1e1e1e; }

.more {
  flex: none; width: 30px; height: 30px; border-radius: var(--r); border: 0; background: none; color: var(--mute);
  cursor: pointer; font-size: 18px; line-height: 1; opacity: 0; transition: opacity .12s;
}
.card:hover .more, .card:focus-within .more, .card.menu-on .more { opacity: 1; }
.more:hover, .card.menu-on .more { background: var(--hover); color: var(--text); }
@media (hover: none) { .more { opacity: 1; } }

.card--draft { border-style: dashed; }
.card--draft .card__cover .ph { font-size: 13px; color: var(--mute); }

/* Menu contextuel (clic droit ou « ⋯ ») */
.menu {
  position: fixed; z-index: 20; min-width: 210px; padding: 6px 0; border-radius: 10px;
  background: #1f1f1f; border: 1px solid #444; box-shadow: 0 12px 32px rgba(0,0,0,.5);
}
.menu button {
  display: block; width: 100%; padding: 8px 16px; border: 0; background: none; text-align: left; cursor: pointer; font-size: 13px;
}
.menu button:hover, .menu button:focus-visible { background: var(--accent); color: #fff; outline: none; }
.menu button.danger { color: #ff8a73; }
.menu button.danger:hover, .menu button.danger:focus-visible { background: var(--err); color: #fff; }
.menu hr { margin: 6px 0; border: 0; border-top: 1px solid #3a3a3a; }

.dash-empty { padding: 80px 20px; text-align: center; color: var(--mute); }
.dash-empty b { display: block; color: var(--text); font-size: 15px; margin-bottom: 6px; }
.dash-empty .btn { margin-top: 16px; text-decoration: none; }

dialog .in { margin-top: 8px; }

@media (max-width: 640px) {
  .dash-top, .dash-main { padding-left: 16px; padding-right: 16px; }
  .dash-search { width: 100%; }
}
