*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:          #0d0d0d;
  --surface:     #141414;
  --surface2:    #1c1c1c;
  --border:      #252525;
  --border2:     #2e2e2e;
  --accent:      #c8ff00;
  --accent-dim:  rgba(200,255,0,0.08);
  --accent-glow: rgba(200,255,0,0.15);
  --text:        #e4e4e4;
  --text-dim:    #888;
  --text-muted:  #444;
  --error:       #ff4d4d;
  --success:     #00e5a0;
  --mono:        'DM Mono', monospace;
  --sans:        'DM Sans', sans-serif;
  --display:     'Bebas Neue', sans-serif;
  --sidebar-w:   280px;
  --radius:      2px;
}

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

body { display: flex; }

/* ── Sidebar ─────────────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-top {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem 1.25rem;
  scrollbar-width: thin;
  scrollbar-color: var(--border2) transparent;
}

.sidebar-bottom {
  padding: 1.25rem;
  border-top: 1px solid var(--border);
}

/* ── Main ────────────────────────────────────────────────────────────────── */
.main {
  flex: 1;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── Logo ────────────────────────────────────────────────────────────────── */
.app-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 2rem;
}

.logo-icon { font-size: 1.4rem; color: var(--accent); line-height: 1; }

.logo-text {
  font-family: var(--display);
  font-size: 1.1rem;
  letter-spacing: 0.15em;
}

/* ── Labels & Fields ─────────────────────────────────────────────────────── */
.section-label {
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.field { margin-bottom: 0.75rem; }

.field label {
  display: block;
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  margin-bottom: 0.4rem;
}

.input-wrap { position: relative; display: flex; }

input[type="text"],
input[type="password"] {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border2);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.78rem;
  padding: 0.55rem 0.75rem;
  outline: none;
  border-radius: var(--radius);
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
}

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

input::placeholder { color: var(--text-muted); }

.eye-btn {
  position: absolute; right: 0; top: 0; bottom: 0; width: 2rem;
  background: transparent; border: none; color: var(--text-muted);
  cursor: pointer; font-size: 0.8rem; display: flex;
  align-items: center; justify-content: center; transition: color 0.15s;
}
.eye-btn:hover { color: var(--accent); }

.field-hint {
  font-family: var(--mono); font-size: 0.62rem;
  margin-top: 0.35rem; min-height: 1em; color: var(--text-muted);
}
.field-hint.ok    { color: var(--success); }
.field-hint.error { color: var(--error); }

/* ── List slots ──────────────────────────────────────────────────────────── */
.list-slots { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 0.75rem; }

.list-slot {
  display: flex; align-items: center; gap: 0.4rem;
  background: var(--bg); border: 1px solid var(--border2);
  border-radius: var(--radius); padding: 0.4rem 0.5rem;
  transition: border-color 0.15s;
}
.list-slot:focus-within { border-color: var(--accent); }

.slot-num {
  font-family: var(--mono); font-size: 0.6rem;
  color: var(--text-muted); min-width: 1.2rem; text-align: center;
}

.list-slot input { border: none; padding: 0.2rem 0.3rem; font-size: 0.75rem; background: transparent; box-shadow: none; }
.list-slot input:focus { border: none; box-shadow: none; }

.remove-slot-btn {
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; font-size: 0.85rem; padding: 0.1rem 0.2rem;
  line-height: 1; transition: color 0.15s;
}
.remove-slot-btn:hover { color: var(--error); }

/* ── Sidebar buttons ─────────────────────────────────────────────────────── */
.add-list-btn {
  width: 100%; background: transparent; border: 1px dashed var(--border2);
  color: var(--text-dim); font-family: var(--mono); font-size: 0.68rem;
  letter-spacing: 0.1em; padding: 0.55rem; cursor: pointer;
  border-radius: var(--radius); transition: border-color 0.15s, color 0.15s;
}
.add-list-btn:hover { border-color: var(--accent); color: var(--accent); }

.fetch-all-btn {
  width: 100%; background: var(--accent); color: #000; border: none;
  font-family: var(--display); font-size: 1.15rem; letter-spacing: 0.1em;
  padding: 0.7rem; cursor: pointer; border-radius: var(--radius);
  transition: opacity 0.15s, transform 0.1s;
}
.fetch-all-btn:hover   { opacity: 0.88; }
.fetch-all-btn:active  { transform: scale(0.99); }
.fetch-all-btn:disabled { opacity: 0.35; cursor: not-allowed; }

/* ── Topbar ──────────────────────────────────────────────────────────────── */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.25rem 2rem 1rem; border-bottom: 1px solid var(--border); flex-shrink: 0;
}

h1 { font-family: var(--display); font-size: 1.8rem; letter-spacing: 0.06em; line-height: 1; }
h1 span { color: var(--accent); }

.topbar-meta { font-family: var(--mono); font-size: 0.65rem; color: var(--text-muted); margin-top: 0.3rem; letter-spacing: 0.06em; }

.icon-btn {
  background: var(--surface2); border: 1px solid var(--border2); color: var(--text-dim);
  font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.08em;
  padding: 0.45rem 0.8rem; cursor: pointer; border-radius: var(--radius);
  transition: border-color 0.15s, color 0.15s;
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ── Boards ──────────────────────────────────────────────────────────────── */
.boards-wrap {
  flex: 1; overflow-x: auto; overflow-y: hidden;
  display: flex; gap: 1px; background: var(--border);
}

.board {
  min-width: 280px; max-width: 360px; flex: 1;
  display: flex; flex-direction: column; background: var(--bg);
  overflow: hidden; animation: boardIn 0.3s ease both;
}

@keyframes boardIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.board-header { padding: 1.25rem 1.25rem 0.75rem; border-bottom: 1px solid var(--border); flex-shrink: 0; }

.board-list-id { font-family: var(--mono); font-size: 0.58rem; letter-spacing: 0.12em; color: var(--text-muted); margin-bottom: 0.3rem; }

.board-list-name {
  font-family: var(--display); font-size: 1.3rem; letter-spacing: 0.04em;
  color: var(--accent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.board-count { font-family: var(--mono); font-size: 0.62rem; color: var(--text-dim); margin-top: 0.3rem; }
.board-count strong { color: var(--accent); }

.board-search { padding: 0.75rem 1.25rem; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.board-search input { font-size: 0.75rem; }

.board-body { flex: 1; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--border2) transparent; }

.name-row {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.6rem 1.25rem; border-bottom: 1px solid var(--border);
  transition: background 0.1s; animation: rowIn 0.2s ease both;
}
.name-row:hover { background: var(--accent-dim); }

@keyframes rowIn { from { opacity: 0; } to { opacity: 1; } }

.name-idx { font-family: var(--mono); font-size: 0.58rem; color: var(--text-muted); min-width: 1.6rem; text-align: right; flex-shrink: 0; }
.name-text { font-size: 0.85rem; font-weight: 400; flex: 1; }

/* ── Board states ────────────────────────────────────────────────────────── */
.board-loading, .board-error, .board-empty {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 0.5rem; padding: 2rem; text-align: center;
}

.spinner {
  width: 24px; height: 24px; border: 2px solid var(--border2);
  border-top-color: var(--accent); border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.board-loading-text { font-family: var(--mono); font-size: 0.65rem; color: var(--text-muted); letter-spacing: 0.1em; }
.board-error-icon   { font-size: 1.5rem; color: var(--error); }
.board-error-msg    { font-family: var(--mono); font-size: 0.7rem; color: var(--error); line-height: 1.5; }
.board-empty-msg    { font-family: var(--mono); font-size: 0.7rem; color: var(--text-muted); }

/* ── Empty state ─────────────────────────────────────────────────────────── */
.empty-state {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 0.75rem; padding: 3rem; width: 100%;
}
.empty-icon  { font-size: 3rem; color: var(--text-muted); opacity: 0.4; }
.empty-title { font-family: var(--display); font-size: 1.4rem; letter-spacing: 0.06em; color: var(--text-dim); }
.empty-sub   { font-family: var(--mono); font-size: 0.68rem; color: var(--text-muted); letter-spacing: 0.06em; text-align: center; }
