/* ════════════════════════════════════════════════════════════════════════════
   Sentinel Cloud — onglets des machines et composants partagés
   (tableaux, fenêtres, menus, gestionnaire de fichiers, éditeur)
   ════════════════════════════════════════════════════════════════════════════ */

.machine-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.machine-head__addr {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 6px;
}

.tabs {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
  border-bottom: 1px solid var(--line);
  margin-bottom: 22px;
}
.tabs::-webkit-scrollbar {
  display: none;
}
.tabs a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  font-size: 13.5px;
  font-weight: 540;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  transition: color 0.14s ease, border-color 0.14s ease;
}
.tabs a:hover {
  color: var(--text);
}
.tabs a[aria-current='page'] {
  color: var(--text);
  border-bottom-color: var(--accent);
}
.tabs svg {
  width: 15px;
  height: 15px;
  opacity: 0.8;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.toolbar__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.section-title {
  font-size: 17px;
}
.section-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 3px;
}

/* ── Listes ───────────────────────────────────────────────────────────────── */

.list {
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-top: 1px solid var(--line-soft);
  min-width: 0;
}
.row:first-child {
  border-top: 0;
}
.row:hover {
  background: var(--surface-2);
}
.row__icon {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  background: var(--surface-3);
  color: var(--text-muted);
}
.row__icon svg {
  width: 17px;
  height: 17px;
}
.row__icon--accent {
  background: var(--accent-glow);
  color: var(--accent);
}
.row__main {
  flex: 1;
  min-width: 0;
}
.row__title {
  font-weight: 560;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.row__sub {
  font-size: 12.5px;
  color: var(--text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.row__meta {
  font-size: 12.5px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  white-space: nowrap;
  text-align: right;
}
.row__actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
@media (max-width: 640px) {
  .row {
    flex-wrap: wrap;
  }
  .row__meta {
    order: 3;
    width: 100%;
    text-align: left;
    padding-left: 48px;
  }
}

.empty-inline {
  padding: 36px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}
.pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  font-size: 13px;
  color: var(--text-muted);
}
.limit-note {
  font-size: 12.5px;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

/* ── Formulaires ──────────────────────────────────────────────────────────── */

select,
textarea,
input[type='number'],
input[type='url'] {
  width: 100%;
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  background: var(--surface-0);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}
select:focus,
textarea:focus,
input[type='number']:focus,
input[type='url']:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
textarea {
  resize: vertical;
  min-height: 90px;
}
.field__help {
  font-size: 12.5px;
  color: var(--text-dim);
  margin-top: 6px;
  line-height: 1.5;
}
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 14px;
}
.grid-5 {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0 10px;
}
@media (max-width: 560px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
  .grid-5 {
    grid-template-columns: 1fr 1fr;
  }
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13.5px;
  cursor: pointer;
  margin-bottom: 10px;
}
.check input {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  accent-color: var(--accent);
  flex-shrink: 0;
}
.check small {
  display: block;
  color: var(--text-dim);
  font-size: 12px;
}

.perm-group {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px 4px;
  margin-bottom: 10px;
}
.perm-group__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.perm-group__head strong {
  font-size: 13.5px;
  text-transform: capitalize;
}
.perm-group__head span {
  font-size: 12px;
  color: var(--text-dim);
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 13.5px;
}
.switch input {
  appearance: none;
  width: 36px;
  height: 20px;
  border-radius: 999px;
  background: var(--surface-3);
  border: 1px solid var(--line-strong);
  position: relative;
  cursor: pointer;
  transition: background 0.15s ease;
  flex-shrink: 0;
  margin: 0;
}
.switch input::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: transform 0.15s ease, background 0.15s ease;
}
.switch input:checked {
  background: var(--accent-dim);
  border-color: var(--accent);
}
.switch input:checked::after {
  transform: translateX(16px);
  background: #fff;
}

/* ── Fenêtres ─────────────────────────────────────────────────────────────── */

.modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(5, 7, 9, 0.72);
  backdrop-filter: blur(3px);
  animation: fade-in 0.14s ease-out;
}
.modal__box {
  width: 100%;
  max-width: 480px;
  max-height: calc(100vh - 40px);
  overflow: auto;
  background: var(--surface-1);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lift);
  animation: pop-in 0.16s ease-out;
}
.modal__box--wide {
  max-width: 720px;
}
.modal__head {
  padding: 20px 22px 0;
}
.modal__head h2 {
  font-size: 18px;
}
.modal__head p {
  color: var(--text-muted);
  font-size: 13.5px;
  margin-top: 6px;
}
.modal__body {
  padding: 18px 22px;
}
.modal__foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 22px;
  border-top: 1px solid var(--line);
  background: var(--surface-0);
  position: sticky;
  bottom: 0;
}
@keyframes fade-in {
  from {
    opacity: 0;
  }
}
@keyframes pop-in {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.985);
  }
}

.secret {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  background: var(--surface-0);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 13px;
  word-break: break-all;
}
.secret code {
  flex: 1;
}

/* ── Menu contextuel ──────────────────────────────────────────────────────── */

.menu {
  position: fixed;
  z-index: 95;
  min-width: 200px;
  padding: 5px;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lift);
  animation: pop-in 0.1s ease-out;
}
.menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
  text-align: left;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.menu button:hover {
  background: var(--surface-3);
}
.menu button.is-danger {
  color: var(--tone-critical);
}
.menu button svg {
  width: 15px;
  height: 15px;
  color: var(--text-dim);
}
.menu hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 4px 2px;
}

/* ── Fichiers ─────────────────────────────────────────────────────────────── */

.path {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px;
  font-family: var(--font-mono);
  font-size: 13.5px;
  min-width: 0;
}
.path a,
.path span {
  padding: 3px 6px;
  border-radius: 4px;
}
.path a {
  color: var(--text-muted);
}
.path a:hover {
  color: var(--text);
  background: var(--surface-2);
}
.path .sep {
  color: var(--text-dim);
  padding: 0;
}

.files .row {
  padding: 8px 14px;
}
.files .row.is-selected {
  background: var(--accent-glow);
}
.files .row__icon {
  width: 30px;
  height: 30px;
}
.files .row__title a {
  color: var(--text);
}
.files .row__title a:hover {
  color: var(--accent);
}

.files__head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 9px 14px;
  font-size: 12px;
  color: var(--text-dim);
  background: var(--surface-0);
  border-bottom: 1px solid var(--line);
}
.files__head span:nth-child(2) {
  flex: 1;
  padding-left: 44px;
}


.dropzone {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  background: rgba(11, 13, 15, 0.86);
  border: 2px dashed var(--accent);
  color: var(--accent);
  font-size: 18px;
  font-weight: 600;
  pointer-events: none;
}

.uploads {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}
.upload {
  padding: 10px 14px;
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 13px;
}
.upload__bar {
  height: 4px;
  background: var(--surface-3);
  border-radius: 999px;
  margin-top: 7px;
  overflow: hidden;
}
.upload__bar div {
  height: 100%;
  background: var(--accent);
  width: 0;
  transition: width 0.2s ease;
}

/* ── Éditeur ──────────────────────────────────────────────────────────────── */

.editor {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.editor .CodeMirror {
  height: calc(100vh - 420px);
  min-height: 380px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.55;
}
.editor__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 14px;
  background: var(--surface-1);
  border-top: 1px solid var(--line);
}
.editor__bar select {
  width: auto;
  padding: 7px 10px;
  font-size: 13px;
}

.cm-s-sentinel.CodeMirror {
  background: #07090b;
  color: #d7dde3;
}
.cm-s-sentinel .CodeMirror-gutters {
  background: #0b0d0f;
  border-right: 1px solid var(--line-soft);
}
.cm-s-sentinel .CodeMirror-linenumber {
  color: #4b5561;
}
.cm-s-sentinel .CodeMirror-cursor {
  border-left: 2px solid var(--accent);
}
.cm-s-sentinel .CodeMirror-selected,
.cm-s-sentinel.CodeMirror-focused .CodeMirror-selected {
  background: rgba(23, 207, 239, 0.18);
}
.cm-s-sentinel .CodeMirror-activeline-background {
  background: rgba(255, 255, 255, 0.03);
}
.cm-s-sentinel .CodeMirror-matchingbracket {
  color: var(--accent) !important;
  text-decoration: underline;
}
.cm-s-sentinel .cm-comment {
  color: #6b7683;
  font-style: italic;
}
.cm-s-sentinel .cm-keyword,
.cm-s-sentinel .cm-tag {
  color: #c792ea;
}
.cm-s-sentinel .cm-string,
.cm-s-sentinel .cm-string-2 {
  color: #a5e075;
}
.cm-s-sentinel .cm-number,
.cm-s-sentinel .cm-atom {
  color: #ffa94d;
}
.cm-s-sentinel .cm-def,
.cm-s-sentinel .cm-property,
.cm-s-sentinel .cm-attribute {
  color: #17cfef;
}
.cm-s-sentinel .cm-variable-2,
.cm-s-sentinel .cm-variable-3,
.cm-s-sentinel .cm-type {
  color: #7cbcff;
}
.cm-s-sentinel .cm-operator,
.cm-s-sentinel .cm-meta {
  color: #9aa4b0;
}
.cm-s-sentinel .cm-builtin,
.cm-s-sentinel .cm-qualifier {
  color: #ffd43b;
}
.cm-s-sentinel .cm-header {
  color: #17cfef;
  font-weight: 600;
}
.CodeMirror-dialog {
  background: var(--surface-2);
  color: var(--text);
  padding: 6px 10px;
  border-bottom: 1px solid var(--line);
}
.CodeMirror-dialog input {
  width: auto !important;
  background: var(--surface-0) !important;
  border: 1px solid var(--line-strong) !important;
  color: var(--text) !important;
  padding: 3px 6px !important;
}

/* ── Divers ───────────────────────────────────────────────────────────────── */

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 18px;
  align-items: start;
}
.danger-zone {
  border-color: var(--tone-critical-line);
}
.danger-zone .card__head h2 {
  color: var(--tone-critical);
}
.cron {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-muted);
}
.tokens {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 13px;
}
.tokens code {
  padding: 6px 8px;
  background: var(--surface-0);
  border: 1px solid var(--line);
  border-radius: 4px;
  text-align: center;
}
.qr {
  display: block;
  margin: 0 auto 14px;
  border-radius: var(--radius-sm);
  width: 200px;
  height: 200px;
}
.activity-row .row__title {
  white-space: normal;
}
.chip {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11.5px;
  padding: 1px 7px;
  border-radius: 4px;
  background: var(--surface-3);
  color: var(--text-muted);
  margin: 2px 4px 2px 0;
}
.var-card .card__body {
  padding: 16px 18px;
}
.var-card code.env {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-dim);
}

.card .list {
  border: 0;
  border-radius: 0;
  background: transparent;
}

/* ════════════════════════════════════════════════════════════════════════════
   Sélection : cases rondes animées, barre flottante, lignes qui s'effacent
   ════════════════════════════════════════════════════════════════════════════ */

.tick,
.check input[type='checkbox'] {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin: 0;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  background: var(--surface-0);
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, transform 0.12s ease;
}
.check input[type='checkbox'] {
  margin-top: 1px;
}
.tick::after,
.check input[type='checkbox']::after {
  /* Coche dessinée en CSS, qui apparaît en grossissant. */
  content: '';
  position: absolute;
  left: 6px;
  top: 3px;
  width: 5px;
  height: 9px;
  border: solid var(--ink);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0);
  transition: transform 0.18s cubic-bezier(0.3, 1.6, 0.5, 1);
}
.tick:hover,
.check input[type='checkbox']:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-glow);
}
.tick:active,
.check input[type='checkbox']:active {
  transform: scale(0.9);
}
.tick:checked,
.check input[type='checkbox']:checked {
  background: var(--accent);
  border-color: var(--accent);
}
.tick:checked::after,
.check input[type='checkbox']:checked::after {
  transform: rotate(45deg) scale(1);
}
.tick:indeterminate {
  background: var(--accent-glow);
  border-color: var(--accent);
}
.tick:indeterminate::after {
  left: 4px;
  top: 8px;
  width: 9px;
  height: 0;
  border-width: 0 0 2px 0;
  border-color: var(--accent);
  transform: none;
}
.tick:focus-visible,
.check input[type='checkbox']:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.tick:disabled,
.check input[type='checkbox']:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.tick-spacer {
  width: 20px;
  flex-shrink: 0;
}

/* Lignes de fichiers : sélection au clic, surlignage fluide. */
.files .row {
  position: relative;
  cursor: pointer;
  user-select: none;
  transition: background 0.16s ease, opacity 0.24s ease, transform 0.24s ease, height 0.26s ease, padding 0.26s ease;
}
.files .row::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
  transform: scaleY(0);
  transition: transform 0.2s ease;
}
.files .row.is-selected {
  background: linear-gradient(90deg, var(--accent-glow), transparent 70%);
}
.files .row.is-selected::before {
  transform: scaleY(1);
}
.files .row.is-removing {
  opacity: 0;
  transform: translateX(24px);
  height: 0 !important;
  padding-top: 0;
  padding-bottom: 0;
  overflow: hidden;
  border-top-color: transparent;
}
.files .row--up {
  cursor: default;
}
.files .row__title a {
  user-select: text;
}

/* Barre de sélection flottante. */
.selection-bar {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 7px 7px 8px;
  max-width: calc(100vw - 24px);
  background: rgba(28, 34, 42, 0.92);
  backdrop-filter: blur(12px) saturate(140%);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  box-shadow: var(--shadow-lift), 0 0 0 1px rgba(23, 207, 239, 0.08);
  font-size: 13.5px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 16px) scale(0.97);
  transition: opacity 0.2s ease, transform 0.24s cubic-bezier(0.2, 1.2, 0.4, 1);
}
.selection-bar.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0) scale(1);
}
.selection-bar__count {
  display: grid;
  place-items: center;
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--ink);
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 13px;
  animation: pop-count 0.22s ease;
}
@keyframes pop-count {
  from {
    transform: scale(0.7);
  }
}
.selection-bar__label {
  color: var(--text-muted);
  padding: 0 6px 0 2px;
  white-space: nowrap;
}
.selection-bar__sep {
  width: 1px;
  height: 22px;
  background: var(--line-strong);
  margin: 0 2px;
}

.pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 560;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease;
}
.pill-btn svg {
  width: 15px;
  height: 15px;
}
.pill-btn:hover {
  background: var(--surface-hover);
}
.pill-btn:active {
  transform: scale(0.96);
}
.pill-btn--danger {
  color: var(--tone-critical);
}
.pill-btn--danger:hover {
  background: var(--tone-critical-bg);
}
.pill-btn--close {
  width: 34px;
  padding: 0;
  justify-content: center;
  color: var(--text-muted);
}
.pill-btn--close svg {
  transform: rotate(45deg);
}
@media (max-width: 560px) {
  .selection-bar__label {
    display: none;
  }
  .pill-btn span {
    display: none;
  }
  .pill-btn {
    width: 34px;
    padding: 0;
    justify-content: center;
  }
}

/* Boutons d'outils de l'onglet Fichiers : arrondis, comme la barre. */
.files-toolbar .btn {
  border-radius: 999px;
  padding-left: 14px;
  padding-right: 14px;
}
