/* Layout chrome — sidebar, top-bar, filter-bar, sticky header, content shell, responsive breakpoints. */

.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: var(--sidebar-width); background: var(--navy);
  color: #fff; display: flex; flex-direction: column;
  z-index: 100; overflow-y: auto;
  box-shadow: 2px 0 12px rgba(0,0,0,0.2);
}

.sidebar-brand { padding: 16px 8px 14px; padding-right: 28px; border-bottom: 1px solid rgba(255,255,255,0.1); position: relative; }

.brand-logo-wrap { display: flex; flex-direction: column; align-items: center; }

.brand-logos {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 0 8px;
}

.brand-logo-1915 { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; }

.logo-1915-svg { width: 50px; height: auto; display: block; }

.logo-1915-svg path { stroke: white; stroke-width: 1.2px; paint-order: stroke fill; }

.logo-1915-south-text {
  display: block; color: white; font-size: 8.5px; font-weight: 700;
  letter-spacing: 3px; text-align: center; margin-top: 2px;
  font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  text-indent: 3px; text-transform: uppercase;
}

.brand-divider-line {
  width: 1px; height: 36px; background: rgba(255,255,255,0.25); flex-shrink: 0;
}

.brand-logo-ashley { flex: 0 0 auto; }

.logo-ashley-svg { width: 100px; height: auto; display: block; }

.sidebar-nav { flex: 1; padding: 16px 0; }

.nav-item {
  display: block; padding: 10px 20px; color: rgba(255,255,255,0.7);
  text-decoration: none; font-size: 14px; cursor: pointer;
  border-left: 3px solid transparent; transition: all 0.15s;
}

.nav-item:hover { background: rgba(219,236,241,0.1); color: #fff; }

.nav-item.active { border-left-color: var(--ashley-orange); color: #fff; background: rgba(219,236,241,0.08); font-weight: 600; }

.sidebar-footer { padding: 16px 20px; border-top: 1px solid rgba(255,255,255,0.1); font-size: 11px; color: rgba(255,255,255,0.35); }

.main { margin-left: var(--sidebar-width); min-height: 100vh; background: #fff; }

.sticky-header-wrap {
  position: sticky; top: 0; z-index: 50;
  background: #fff;
  box-shadow: 0 2px 4px rgba(0,0,0,0.04);
}

/* Compact page header. Single row containing the page title + subtitle (one
   line) on the left and the sub-tabs / actions on the right. Padding is
   tight so the table starts close to the chrome. */
.top-bar {
  padding: 0 16px; background: #fff;
  border-bottom: 1px solid #E5E7EB;
  display: flex; align-items: center;
  gap: 16px;
  min-height: 44px;
}

.top-bar h2 {
  font-size: var(--fs-title); color: var(--navy); font-weight: 700; letter-spacing: 0.2px;
  white-space: nowrap;
  display: flex; align-items: center; padding: 0; margin: 0;
}

.filter-group { display: flex; align-items: center; gap: 6px; }

.filter-group label { font-size: 10px; color: #6b7280; font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px; }

/* Selects and date inputs match the preset-btn footprint (same padding,
   same border token) so the filter bar reads as one continuous control row
   instead of "branded buttons + browser-default inputs". */
.filter-group select, .filter-group input[type="date"] {
  padding: 4px 8px; border: 1px solid var(--table-border); border-radius: 6px;
  font-size: 12px; font-family: var(--font-stack); background: #fff; color: var(--navy); min-width: 0;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.filter-group select:hover, .filter-group input[type="date"]:hover {
  background: var(--icy-blue);
  border-color: var(--primary-blue);
}

.filter-group select:focus, .filter-group input:focus {
  outline: none; border-color: var(--primary-blue); background: #fff;
  box-shadow: 0 0 0 2px rgba(63,115,141,0.15);
}

/* Brand the native calendar icon so it doesn't read as default-grey
   against the navy/icy-blue chrome. Webkit-only (covers Chrome/Edge/Safari). */
.filter-group input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer; opacity: 0.55;
  filter: invert(20%) sepia(38%) saturate(1100%) hue-rotate(160deg);
}
.filter-group input[type="date"]:hover::-webkit-calendar-picker-indicator { opacity: 0.9; }

.preset-btn {
  padding: 4px 8px; border: 1px solid #d1d5db; border-radius: 6px;
  font-size: 11px; background: #fff; cursor: pointer; font-family: var(--font-stack);
  color: #374151; transition: all 0.15s; white-space: nowrap;
}

.preset-btn:hover { background: var(--icy-blue); border-color: var(--primary-blue); }

.preset-btn.active { background: var(--primary-blue); color: #fff; border-color: var(--primary-blue); }

.content { padding: 12px 16px; width: 100%; box-sizing: border-box; }

.placeholder-view {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 500px; color: #9ca3af;
}

.placeholder-view .ph-icon { font-size: 48px; margin-bottom: 16px; width: 80px; height: 80px;
  background: var(--icy-blue); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--primary-blue); }

.placeholder-view h3 { font-size: 20px; color: var(--navy); margin-bottom: 8px; }

.placeholder-view p { font-size: 14px; color: #6b7280; }

::-webkit-scrollbar { width: 6px; height: 6px; }

::-webkit-scrollbar-track { background: transparent; }

::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }

.shared-filter-bar::-webkit-scrollbar { height: 4px; }

/* Title + subtitle on a SINGLE row -- the previous stack ate ~50px of
   vertical space on every view. Subtitle is a small grey continuation
   after a bullet separator: "RSA Leaderboard . Sales associate ..." */
.top-bar-titles {
  display: flex; align-items: baseline; gap: 8px;
  flex: 1 1 auto; min-width: 0;
}

.top-bar-titles h2 { padding: 0 !important; margin: 0 !important; line-height: 1.2; }

.top-bar-subtitle {
  font-size: var(--fs-label); color: #6b7280; font-weight: 400; letter-spacing: 0.15px;
  line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.top-bar-subtitle:not(:empty)::before { content: '\2022 \00a0'; color: #cbd5e1; }
.top-bar-subtitle:empty { display: none; }

.nav-group-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: rgba(255,255,255,0.6);
  padding: 14px 20px 8px;
  cursor: pointer;
  user-select: none;
  transition: color 0.15s;
}

.nav-group-label:hover { color: rgba(255,255,255,0.9); }

.nav-chevron {
  display: inline-block;
  transition: transform 0.2s;
  font-size: 10px;
  margin-right: 4px;
}

.nav-group-label.collapsed .nav-chevron { transform: rotate(0deg); }

.nav-group-label:not(.collapsed) .nav-chevron { transform: rotate(90deg); }

.sidebar { transition: width 0.2s; }

.main { margin-left: var(--sidebar-width); transition: margin-left 0.2s; }

.collapse-btn {
  background: none; border: none; color: rgba(255,255,255,0.6);
  font-size: 16px; cursor: pointer; padding: 2px 8px; border-radius: 4px;
  align-self: flex-end; position: absolute; top: 28px; right: 6px;
}

.collapse-btn:hover { color: #fff; background: rgba(255,255,255,0.1); }

.sidebar.collapsed { width: 56px; overflow: hidden; }

.sidebar.collapsed .sidebar-nav { display: none; }

.sidebar.collapsed .sidebar-footer { display: none; }

.sidebar.collapsed .sidebar-brand { padding: 16px; text-align: center; justify-content: center; }

.sidebar.collapsed .brand-logos { display: none; }

.sidebar.collapsed .collapse-btn { margin: 0 auto; }

.sidebar.collapsed + .main { margin-left: 56px; }

@media (max-width: 1024px) {
  .charts-row { grid-template-columns: 1fr; }

  .chart-card { min-height: 400px; }

  .content { padding: 12px 16px; }

  .kpi-row { gap: 8px; margin-bottom: 8px; }

  .top-bar h2 { font-size: 15px; }

  .view-tab { font-size: 12px; padding: 10px 14px; }

  .shared-filter-bar { padding: 8px 12px; gap: 6px; }

}

@media (max-width: 768px) {
  .tree-controls { flex-direction: column; align-items: flex-start; }

  .tree-presets { margin-left: 0; }

  .kpi-row { grid-template-columns: repeat(2, 1fr); }

  .chart-card { min-height: 350px; }

  .top-bar { padding: 0 12px; }

  .top-bar h2 { font-size: 14px; }

  .view-tab { font-size: 11px; padding: 8px 10px; }

  .shared-filter-bar { flex-direction: column; align-items: flex-start; }

}

@media (min-width: 1400px) {
  .content { padding: 16px 24px; }

  .chart-card { min-height: 520px; }

  .kpi-card { padding: 16px 14px; }

  .kpi-value { font-size: clamp(20px, 2vw, 28px); }

  .kpi-label { font-size: 13px; }

  .top-bar { padding: 0 24px; }

  .top-bar h2 { font-size: 19px; padding: 14px 0; }

  .view-tab { font-size: 14px; padding: 14px 22px; }

}

@media (min-width: 1280px) {
  .kpi-row { grid-template-columns: repeat(6, 1fr); }

}

@media (min-width: 1800px) {
  .content { padding: 20px 32px; }

  .chart-card { min-height: 600px; }

  .charts-row { gap: 24px; }

}

@media (max-width: 900px) {
  .kpi-row { grid-template-columns: repeat(2, 1fr); }

  .charts-row { grid-template-columns: 1fr; }

}