/* ─── HEADER ──────────────────────────────────────────────────────────────── */

header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-left h1 {
  font-size: 16px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.5px;
}
.header-left p {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 2px;
}
.header-right { display: flex; gap: 8px; align-items: center; }

/* ─── STATS BAR ───────────────────────────────────────────────────────────── */

.stats-bar {
  display: flex;
  gap: 12px;
  padding: 16px 24px;
  overflow-x: auto;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 18px;
  min-width: 130px;
  flex-shrink: 0;
}
.stat-card .stat-val   { font-size: 24px; font-weight: 700; line-height: 1; }
.stat-card .stat-label { font-size: 11px; color: var(--text-dim); margin-top: 4px; }

/* ─── APP BODY (sidebar + content) ────────────────────────────────────────── */

.app-body {
  display: flex;
  height: calc(100vh - 65px);
  overflow: hidden;
}

/* ─── SIDEBAR ─────────────────────────────────────────────────────────────── */

.sidebar {
  width: 200px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: 20px 10px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.sidebar-section { display: flex; flex-direction: column; }

.sidebar-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 0 8px;
  margin-bottom: 6px;
}

/* Sidebar filter buttons */
.sidebar-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  text-align: left;
  padding: 7px 10px;
  border-radius: 8px;
  margin-bottom: 2px;
  font-size: 13px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.15s;
}
.sidebar-btn:hover         { background: var(--surface2); color: var(--text); }
.sidebar-btn.active        { background: var(--surface2); color: var(--text); border-color: var(--border); }

/* ─── CONTENT AREA ────────────────────────────────────────────────────────── */

.content-area {
  flex: 1;
  overflow: hidden;       /* content-area itself does NOT scroll */
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* ─── MAIN / LIST SECTIONS ────────────────────────────────────────────────── */

/* Only #main scrolls — stats bar stays pinned above it */
.main {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px 80px;
}

.section { margin-bottom: 24px; }

.section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}
.section-header h2 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}
.section-header .count {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1px 7px;
  font-size: 11px;
  color: var(--text-dim);
}

.section-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.dot-red    { background: var(--red); }
.dot-yellow { background: var(--accent); }
.dot-blue   { background: var(--blue); }
.dot-green  { background: var(--green); }

/* ─── FOCUS MODE ──────────────────────────────────────────────────────────── */

.focus-badge {
  display: none;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
  font-size: 11px;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 3px 10px;
  cursor: pointer;
  width: fit-content;
  transition: filter 0.15s;
}
.focus-badge:hover { filter: brightness(1.15); }

body.focus-mode .sidebar      { display: none !important; }
body.focus-mode .stats-bar    { display: none !important; }
body.focus-mode .header-right { display: none !important; }
body.focus-mode .focus-badge  { display: flex; }

.focus-view-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.focus-view-header h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}
.focus-view-header .count {
  background: var(--red-dim);
  border: 1px solid var(--red);
  color: var(--red);
  border-radius: 10px;
  padding: 2px 9px;
  font-size: 12px;
  font-weight: 600;
}

/* ─── RESPONSIVE ──────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
  .app-body      { flex-direction: column; height: auto; overflow: visible; }

  .sidebar {
    width: 100%;
    flex-direction: row;
    padding: 10px 16px;
    gap: 16px;
    border-right: none;
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
  }

  .sidebar-section  { flex-direction: row; align-items: center; gap: 4px; flex-shrink: 0; }
  .sidebar-label    { display: none; } /* hide labels on mobile, space is tight */

  .sidebar-btn { padding: 5px 10px; white-space: nowrap; margin-bottom: 0; font-size: 12px; }

  .content-area { overflow: visible; }

  header, .stats-bar, .main {
    padding-left: 16px;
    padding-right: 16px;
  }
}
