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

:root {
  --font-primary: "IBM Plex Sans", sans-serif;
  --font-mono: "IBM Plex Mono", monospace;

  --green: #3a9c3a;
  --green-dark: #2d7a2d;
  --green-light: #4db84d;
  --red: #ff4d4d;
  --blue: #00c8ff;
  --bg: #1c1c1c;
  --bg2: #242424;
  --bg3: #2e2e2e;
  --bg4: #383838;
  --stats-bg: #8a8a8a;
  --text: #e8e8e8;
  --text-muted: #888;
  --text-dim: #bbb;
  --border: #3a3a3a;
  --accent: #5bc05b;

  /* ── status / action colours ── */
  --danger: #e06060;
  --danger-18: rgba(224, 96, 96, 0.18);
  --danger-30: rgba(224, 96, 96, 0.3);
  --delete-bg: rgba(195, 51, 51, 0.15);
  --delete-hover: rgba(195, 51, 51, 0.3);
  --delete-subtle: rgba(195, 51, 51, 0.12);
  --warning: #f39c12;
  --warning-18: rgba(243, 156, 18, 0.18);
  --warning-30: rgba(243, 156, 18, 0.3);
  --edit-text: #5ba3d9;
  --edit-bg: rgba(41, 128, 185, 0.15);
  --edit-hover: rgba(41, 128, 185, 0.3);

  /* ── accent tints ── */
  --accent-08: rgba(91, 192, 91, 0.08);
  --accent-18: rgba(91, 192, 91, 0.18);
  --accent-30: rgba(91, 192, 91, 0.3);
  --accent-35: rgba(91, 192, 91, 0.35);

  /* ── muted (inactive badges / toggles) ── */
  --muted-bg: rgba(136, 136, 136, 0.15);
  --muted-border: rgba(136, 136, 136, 0.25);

  /* ── gender intermediates ── */
  --male-dim: #1c7a8a;
  --male-hover: #26a0b8;
  --female-dim: #7a1818;
  --female-hover: #a82222;
  --male-tint-bg: #3acfe814;
  --male-tint-border: #3acfe840;
  --female-tint-bg: #d4404014;
  --female-tint-border: #d4404040;

  --sidebar-w: 38px;
  --header-h: 44px;
  --stats-h: 220px;
}

html,
body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: var(--font-primary);
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: -webkit-fill-available;
  height: 100dvh;
}

/* ── HEADER ── */
#header {
  height: var(--header-h);
  background: var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}
#header h1 {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 9px;
}
.logo-icon {
  display: inline-flex;
  align-items: center;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}
.logo-icon svg {
  width: 100%;
  height: 100%;
}
#header-actions {
  position: absolute;
  right: 14px;
  display: flex;
  gap: 8px;
}
.hbtn {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 5px 10px;
  border-radius: 3px;
  cursor: pointer;
  letter-spacing: 0.05em;
  transition: background 0.15s;
}
.hbtn:hover {
  background: rgba(255, 255, 255, 0.28);
}

/* ── BODY LAYOUT ── */
#layout {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* ── FOOTER ── */
#footer {
  padding: 8px 0;
  background: var(--bg2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

#footer a {
  color: var(--text-muted);
  text-decoration: none;
}

#footer a:hover {
  color: var(--text);
}

#footer .bmc-wrapper {
  display: inline-block;
  transform: scale(0.6);
  transform-origin: center;
}

/* ── SIDEBAR ── */
#sidebar {
  width: var(--sidebar-w);
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  padding-top: 20px;
  gap: 8px;
}
.sidebar-btn {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  cursor: pointer;
  padding: 10px 8px;
  border-radius: 3px;
  transition:
    color 0.15s,
    background 0.15s;
  user-select: none;
}
.sidebar-btn:hover {
  color: var(--accent);
  background: var(--bg3);
}
.sidebar-btn.active {
  color: var(--accent);
}

/* ── MAIN PANEL ── */
#main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── GENERAL BUTTONS ── */
.btn {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 7px 16px;
  border-radius: 3px;
  cursor: pointer;
  letter-spacing: 0.04em;
  border: 1px solid transparent;
  transition: all 0.15s;
}
.btn-primary {
  background: var(--green);
  color: #fff;
}
.btn-primary:hover {
  background: var(--green-light);
}
.btn-secondary {
  background: var(--bg3);
  color: var(--text-muted);
  border-color: var(--border);
}
.btn-secondary:hover {
  color: var(--text);
  background: var(--bg4);
}

.section-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--bg4);
  border-radius: 3px;
}

/* ── HAMBURGER ── */
#hamburger-btn {
  display: flex;
  align-items: center;
}

#hamburger-menu {
  position: fixed;
  top: var(--header-h);
  right: 0;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 0 6px;
  z-index: 50;
  flex-direction: column;
  min-width: 210px;
  box-shadow: -4px 8px 24px rgba(0, 0, 0, 0.5);
  display: none;
}
#hamburger-menu.open {
  display: flex;
}

.ham-item {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.72rem;
  padding: 12px 18px;
  background: none;
  border: none;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  text-align: left;
  letter-spacing: 0.04em;
  transition:
    background 0.15s,
    color 0.15s;
  white-space: nowrap;
}
.ham-item:last-child {
  border-bottom: none;
}
.ham-item:hover {
  background: var(--bg3);
  color: var(--text);
}
.ham-item.danger {
  color: var(--danger);
}
.ham-item.danger:hover {
  background: var(--delete-subtle);
}

/* ── TOOLBAR ACTIONS ── */
#toolbar-actions {
  display: none;
  align-items: center;
  gap: 10px;
}

/* ── empty filter notice ── */
#no-results {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
  font-size: 0.85rem;
  display: none;
}

/* ── FILTERS TOGGLE BUTTON ── */
#filters-toggle-btn {
  display: flex;
  align-items: center;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 3px;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg2);
  color: var(--text-muted);
  transition: all 0.15s;
  white-space: nowrap;
  letter-spacing: 0.04em;
  margin-left: auto;
}
#filters-toggle-btn:hover {
  color: var(--text);
  border-color: var(--text-muted);
}
#filters-toggle-btn.has-active {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-08);
}

#search-row #search-input {
  width: 100%;
  flex: 1;
}

/* ── FILTERS PANEL ── */
#filters-panel {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: var(--bg3);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  flex-wrap: wrap;
  max-height: 120px;
  overflow: hidden;
  opacity: 1;
  transition:
    max-height 0.25s ease,
    opacity 0.2s ease,
    padding 0.25s ease;
}
#filters-panel.collapsed {
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  opacity: 0;
}

