.staff { background-attachment: fixed; }

[hidden] { display: none !important; }

.staff input,
.staff select {
  width: 100%;
  min-height: 40px;
  padding: 7px 10px;
  border: 2px solid var(--line);
  border-radius: 0;
  background: var(--ink);
  color: var(--text);
  font: inherit;
}
.staff select option { background: var(--ink); }

.message { margin: 0; font-size: .95rem; color: var(--muted); }
.message.erreur { color: #ff9d9d; }
.message.ok { color: var(--done); }
.message.attente { color: var(--doing); }

/* Connexion */

.login {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px 16px;
}
.login img { display: block; width: min(420px, 86vw); height: auto; }

.login-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: min(400px, 100%);
  padding: 24px;
  background: var(--panel);
  border: 2px solid var(--line);
}
.login-card h1 { margin: 0; font: 600 1.6rem/1.2 var(--pixel); }
.login-card label { display: flex; flex-direction: column; gap: 5px; font-weight: 600; }
.login-card .block { width: 100%; margin: 4px 0 7px; }

/* Barre fixe */

.bar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 20px;
  padding: 12px 24px;
  background: var(--panel);
  border-bottom: 2px solid var(--line);
}
.bar h1 { margin: 0; font: 600 1.5rem/1.2 var(--pixel); }
.bar small { margin-left: 6px; font: 400 .9rem var(--body); color: var(--muted); }
.bar .message { flex: 1; min-width: 160px; }
.bar-actions { display: flex; align-items: center; gap: 18px; }

.save { min-width: 0; padding: 9px 18px; font-size: 1.1rem; box-shadow: 0 4px 0 var(--edge); }
.save:hover { box-shadow: 0 5px 0 var(--edge); }
.save:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--edge); }
.save:disabled { opacity: .45; cursor: default; transform: none; filter: none; box-shadow: 0 4px 0 var(--edge); }

/* Éditeur */

.editor {
  width: min(1040px, 100%);
  margin: 0 auto;
  padding: 20px 16px 48px;
}

.cat {
  margin-bottom: 10px;
  background: var(--panel);
  border: 2px solid #15325f;
}

.cat summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
}
.cat[open] summary { border-bottom: 2px solid #15325f; }
.cat-name { flex: 1; min-width: 0; font: 600 1.15rem/1.2 var(--pixel); overflow-wrap: anywhere; }
.cat-count { font-size: .85rem; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }

.cat-body { padding: 14px; }

.cat-fields {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 10px;
  margin-bottom: 16px;
}
.cat-fields label { display: flex; flex-direction: column; gap: 4px; font-size: .85rem; color: var(--muted); }
.cat-fields .wide { grid-column: 1 / -1; }

.rows { display: flex; flex-direction: column; gap: 6px; margin: 0 0 12px; padding: 0; list-style: none; }

.row {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr) 190px auto;
  align-items: center;
  gap: 8px;
}

.tools { display: flex; gap: 4px; }

.icon {
  flex: none;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 2px solid var(--line);
  background: var(--panel-2);
  font-size: 1rem;
  line-height: 1;
}
.icon:hover:not(:disabled) { background: var(--line); }
.icon:disabled { opacity: .35; cursor: default; }
.icon.danger:hover { background: #7a2230; border-color: #b23a4c; }

.ghost {
  padding: 8px 14px;
  border: 2px dashed var(--line);
  background: transparent;
  font-weight: 600;
}
.ghost:hover { background: var(--panel-2); }
.add-category { width: 100%; padding: 14px; }

@media (max-width: 640px) {
  .bar { padding: 10px 16px; }
  .bar-actions { width: 100%; justify-content: space-between; }
  .row { grid-template-columns: 16px minmax(0, 1fr); }
  .row select { grid-column: 2; }
  .row .tools { grid-column: 2; justify-content: flex-end; margin-bottom: 8px; }
  .cat summary .tools .icon { width: 32px; height: 32px; }
}
