/* Phare — feuille de style unique, sans dépendance. */
*, *::before, *::after { box-sizing: border-box; }

:root {
  --bg: #070a10;
  --panel: #0d121b;
  --line: rgba(148, 163, 184, .13);
  --line-strong: rgba(148, 163, 184, .26);
  --fg: #e9eef8;
  --muted: #93a1b7;
  --faint: #66748a;
  --accent: #f7b955;
  --accent-ink: #201503;
  --accent-soft: rgba(247, 185, 85, .11);
  --up: #5ee1a0;
  --down: #ff7b7b;
  --radius: 14px;
  --sans: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
}

html { color-scheme: dark; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--fg);
  font: 14px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(900px 420px at 50% -180px, rgba(247, 185, 85, .10), transparent 70%),
    radial-gradient(700px 380px at 105% -80px, rgba(93, 149, 255, .07), transparent 70%);
}

.topbar, main, .foot { position: relative; z-index: 1; }

.wrap { width: min(1160px, 100% - 40px); margin-inline: auto; }

.skip {
  position: absolute;
  left: -9999px;
  top: 12px;
  z-index: 100;
  padding: 9px 14px;
  border-radius: 9px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 650;
  text-decoration: none;
}
.skip:focus { left: 16px; }

/* ---------- en-tête ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(7, 10, 16, .78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.topbar-inner { display: flex; align-items: center; gap: 14px; height: 66px; }

.brand { display: flex; align-items: center; gap: 11px; margin-right: auto; color: inherit; text-decoration: none; }

.mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(160deg, #ffd083, #f2a52e);
  color: #2a1a02;
  box-shadow: 0 0 0 1px rgba(255, 205, 125, .35), 0 10px 26px -14px rgba(247, 185, 85, .9);
}
.mark svg { width: 19px; height: 19px; }

.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 14.5px; font-weight: 650; letter-spacing: -.01em; }
.brand-text small { font-size: 11.5px; color: var(--faint); }

.actions { display: flex; align-items: center; gap: 8px; }

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 248px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, .03);
  transition: border-color .15s, background .15s;
}
.search:focus-within { border-color: rgba(247, 185, 85, .5); background: rgba(247, 185, 85, .05); }
.search svg { width: 15px; height: 15px; flex: none; color: var(--faint); }
.search input { flex: 1; min-width: 0; padding: 0; border: 0; background: none; color: var(--fg); font: 13px var(--sans); outline: none; }
.search input::placeholder { color: var(--faint); }
.search input::-webkit-search-cancel-button { appearance: none; }
.search kbd {
  padding: 1px 5px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--faint);
  font: 500 10px var(--mono);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, .03);
  color: var(--fg);
  font: 550 13px/1 var(--sans);
  white-space: nowrap;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.btn:hover { border-color: var(--line-strong); background: rgba(255, 255, 255, .06); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn[hidden] { display: none; }
.btn svg { width: 15px; height: 15px; }
.btn.primary { border-color: transparent; background: var(--accent); color: var(--accent-ink); font-weight: 650; }
.btn.primary:hover { background: #ffc76b; }
.btn.ghost { background: transparent; }
.btn.icon-only { width: 36px; padding: 0; }
.btn:disabled { opacity: .55; cursor: default; }

.spin svg { animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- contenu ---------- */
main { padding: 26px 0 64px; }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 18px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  padding: 0 11px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: 500 12.5px var(--sans);
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.chip:hover { color: var(--fg); background: rgba(255, 255, 255, .045); }
.chip[aria-pressed='true'] { border-color: rgba(247, 185, 85, .3); background: var(--accent-soft); color: #ffd28f; }
.chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.chip span { font: 500 11px var(--mono); opacity: .6; }

.summary { margin: 0 0 0 auto; color: var(--faint); font-size: 12.5px; }

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

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  min-height: 128px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #0e141e, #0b1017);
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.card:hover {
  transform: translateY(-2px);
  border-color: rgba(247, 185, 85, .32);
  box-shadow: 0 18px 34px -26px #000, 0 0 0 1px rgba(247, 185, 85, .06);
}
.card:focus-within { border-color: rgba(247, 185, 85, .45); }

.hit { position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.hit:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.card-head { display: flex; gap: 11px; align-items: flex-start; min-width: 0; }

.icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid hsl(var(--h) 45% 30% / .45);
  border-radius: 11px;
  background: hsl(var(--h) 42% 17%);
  color: hsl(var(--h) 80% 74%);
  font: 600 16px var(--sans);
}
.icon img { width: 100%; height: 100%; border-radius: 10px; object-fit: cover; }
.icon span { transform: translateY(-.5px); }

.card-titles { min-width: 0; padding-top: 1px; }
.card-titles h2 {
  margin: 0;
  font: 600 13.5px/1.35 var(--sans);
  letter-spacing: -.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card.has-acts .card-titles h2 { padding-right: 56px; }
.card-titles p {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
.card-titles p.dim { color: var(--faint); }

.card-stats { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 0 0 8px; color: var(--faint); font: 500 11px var(--sans); font-variant-numeric: tabular-nums; }
.card-stats b { color: var(--muted); font-weight: 600; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; }
.card-foot code {
  min-width: 0;
  overflow: hidden;
  color: var(--faint);
  font: 400 11.5px var(--mono);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.st { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font: 500 11.5px var(--sans); white-space: nowrap; }
.st i { width: 6px; height: 6px; flex: none; border-radius: 50%; background: var(--faint); box-shadow: 0 0 0 3px rgba(148, 163, 184, .09); }
.st.up { color: #8ce8b6; }
.st.up i { background: var(--up); box-shadow: 0 0 0 3px rgba(94, 225, 160, .12), 0 0 10px rgba(94, 225, 160, .55); }
.st.down { color: #ffa3a3; }
.st.down i { background: var(--down); box-shadow: 0 0 0 3px rgba(255, 123, 123, .12); }
.st.off { color: var(--faint); }
.st.wait i { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .3; } }

.card-acts {
  position: absolute;
  top: 9px;
  right: 9px;
  z-index: 2;
  display: flex;
  gap: 3px;
  opacity: 0;
  transform: translateY(-2px);
  transition: opacity .15s, transform .15s;
}
.card:hover .card-acts, .card:focus-within .card-acts { opacity: 1; transform: none; }

.mini {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(10, 14, 20, .85);
  color: var(--muted);
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: background .15s, color .15s, border-color .15s;
}
.mini:hover { border-color: var(--line-strong); background: #141b26; color: var(--fg); }
.mini:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.mini.danger:hover { border-color: rgba(255, 123, 123, .4); background: rgba(255, 123, 123, .1); color: #ffb3b3; }
.mini svg { width: 13px; height: 13px; }

.empty {
  margin-top: 8px;
  padding: 52px 24px;
  border: 1px dashed var(--line-strong);
  border-radius: 16px;
  color: var(--muted);
  text-align: center;
}
.empty[hidden] { display: none; }
.empty h2 { margin: 0 0 6px; color: var(--fg); font-size: 15px; letter-spacing: -.01em; }
.empty p { max-width: 440px; margin: 0 auto; font-size: 13px; }
.empty .btn { margin-top: 16px; }

.foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 22px 0 34px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 11.5px;
}

/* ---------- fenêtres ---------- */
.modal {
  width: min(440px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background: #0c1119;
  color: var(--fg);
  box-shadow: 0 40px 90px -44px #000;
}
.modal.wide { width: min(620px, calc(100vw - 32px)); }
.modal::backdrop { background: rgba(3, 5, 9, .66); backdrop-filter: blur(4px); }
.modal form, .modal-body { padding: 22px; }
.modal h2 { margin: 0; font-size: 16px; letter-spacing: -.01em; }
.modal .sub { margin: 5px 0 18px; color: var(--muted); font-size: 12.5px; }

.field { display: block; margin-bottom: 13px; }
.field > span { display: block; margin-bottom: 6px; color: var(--muted); font-size: 11.5px; }
.field input, .field textarea {
  width: 100%;
  height: 38px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #080c13;
  color: var(--fg);
  font: 13px var(--sans);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.field textarea { height: auto; min-height: 68px; padding: 9px 11px; resize: vertical; }
.field input:focus, .field textarea:focus { border-color: rgba(247, 185, 85, .55); box-shadow: 0 0 0 3px rgba(247, 185, 85, .1); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.hint { margin: 4px 0 14px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.pwd { margin: 18px 0 0; padding: 14px 15px 4px; border: 1px solid var(--line); border-radius: 13px; }
.pwd legend { padding: 0 7px; color: var(--fg); font-size: 12px; font-weight: 600; }
.pwd .sub { margin: 0 0 12px; color: var(--muted); font-size: 12px; }
.pwd .check { margin-bottom: 4px; }

.check { display: flex; align-items: center; gap: 9px; margin: 2px 0 16px; color: var(--muted); font-size: 12.5px; cursor: pointer; }
.check input { width: 15px; height: 15px; accent-color: var(--accent); }

.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

.form-error {
  margin: 0 0 12px;
  padding: 9px 11px;
  border: 1px solid rgba(255, 123, 123, .25);
  border-radius: 9px;
  background: rgba(255, 123, 123, .09);
  color: #ffb0b0;
  font-size: 12.5px;
}
.form-error[hidden] { display: none; }

.docker-list { max-height: 46vh; overflow: auto; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 11px; list-style: none; }
.docker-row { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-bottom: 1px solid var(--line); cursor: pointer; }
.docker-row:last-child { border-bottom: 0; }
.docker-row:hover { background: rgba(255, 255, 255, .03); }
.docker-row input { width: 15px; height: 15px; flex: none; accent-color: var(--accent); }
.docker-row .d-main { min-width: 0; flex: 1; }
.docker-row .d-name, .docker-row .d-url { display: block; }
.docker-row .d-name { font-size: 12.5px; font-weight: 550; }
.docker-row .d-url { overflow: hidden; color: var(--faint); font: 400 11px var(--mono); white-space: nowrap; text-overflow: ellipsis; }
.docker-row .badge { padding: 2px 7px; border: 1px solid var(--line); border-radius: 999px; color: var(--faint); font-size: 10.5px; }
.docker-hint { margin: 14px 0 0; color: var(--faint); font-size: 12px; line-height: 1.6; }
.docker-hint code { padding: 1px 5px; border-radius: 5px; background: rgba(255, 255, 255, .05); font: 11px var(--mono); color: var(--muted); }

/* ---------- notifications ---------- */
.toasts {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transform: translateX(-50%);
  pointer-events: none;
}
.toast {
  padding: 10px 15px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #131a25;
  color: var(--fg);
  font-size: 12.5px;
  box-shadow: 0 16px 40px -20px #000;
  animation: toast-in .2s ease;
  transition: opacity .25s, transform .25s;
}
.toast.err { border-color: rgba(255, 123, 123, .4); color: #ffb3b3; }
.toast.out { opacity: 0; transform: translateY(6px); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 820px) {
  .topbar-inner { height: auto; flex-wrap: wrap; padding: 12px 0; }
  .actions { width: 100%; flex-wrap: wrap; justify-content: flex-end; }
  .search { flex: 1 1 220px; width: auto; }
  .summary { width: 100%; margin: 0; }
  main { padding-top: 20px; }
}
@media (max-width: 620px) {
  .topbar-inner { gap: 10px; }
  .search { flex: 1 1 100%; order: -1; }
}
@media (max-width: 560px) {
  .brand-text small { display: none; }
  .btn.primary span, .btn#docker span { display: none; }
  .grid { grid-template-columns: 1fr; }
  .search kbd { display: none; }
}
@media (hover: none) {
  .card-acts { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
