/* lists.n77.nl — n77 palette, compact bars matching the main site. */
:root {
  --bg: #050508;
  --surf: #0b0b12;
  --surf2: #11111c;
  --border: #1d1d33;
  --border2: #2c2c4a;
  --text: #c4cbd8;
  --bright: #eef2f8;
  --dim: #8089a0;
  --faint: #59617a;
  --cyan: #00d4ff;
  --green: #3dff6e;
  --magenta: #c77dff;
  --amber: #ffb000;
  --red: #ff4d67;
  --mono: ui-monospace, "Cascadia Mono", "Roboto Mono", "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

html, body { background: var(--bg); color: var(--text); font: 13px/1.45 var(--mono); }
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-image:
    linear-gradient(rgba(0, 212, 255, .03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 212, 255, .03) 1px, transparent 1px);
  background-size: 40px 40px;
}

a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 1px solid var(--cyan); outline-offset: 1px; }
.spacer { flex: 1; }

input, textarea {
  background: var(--surf);
  border: 1px solid var(--border);
  border-radius: 0;
  padding: 2px 6px;
  min-width: 0;
}
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, textarea:focus { border-color: var(--cyan); outline: none; }
input[type="search"]::-webkit-search-cancel-button { filter: invert(.6); }

.btn {
  background: transparent;
  border: 1px solid var(--border2);
  color: var(--dim);
  padding: 1px 8px;
  cursor: pointer;
  letter-spacing: .06em;
  white-space: nowrap;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn:hover { color: var(--cyan); border-color: var(--cyan); text-decoration: none; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.pri { background: var(--cyan); border-color: var(--cyan); color: var(--bg); font-weight: 700; }
.btn.pri:hover { box-shadow: 0 0 10px rgba(0, 212, 255, .45); color: var(--bg); }

/* ── top bar (26px, like n77.nl) ── */
.bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 26px;
  padding: 3px 4px;
  background: rgba(5, 5, 8, .92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(6px);
}
.bar input, .bar .btn { height: 20px; font-size: 12px; }
.logo {
  font-weight: 800;
  font-size: 12.8px;
  letter-spacing: .18em;
  color: var(--cyan);
  text-shadow: 0 0 10px rgba(0, 212, 255, .6);
}
.logo:hover { text-decoration: none; color: var(--bright); }
.home { color: var(--faint); font-size: 10px; letter-spacing: .1em; }
.search { width: min(280px, 34vw); }
.login { display: flex; gap: 4px; }
.login input { width: 110px; }
.admin-tag {
  color: var(--amber);
  border: 1px solid var(--amber);
  font-size: 10px;
  letter-spacing: .16em;
  padding: 0 5px;
  line-height: 16px;
}

/* ── admin: quick add ── */
.admin { background: var(--surf); border-bottom: 1px solid var(--border); }
.add {
  display: grid;
  grid-template-columns: minmax(84px, .8fr) minmax(84px, .8fr) minmax(200px, 3fr) minmax(100px, 1.2fr) minmax(110px, 1.3fr) auto auto auto;
  gap: 5px;
  padding: 6px;
  max-width: 1400px;
  margin: 0 auto;
}
.add input, .add .btn { height: 24px; }
.add textarea { grid-column: 1 / -1; resize: vertical; min-height: 24px; }
.add textarea:focus { min-height: 64px; }
.add.editing { box-shadow: inset 2px 0 0 var(--amber); }
.vis { min-width: 92px; }
.vis.priv { color: var(--amber); border-color: rgba(255, 176, 0, .5); }

.manage { max-width: 1400px; margin: 0 auto; padding: 0 6px; }
.manage summary {
  cursor: pointer;
  color: var(--faint);
  font-size: 11px;
  letter-spacing: .08em;
  padding: 3px 0 5px;
  list-style-position: inside;
}
.manage summary:hover { color: var(--dim); }
.mgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; padding: 4px 0 12px; }
.mbox h3 { font-size: 10px; letter-spacing: .16em; color: var(--cyan); margin-bottom: 4px; }
.mrow { display: flex; align-items: center; gap: 6px; padding: 1px 0; border-bottom: 1px dashed var(--border); }
.mrow .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mrow .n { color: var(--faint); font-size: 11px; min-width: 2ch; text-align: right; }
.madd, .mcode { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.madd input { flex: 1; height: 22px; }
.mcode input { flex: 1 1 140px; height: 22px; }
.madd .btn, .mcode .btn { height: 22px; }
.mnote { color: var(--faint); font-size: 11px; margin: 8px 0 6px; }

/* ── filters ── */
.filters, .list { width: 100%; max-width: 1400px; margin: 0 auto; padding: 0 6px; }
.filters { display: flex; flex-direction: column; gap: 3px; padding-top: 6px; }
.frow, .tools { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.flabel { color: var(--faint); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; width: 64px; }
.tools .flabel { width: auto; margin-right: 2px; }
.chip {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--dim);
  padding: 0 7px;
  line-height: 18px;
  font-size: 11px;
  cursor: pointer;
}
.chip:hover { color: var(--cyan); border-color: var(--border2); }
.chip .n { color: var(--faint); margin-left: 5px; }
.chip.on { background: var(--cyan); border-color: var(--cyan); color: var(--bg); }
.chip.on .n { color: rgba(5, 5, 8, .6); }
.clear { align-self: flex-start; height: 20px; font-size: 11px; margin-top: 2px; }

/* ── list ── */
.list { flex: 1; padding-bottom: 16px; }
.tools { margin: 8px 0 2px; color: var(--faint); font-size: 11px; }
.grp { margin-top: 10px; }
.grp-h {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 3px;
}
.grp-h::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--border2), transparent); }
.grp-n { color: var(--faint); letter-spacing: 0; }

.it {
  border: 1px solid var(--border);
  background: rgba(11, 11, 18, .78);
  padding: 4px 6px 4px 8px;
  margin: 3px 0;
}
.it:hover { border-color: var(--border2); }
.it.priv { box-shadow: inset 2px 0 0 var(--amber); }
.it-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.badge {
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--magenta);
  border: 1px solid rgba(199, 125, 255, .55);
  padding: 0 5px;
  line-height: 16px;
  white-space: nowrap;
}
.it-main { flex: 1 1 260px; min-width: 0; display: flex; gap: 8px; align-items: baseline; }
.it-name { color: var(--bright); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 55%; flex-shrink: 0; }
.it-val { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
span.it-val { color: var(--text); }
.it-tags { display: flex; flex-wrap: wrap; gap: 2px; }
.tag {
  background: none;
  border: 1px solid transparent;
  color: var(--green);
  opacity: .8;
  padding: 0 3px;
  font-size: 11px;
  line-height: 16px;
  cursor: pointer;
}
.tag:hover, .tag.on { opacity: 1; border-color: rgba(61, 255, 110, .4); }
.it-meta { display: flex; align-items: center; gap: 3px; margin-left: auto; white-space: nowrap; }
.it-date { color: var(--faint); font-size: 11px; margin-right: 3px; }
.ico {
  background: none;
  border: 1px solid transparent;
  color: var(--dim);
  width: 22px;
  height: 20px;
  line-height: 1;
  cursor: pointer;
  font-size: 12px;
}
.ico:hover { color: var(--cyan); border-color: var(--border2); }
.ico.del:hover { color: var(--red); border-color: var(--red); }
.ico:disabled { opacity: .3; cursor: default; border-color: transparent; color: var(--dim); }
.it-desc {
  margin: 3px 0 1px;
  color: var(--dim);
  font-size: 12px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.empty { color: var(--faint); padding: 24px 0; text-align: center; letter-spacing: .08em; }

/* ── footer (22px, like n77.nl) ── */
.foot {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 22px;
  padding: 2px 4px;
  border-top: 1px solid var(--border);
  background: rgba(5, 5, 8, .9);
  color: var(--faint);
  font-size: 10px;
  letter-spacing: .08em;
}

.toast {
  position: fixed;
  right: 10px;
  bottom: 30px;
  z-index: 50;
  max-width: min(420px, calc(100vw - 20px));
  background: var(--surf2);
  border: 1px solid var(--cyan);
  padding: 6px 10px;
  font-size: 12px;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .15s, transform .15s;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: none; }
.toast.err { border-color: var(--red); color: #ffc2cc; }

@media (max-width: 760px) {
  .add { grid-template-columns: 1fr 1fr; }
  .add #fItem, .add textarea { grid-column: 1 / -1; }
  .add #fTags { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .bar { flex-wrap: wrap; }
  .search { order: 9; flex: 1 1 100%; width: auto; }
  .login input { width: 92px; }
  .flabel { width: 100%; }
  .it-name { max-width: 100%; }
  .it-main { flex-wrap: wrap; }
  .it-val { flex: 1 1 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .toast { transition: none; }
}
