/* ══════════════════════════════════════════════════
   Layout
══════════════════════════════════════════════════ */
.layout {
  max-width: 1400px; margin: 0 auto;
  display: block;
  min-height: calc(100vh - var(--header-h));
}

/* ══════════════════════════════════════════════════
   Sidebar — desktop
══════════════════════════════════════════════════ */
.sidebar {
  border-right: 1px solid var(--border);
  padding: 18px 13px;
  position: sticky; top: var(--header-h);
  height: calc(100vh - var(--header-h));
  overflow-y: auto; background: var(--surface);
}
.sidebar::-webkit-scrollbar { width: 3px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.sidebar-overlay { display: none; }

.sidebar-section { margin-bottom: 18px; }
.sidebar-label {
  font-size: .65rem; font-weight: 500; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted);
  margin-bottom: 6px; padding-bottom: 5px;
  border-bottom: 1px solid var(--border);
}
.filter-btn {
  display: block; width: 100%; text-align: left;
  padding: 6px 10px; background: transparent; border: none;
  cursor: pointer; border-radius: 6px; font-size: .83rem;
  color: var(--ink2); transition: all .15s; margin-bottom: 1px;
  touch-action: manipulation;
}
.filter-btn:hover { background: var(--bg2); }
.filter-btn.active { background: var(--accent); color: #fff; }
.filter-dynamic .filter-btn {
  font-size: .79rem; padding: 5px 10px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-select {
  width: 100%; padding: 7px 10px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 6px; color: var(--ink); font-size: .83rem; outline: none;
}
.sidebar-select:focus { border-color: var(--accent); }
.btn-clear-filters {
  display: block; width: 100%; padding: 7px;
  border-radius: 6px; background: transparent;
  border: 1px dashed var(--border2); color: var(--muted);
  font-size: .79rem; cursor: pointer; transition: all .15s; margin-top: 4px;
}
.btn-clear-filters:hover { color: var(--accent); border-color: var(--accent); }

/* ══════════════════════════════════════════════════
   Main
══════════════════════════════════════════════════ */
.main { padding: 16px 20px 60px; min-width: 0; }

/* ══════════════════════════════════════════════════
   Search
══════════════════════════════════════════════════ */
.search-bar {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); padding: 0 14px;
  margin-bottom: 12px; transition: border-color .2s;
}
.search-bar:focus-within { border-color: var(--accent); }
.search-bar svg { color: var(--muted); flex-shrink: 0; }
.search-bar input {
  flex: 1; border: none; background: transparent;
  padding: 11px 0; font-size: .9rem; color: var(--ink); outline: none;
}
.search-bar input::placeholder { color: var(--muted); }
.search-count { font-size: .73rem; color: var(--muted); white-space: nowrap; }

/* ══════════════════════════════════════════════════
   Toolbar row
══════════════════════════════════════════════════ */
.toolbar-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; margin-bottom: 14px; flex-wrap: wrap;
}
.active-filters { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; }
.filter-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 20px;
  background: var(--ink); color: var(--bg);
  font-size: .73rem; cursor: pointer; border: none;
  transition: background .15s;
}
.filter-chip:hover { background: var(--accent); }
.view-toggle { display: flex; gap: 4px; flex-shrink: 0; }
.view-btn {
  width: 32px; height: 32px; border-radius: 6px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: all .15s;
}
.view-btn.active, .view-btn:hover {
  background: var(--ink); color: var(--bg); border-color: var(--ink);
}
