/* ── Layout ── */
.app { display: flex; height: 100vh; }

.sidebar {
  width: 260px;
  min-width: 260px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.main {
  flex: 1;
  overflow-y: auto;
  padding: 32px;
}

/* ── Sidebar ── */
.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid var(--border);
}
.sidebar-header h1 {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.3px;
}
.sidebar-header p {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 4px;
}

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

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 500;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  transition: all 0.15s;
}
.nav-item:hover { background: var(--surface2); color: var(--text); }
.nav-item.active { background: var(--accent); color: #fff; }
.nav-item .icon { font-size: 16px; width: 20px; text-align: center; }

.nav-section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
  padding: 16px 12px 6px;
}

.cycle-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: 12px;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  transition: all 0.15s;
  cursor: pointer;
}
.cycle-list-item:hover { background: var(--surface2); color: var(--text); }
.cycle-list-item.active { background: var(--surface2); color: var(--accent-light); }

.cycle-status {
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 10px;
  font-weight: 600;
  text-transform: uppercase;
}
.cycle-status.active { background: rgba(0,184,148,0.15); color: var(--green); }
.cycle-status.planned { background: rgba(116,185,255,0.15); color: var(--blue); }
.cycle-status.completed { background: rgba(139,144,160,0.15); color: var(--text-dim); }

.nav-section-collapsible { margin: 0; }
.nav-section-collapsible summary { list-style: none; }
.nav-section-collapsible summary::-webkit-details-marker { display: none; }
.nav-section-collapsible summary::after { content: "▸"; float: right; font-size: 10px; transition: transform 0.15s; }
.nav-section-collapsible[open] summary::after { transform: rotate(90deg); }

/* ── Page Headers ── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}
.page-header h2 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

/* ── Tabs ── */
.tab-bar {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.tab-btn {
  padding: 10px 18px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 600;
  transition: all 0.15s;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--accent-light); border-bottom-color: var(--accent); }

/* ── Voter Name Bar ── */

/* ── Flash Messages ── */
.flash {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 20px;
}
.flash-notice { background: rgba(0,184,148,0.12); color: var(--green); border: 1px solid rgba(0,184,148,0.25); }
.flash-alert { background: rgba(225,112,85,0.12); color: var(--red); border: 1px solid rgba(225,112,85,0.25); }

/* ── View Header ── */
.view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}
.view-header h2 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
}
.header-actions { display: flex; gap: 8px; }

/* ── Section Title ── */
.section-title {
  font-size: 15px;
  font-weight: 700;
  margin: 24px 0 12px;
}

/* ── Tab Panel ── */
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Sidebar Footer ── */
.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--border);
  margin-top: auto;
}
.sidebar-footer-user {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.sidebar-user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.sidebar-user-role {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-dim);
  background: var(--surface2);
  padding: 2px 8px;
  border-radius: 10px;
}
.sidebar-footer-actions {
  display: flex;
  gap: 6px;
}

/* ── Links ── */
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent-light); }

/* ── Pitch Detail ── */
.pitch-meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 24px; }
.pitch-detail-grid { display: grid; gap: 20px; }
.pitch-section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.pitch-section h3 { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-dim); margin-bottom: 10px; }
.pitch-section p { font-size: 14px; line-height: 1.6; }
.score-display { margin-bottom: 16px; }
.score-large { font-size: 28px; padding: 8px 16px; }
.score-breakdown { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.score-factor { background: var(--surface2); border-radius: var(--radius-sm); padding: 10px; text-align: center; }
.factor-label { display: block; font-size: 10px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.factor-value { font-size: 20px; font-weight: 700; }
.pitch-votes { margin-top: 24px; }
.pitch-votes h3 { font-size: 15px; font-weight: 700; margin-bottom: 10px; }

/* ── Form Errors ── */
.form-errors { background: rgba(225,112,85,0.12); border: 1px solid rgba(225,112,85,0.25); border-radius: var(--radius-sm); padding: 12px 16px; margin-bottom: 16px; color: var(--red); font-size: 13px; }
.form-errors ul { margin: 4px 0 0; padding-left: 18px; }
.form-errors li { margin-bottom: 2px; }

/* ── Cycle Views ── */
.cycle-meta-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
.meta-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; }
.meta-label { display: block; font-size: 10px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.cycle-notes { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 20px; font-size: 14px; }
.cycles-list { display: grid; gap: 12px; }
.cycle-card { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; transition: border-color 0.15s; }
.cycle-card:hover { border-color: var(--accent); }
.cycle-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cycle-card-header h3 { font-size: 16px; font-weight: 700; }
.cycle-card-meta { font-size: 12px; color: var(--text-dim); display: flex; gap: 16px; }

/* ── Form Actions ── */
.form-actions { display: flex; gap: 10px; margin-top: 24px; }

/* ── Pitch List ── */
.pitch-list { display: grid; gap: 12px; }

/* ── Score Preview ── */
.score-preview { margin-top: 10px; font-size: 14px; font-weight: 600; }
