/* =============================================================================
   Campaigns CSS
   ============================================================================= */

/* -----------------------------------------------------------------------------
   List Page
   ----------------------------------------------------------------------------- */

.campaigns-list-page .page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.campaigns-list-page .page-header h2 {
  margin: 0;
  color: var(--text-primary);
}

/* -----------------------------------------------------------------------------
   Adventure Source Badges & Lineage Links
   ----------------------------------------------------------------------------- */

.badge.adventure-source {
  background: var(--info-bg);
  color: var(--info);
  border: 1px solid rgba(96, 165, 250, 0.3);
}

.lineage-link {
  color: var(--info);
  font-size: 0.85rem;
  text-decoration: none;
}

.lineage-link:hover {
  text-decoration: underline;
}

/* Read-only adventure entity cards */
.section-panel.adventure-entity {
  border-left: 3px solid rgba(96, 165, 250, 0.4);
  opacity: 0.95;
}

/* -----------------------------------------------------------------------------
   Entity Cards (list items on campaign entity pages)
   ----------------------------------------------------------------------------- */

.entity-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 0.75rem;
}

@media (max-width: 680px) {
  .entity-cards-grid {
    grid-template-columns: 1fr;
  }
}

.entity-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  transition: border-color 0.15s, background 0.15s;
}
.entity-card:hover {
  background: var(--bg-hover);
}

a.entity-card {
  display: block;
  text-decoration: none;
  color: inherit;
}
a.entity-card:hover {
  text-decoration: none;
}

.entity-card.adventure-entity {
  border-left: 3px solid rgba(96, 165, 250, 0.4);
  opacity: 0.95;
}

/* Domain accent colors for entity cards */
.entity-card.campaign-card {
  border-left: 3px solid rgba(230, 57, 70, 0.4);  /* accent-red for campaigns */
}

.entity-card.character-card {
  border-left: 3px solid rgba(96, 165, 250, 0.4);  /* info blue for characters */
}

.entity-card.cosmos-card {
  border-left: 3px solid rgba(74, 222, 128, 0.4);  /* success green for cosmos */
}

.entity-card.game-system-card {
  border-left: 3px solid rgba(251, 191, 36, 0.4);  /* warning yellow for game systems */
}

.entity-card.adventure-card {
  border-left: 3px solid rgba(168, 85, 247, 0.4);  /* purple for adventures */
}

.entity-card.workbench-card {
  border-left: 3px solid rgba(168, 85, 247, 0.4);  /* purple for workbench */
}

/* Domain hover border colors */
.entity-card.game-system-card:hover { border-color: rgba(251, 191, 36, 0.7); }
.entity-card.cosmos-card:hover { border-color: rgba(74, 222, 128, 0.7); }
.entity-card.adventure-card:hover { border-color: rgba(168, 85, 247, 0.7); }
.entity-card.campaign-card:hover { border-color: rgba(230, 57, 70, 0.7); }
.entity-card.character-card:hover { border-color: rgba(96, 165, 250, 0.7); }
.entity-card.workbench-card:hover { border-color: rgba(168, 85, 247, 0.7); }

.entity-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.entity-card-header h4 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.entity-card-header h4 a {
  color: var(--text-primary);
  text-decoration: none;
}

.entity-card-header h4 a:hover {
  color: var(--info);
}

.entity-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  flex-shrink: 0;
}

.entity-card-description,
.entity-card-body {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin: 0 0 0.5rem;
  line-height: 1.4;
}

.entity-card-gm-notes {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin: 0 0 0.5rem;
  font-style: italic;
  line-height: 1.3;
}

.entity-card-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
  margin-bottom: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.entity-card-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

/* Map thumbnail within entity card */
.entity-card-thumbnail {
  max-width: 120px;
  max-height: 80px;
  border-radius: 4px;
  border: 1px solid var(--border-primary);
  margin-bottom: 0.5rem;
}

/* Clock segments within entity card */
.entity-card .clock-progress {
  margin-bottom: 0.5rem;
}

/* NPC stat summary in entity card */
.entity-card-stats {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

/* Session hint text */
.entity-card .session-hint {
  font-size: 0.85rem;
}

/* Tag badges within entity card */
.entity-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.35rem;
}

.entity-card-tags .badge.tag {
  font-size: 0.7rem;
  padding: 0.1rem 0.4rem;
  background: rgba(96, 165, 250, 0.15);
  color: var(--text-secondary);
  border: 1px solid rgba(96, 165, 250, 0.25);
}

.entity-card-tag {
  font-size: 0.75rem;
  color: var(--info);
  background: rgba(96, 165, 250, 0.1);
  padding: 0.15rem 0.5rem;
  border-radius: 12px;
}

/* Session View quick-launch button on character cards */
.entity-card-session-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--success);
  background: rgba(74, 222, 128, 0.1);
  border: 1px solid rgba(74, 222, 128, 0.3);
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s;
}
.entity-card-session-btn:hover {
  background: rgba(74, 222, 128, 0.2);
}

/* -----------------------------------------------------------------------------
   Detail Page
   ----------------------------------------------------------------------------- */

.campaign-detail-page {
  max-width: 800px;
}

.campaign-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.campaign-header h2 {
  margin: 0;
  color: var(--text-primary);
}

.campaign-name-edit {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.campaign-name-edit input {
  flex: 1;
  font-size: 1.25rem;
  font-weight: 600;
}

.campaign-sections {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.campaign-section {
  padding: 1.25rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-primary);
  border-radius: 6px;
}

.campaign-section h3 {
  margin: 0 0 1rem 0;
  color: var(--text-primary);
  font-size: 1rem;
}

/* -----------------------------------------------------------------------------
   Players Section
   ----------------------------------------------------------------------------- */

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.section-header h3 {
  margin: 0;
}

.player-count {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: normal;
}

.player-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.player-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.85rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: 6px;
  transition: border-color 0.15s;
}

.player-item:hover {
  border-color: var(--border-emphasis);
}

.player-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-red-bg);
  color: var(--accent-red);
  font-weight: 600;
  font-size: 0.85rem;
  flex-shrink: 0;
  text-transform: uppercase;
}

.player-name {
  flex: 1;
  color: var(--text-primary);
  font-weight: 500;
}

.badge.player {
  background: var(--info-bg);
  color: var(--info);
  font-size: 0.7rem;
  padding: 0.15rem 0.45rem;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* -----------------------------------------------------------------------------
   Invite Form
   ----------------------------------------------------------------------------- */

.invite-form {
  margin: 0;
}

.invite-form h4 {
  margin: 0 0 0.75rem 0;
  color: var(--text-primary);
  font-size: 1rem;
}

.invite-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.invite-row input {
  flex: 1;
}

/* Invite search */
.invite-search-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.invite-search-input {
  width: 100%;
  box-sizing: border-box;
}

.invite-search-results {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: 4px;
  max-height: 200px;
  overflow-y: auto;
}

.invite-search-result {
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  color: var(--text-primary);
  font-size: 0.9rem;
}

.invite-search-result:hover {
  background: var(--bg-hover);
  color: var(--accent-red);
}

.invite-search-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 0.25rem 0;
}

.invite-selected-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.invite-selected-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--accent-red-bg);
  border: 1px solid var(--accent-red);
  color: var(--text-primary);
  border-radius: 4px;
  padding: 0.3rem 0.6rem;
  font-size: 0.875rem;
}

.invite-email-fallback {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--border-primary);
}

.invite-email-fallback .text-muted {
  font-size: 0.8rem;
  margin: 0 0 0.5rem 0;
  color: var(--text-muted);
}

/* -----------------------------------------------------------------------------
   Campaign Status
   ----------------------------------------------------------------------------- */

.campaign-status-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* -----------------------------------------------------------------------------
   House Rules (Mechanics Overrides)
   ----------------------------------------------------------------------------- */

.override-section .section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.override-section .section-header h3 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.house-rules-count {
  font-size: 0.8rem;
  font-weight: normal;
  color: var(--text-secondary);
}

.override-locked .section-header .badge {
  margin-left: 0.5rem;
}

.override-group {
  margin-bottom: 1.25rem;
}

.override-group h4 {
  margin: 0 0 0.5rem 0;
  color: var(--text-secondary);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.override-group h5 {
  margin: 0.75rem 0 0.25rem 0;
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.override-hidden-row {
  opacity: 0.5;
}

.override-hidden-row input[type="text"] {
  opacity: 0.5;
}

.override-summary {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.override-summary-group {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.override-summary-group strong {
  color: var(--text-primary);
}

/* Custom Skill Form */

.custom-skills {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-primary);
}

.custom-skill-form {
  margin-top: 0.5rem;
}

.custom-skill-fields {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.custom-skill-fields input,
.custom-skill-fields select {
  flex: 1;
}

/* Mechanic Flags */

.mechanic-flag {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0;
  cursor: pointer;
  color: var(--text-primary);
}

.mechanic-flag input[type="checkbox"] {
  cursor: pointer;
}

/* Skill group within overrides */

.override-section .skill-group {
  margin-bottom: 0.75rem;
}

.override-editing .form-actions {
  margin-top: 1rem;
  display: flex;
  gap: 0.5rem;
}

/* -----------------------------------------------------------------------------
   Campaign Templates Section
   ----------------------------------------------------------------------------- */

.campaign-templates-section .section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.campaign-templates-section .section-header h3 {
  margin: 0;
}

.templates-group {
  margin-bottom: 1rem;
}

.templates-group h4 {
  margin: 0 0 0.5rem 0;
  color: var(--text-secondary);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.template-hidden-row {
  opacity: 0.5;
}

.template-hide-actions {
  margin-top: 0.5rem;
}

.template-create-form {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-primary);
}

.template-create-form h4 {
  margin: 0 0 0.75rem 0;
  color: var(--text-secondary);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.template-create-form h5 {
  margin: 0.75rem 0 0.25rem 0;
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.template-fields-editor {
  margin-top: 0.75rem;
}

.template-add-field {
  margin-top: 0.5rem;
}

.template-field-inputs {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.template-field-inputs input,
.template-field-inputs select {
  flex: 1;
}

.template-create-form .form-actions {
  margin-top: 1rem;
  display: flex;
  gap: 0.5rem;
}

/* -----------------------------------------------------------------------------
   Invite Links Section
   ----------------------------------------------------------------------------- */

.invite-links-section .section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.invite-links-section .section-header h3 {
  margin: 0;
}

.invite-links-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.invite-link-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.85rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: 6px;
}

.invite-link-url {
  flex: 1;
  font-size: 0.85rem;
  color: var(--text-primary);
  word-break: break-all;
}

.invite-link-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

.invite-link-usage {
  font-size: 0.8rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.invite-link-card {
  margin-bottom: 0.5rem;
}

.invite-email-form {
  padding: 0.75rem 1rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-primary);
  border-radius: 6px;
  margin-top: 0.5rem;
}

.invite-email-form .form-field {
  margin-bottom: 0.5rem;
}

.invite-email-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

/* -----------------------------------------------------------------------------
   Invite Redeem Page
   ----------------------------------------------------------------------------- */

.invite-redeem-page {
  max-width: 500px;
  margin: 2rem auto;
  text-align: center;
}

.invite-redeem-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.invite-redeem-error .message-box {
  width: 100%;
}

/* -----------------------------------------------------------------------------
   Publication Source Groups (Game System / Cosmos / Adventure)
   ----------------------------------------------------------------------------- */

.pub-source-sections {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.pub-source-group {
  padding: 1rem;
  border: 1px solid var(--border-primary);
  border-radius: 6px;
  background: var(--bg-primary);
}

.pub-source-group h4 {
  margin: 0 0 0.5rem;
  color: var(--text-primary);
}

.pub-source-group h5 {
  margin: 0.75rem 0 0.25rem;
  color: var(--text-secondary);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pub-source-group .admin-table {
  margin-bottom: 0.5rem;
}

.excluded-row td {
  opacity: 0.6;
}

/* -----------------------------------------------------------------------------
   Publication Cover Images & ISBN Lookup
   ----------------------------------------------------------------------------- */

.pub-cover-thumb {
  width: 60px;
  height: auto;
  border-radius: 3px;
  border: 1px solid var(--border-primary);
}

.pub-cover-placeholder {
  width: 60px;
  height: 80px;
  background: var(--border-primary);
  border-radius: 3px;
  border: 1px solid var(--border-emphasis);
}

.add-pub-mode-toggle {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.isbn-lookup-add {
  margin-top: 0.5rem;
}

.isbn-lookup-add .isbn-lookup-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.isbn-lookup-add .isbn-lookup-row input {
  flex: 1;
}

.isbn-preview-card {
  margin-top: 1rem;
  padding: 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: 6px;
  display: flex;
  gap: 1rem;
}

.isbn-preview-cover {
  width: 100px;
  height: auto;
  border-radius: 4px;
  border: 1px solid var(--border-primary);
  flex-shrink: 0;
}

.isbn-preview-info {
  flex: 1;
}

.isbn-preview-info h4 {
  color: var(--text-primary);
  margin: 0 0 0.5rem;
}

.isbn-preview-info p {
  color: var(--text-secondary);
  margin: 0.25rem 0;
  font-size: 0.9rem;
}

.isbn-preview-authors {
  font-style: italic;
}

.isbn-preview-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

/* -----------------------------------------------------------------------------
   Campaign Sidebar Navigation
   ----------------------------------------------------------------------------- */

.campaign-nav {
  background: var(--bg-primary);
  padding: 1.5rem;
  border-radius: 8px;
  border: 1px solid var(--border-primary);
}

.campaign-nav .nav-header {
  border-bottom: 2px solid var(--accent-red);
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
}

.campaign-nav h3 {
  margin: 0 0 0.25rem 0;
  font-size: 1.1rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.campaign-nav .nav-status {
  margin-top: 0.25rem;
}

.campaign-nav .nav-status .badge {
  font-size: 0.6rem;
  padding: 0.15rem 0.35rem;
}

.campaign-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.campaign-nav li {
  margin-bottom: 0.25rem;
}

.campaign-nav li.nav-divider {
  margin: 0.75rem 0;
  border-top: 1px solid var(--border-primary);
}

.campaign-nav a {
  display: block;
  padding: 0.6rem 1rem;
  text-decoration: none;
  color: var(--text-secondary);
  border-radius: 4px;
  transition: background 0.2s, color 0.2s;
  font-size: 0.9rem;
}

.campaign-nav a:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.campaign-nav a.active {
  background: var(--accent-red);
  color: #ffffff;
  font-weight: 500;
}

.campaign-nav .nav-section-label {
  display: block;
  padding: 0.5rem 1rem 0.25rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.campaign-nav .nav-section-toggle {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.campaign-nav .nav-section-toggle:hover {
  color: var(--text-secondary);
}

.campaign-nav .nav-toggle-arrow {
  font-size: 0.7rem;
}

.campaign-nav .nav-indent a {
  padding-left: 1.75rem;
  font-size: 0.85rem;
}

/* -----------------------------------------------------------------------------
   Customize Features Grid
   ----------------------------------------------------------------------------- */

.customize-features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.customize-feature-card {
  padding: 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.customize-feature-card a {
  color: var(--accent-red);
  text-decoration: none;
  font-weight: 500;
}

.customize-feature-card a:hover {
  text-decoration: underline;
}

.customize-feature-card .feature-status {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* -----------------------------------------------------------------------------
   Config Diff View
   ----------------------------------------------------------------------------- */

.config-diff-inline {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-primary);
}

.config-diff-inline h3 {
  margin: 0 0 1rem;
  font-size: 1rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.config-diff-view {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.config-diff-empty {
  padding: 2rem;
  text-align: center;
}

.config-diff-section {
  padding: 1rem 1.25rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-primary);
  border-radius: 6px;
}

.config-diff-section h4 {
  margin: 0 0 0.75rem 0;
  color: var(--text-secondary);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.config-diff-default {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0;
  font-style: italic;
}

.config-diff-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.config-diff-table th {
  text-align: left;
  padding: 0.5rem 0.75rem;
  color: var(--text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 1px solid var(--border-primary);
  background: var(--bg-secondary);
}

.config-diff-table td {
  padding: 0.5rem 0.75rem;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-primary);
}

.config-diff-table tr.changed td {
  background: rgba(250, 204, 21, 0.06);
}

.config-diff-label {
  font-weight: 500;
  color: var(--text-secondary);
}

.config-diff-base {
  color: var(--text-muted);
}

.config-diff-badge {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 0.1rem 0.4rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-radius: 3px;
  background: var(--warning-bg);
  color: var(--warning);
}

.config-diff-badge.removed {
  background: var(--error-bg);
  color: var(--error);
}

/* Placeholder pages */

.placeholder-page {
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
}

.placeholder-page h2 {
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.placeholder-page p {
  font-size: 0.95rem;
}

/* =============================================================================
   Campaign Special Items Page
   ============================================================================= */

.campaign-special-items {
  max-width: 800px;
}

.campaign-grant-form {
  border: 1px solid var(--border-primary);
  border-radius: 4px;
  padding: 1rem;
  margin-bottom: 1.5rem;
  background: var(--bg-secondary);
}

.campaign-grant-form h3 {
  margin: 0 0 0.75rem;
  color: var(--text-primary);
}

.campaign-grant-form .form-field {
  margin-bottom: 0.5rem;
}

.campaign-grant-form-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.special-items-character-group {
  margin-bottom: 1.5rem;
}

.special-items-char-header {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin: 0 0 0.5rem;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid var(--border-primary);
}

/* =============================================================================
   Campaign NPC Roster
   ============================================================================= */

.npc-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.npc-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.npc-card-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.npc-card-title h4 {
  margin: 0;
  cursor: pointer;
}

.npc-card-actions {
  display: flex;
  gap: 0.5rem;
}

/* NPC Detail Page */

.npc-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.npc-detail-header h2 {
  margin: 0;
}

.npc-detail-header .npc-card-title {
  gap: 0.75rem;
}

.npc-detail-header .npc-card-actions {
  gap: 0.75rem;
}

/* NPC Template Picker */

.npc-template-section {
  margin-bottom: 1rem;
}

.npc-template-selected {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: var(--accent-red-bg);
  border: 1px solid var(--accent-red);
  border-radius: 4px;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.npc-template-picker {
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: 6px;
}

.npc-template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.5rem;
  max-height: 250px;
  overflow-y: auto;
}

.npc-template-card {
  padding: 0.6rem 0.75rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-primary);
  border-radius: 4px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.npc-template-card:hover {
  border-color: var(--accent-red);
  background: var(--bg-hover);
}

.npc-template-card-name {
  font-weight: 500;
  color: var(--text-primary);
  font-size: 0.9rem;
}

.npc-template-card-desc {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-top: 0.25rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* NPC Roster Filter Bar */

.npc-filter-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 0.5rem 0;
}

.npc-filter-controls {
  display: flex;
  gap: 0.5rem;
  flex: 1;
}

.npc-filter-search {
  flex: 1;
  max-width: 250px;
}

.npc-filter-status {
  min-width: 140px;
}

/* NPC Form Enhancements */

.npc-form-row {
  display: flex;
  gap: 1rem;
}

.npc-form-row .form-field {
  flex: 1;
}

.npc-milieu-fields {
  border-top: 1px solid var(--border-primary);
  margin-top: 0.75rem;
  padding-top: 0.5rem;
}

.npc-milieu-fields h5 {
  margin: 0 0 0.5rem 0;
  color: var(--text-secondary);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.npc-milieu-fields textarea {
  min-height: 2.5rem;
  resize: vertical;
}

/* -----------------------------------------------------------------------------
   NPC Page Tab Bar
   ----------------------------------------------------------------------------- */

.npc-tab-bar {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border-primary);
  margin-bottom: 1.25rem;
}

.npc-tab {
  padding: 0.5rem 1.25rem;
  border: none;
  background: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.95rem;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.15s, border-color 0.15s;
}

.npc-tab:hover {
  color: var(--text-primary);
}

.npc-tab.active {
  color: var(--accent-red);
  border-bottom-color: var(--accent-red);
  font-weight: 600;
}

/* -----------------------------------------------------------------------------
   Generator Config Cards & List
   ----------------------------------------------------------------------------- */

.gen-configs-header {
  margin-bottom: 1rem;
}

.gen-config-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.gen-config-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-primary);
  border-radius: 6px;
  padding: 1rem;
}

.gen-config-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.gen-config-card-header h4 {
  margin: 0;
  font-size: 1.05rem;
}

.gen-config-card-actions {
  display: flex;
  gap: 0.5rem;
}

.gen-config-card-pools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
}

.gen-config-pool-count {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* -----------------------------------------------------------------------------
   Generator Config Form
   ----------------------------------------------------------------------------- */

.gen-config-form {
  background: var(--bg-primary);
  border: 1px solid var(--border-primary);
  border-radius: 6px;
  padding: 1.25rem;
}

.gen-config-form h4 {
  margin-top: 0;
}

.gen-config-pools {
  margin-top: 1rem;
}

.gen-config-pools h5 {
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.gen-config-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.gen-config-form-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-primary);
}

/* -----------------------------------------------------------------------------
   Pool Editor
   ----------------------------------------------------------------------------- */

.gen-pool-editor {
  margin-bottom: 1rem;
}

.gen-pool-editor > label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
}

.gen-pool-items {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.35rem;
}

.gen-pool-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: 4px;
  padding: 0.2rem 0.5rem;
  font-size: 0.85rem;
}

.gen-pool-item button {
  padding: 0 0.3rem;
  font-size: 0.75rem;
  line-height: 1;
}

.gen-pool-add {
  display: flex;
  gap: 0.5rem;
}

.gen-pool-add input {
  flex: 1;
  max-width: 300px;
}

.gen-configs-tab .empty-state {
  margin-top: 1rem;
}

/* -----------------------------------------------------------------------------
   NPC Generate / Re-roll
   ----------------------------------------------------------------------------- */

.npc-field-label-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.npc-field-label-row label {
  margin-bottom: 0;
}

.npc-reroll-btn {
  padding: 0.1rem 0.35rem;
  font-size: 0.9rem;
  line-height: 1;
  min-width: auto;
}

.npc-gen-source-indicator {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  background: var(--info-bg);
  border: 1px solid var(--info-bg);
  border-radius: 4px;
  font-size: 0.9rem;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

/* NPC Expanded Card & Detail Sections */

.npc-expanded-section {
  margin-top: 0.75rem;
}

.npc-expanded-section h5 {
  margin: 0 0 0.35rem 0;
  color: var(--text-secondary);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.npc-stat-table {
  width: 100%;
}

.npc-stat-table th,
.npc-stat-table td {
  border-color: var(--border-primary);
}

.npc-stat-label {
  font-weight: 500;
  text-transform: capitalize;
}

.npc-skills-table {
  margin-top: 1rem;
}

/* -----------------------------------------------------------------------------
   Adventure Entity Forms (encounters, locations, clues)
   ----------------------------------------------------------------------------- */

.admin-table input[type="text"],
.admin-table textarea,
.admin-table select {
  width: 100%;
  box-sizing: border-box;
}

.admin-table td:first-child {
  white-space: nowrap;
  vertical-align: top;
  width: 1%;
}

/* Session Prep Checklist */
.prep-checklist {
  margin: 1rem 0 1.5rem;
  padding: 1rem;
  background: var(--bg-secondary);
  border-radius: 6px;
  border: 1px solid var(--border-primary);
}

.prep-checklist h4 {
  margin: 0;
  font-size: 0.95rem;
}

.prep-checklist-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.prep-checklist-header h4 {
  margin: 0;
}

.prep-checklist .checklist-success {
  color: var(--success);
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

/* Pin button */
.pin-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0 0.25rem;
  opacity: 0.5;
}

.pin-btn:hover {
  opacity: 1;
}

.pin-btn.pinned {
  opacity: 1;
  filter: saturate(2);
}

/* Pinned checklists in sidebar */
.pinned-checklists {
  margin-bottom: 1rem;
}

.pinned-checklists h3 {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0 0 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.pinned-checklist-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.5rem;
}

.pinned-checklist-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.pinned-unpin {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.9rem;
  padding: 0 0.25rem;
}

.pinned-unpin:hover {
  color: var(--text-primary);
}

.pinned-checklist-card .checklist-items {
  font-size: 0.8rem;
}

.pinned-checklist-card .checklist-item {
  padding: 0.2rem 0;
  font-size: 0.8rem;
}

.pinned-checklist-card .checklist-success {
  color: var(--success);
  font-size: 0.75rem;
  margin: 0.25rem 0 0;
}

.pinned-empty {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin: 0;
}

/* GM Notes Checklist */
.gm-notes-input-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.gm-notes-input-row input {
  flex: 1;
  padding: 0.35rem 0.5rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-primary);
  border-radius: 4px;
  color: var(--text-primary);
  font-size: 0.85rem;
}

.gm-notes-input-row input::placeholder {
  color: var(--text-disabled);
}

.gm-note-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.gm-note-toggle {
  cursor: pointer;
  user-select: none;
}

.gm-note-done {
  text-decoration: line-through;
  color: var(--text-muted);
}

.gm-note-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0 0.25rem;
  margin-left: auto;
  line-height: 1;
}

.gm-note-remove:hover {
  color: var(--error);
}

/* Checklist attention status (submitted characters) */
.checklist-item.attention .checklist-icon { color: var(--warning); }

/* Pinned card GM notes */
.pinned-checklist-card .gm-notes-items .gm-note-item {
  font-size: 0.8rem;
}

.pinned-checklist-card .gm-note-toggle {
  cursor: pointer;
}

.pinned-checklist-card .gm-note-remove {
  font-size: 0.75rem;
}

/* -----------------------------------------------------------------------------
   What's Left — Unplayed Adventure Content
   ----------------------------------------------------------------------------- */

.whats-left {
  border-left: 3px solid rgba(251, 191, 36, 0.4);
}

.whats-left h3 {
  color: var(--warning);
}

.whats-left-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border-primary);
}

.whats-left-item:last-child {
  border-bottom: none;
}

/* =============================================================================
   Mobile Responsive — Campaigns
   ============================================================================= */

@media (max-width: 480px) {
  .campaign-detail-page {
    max-width: 100%;
  }

  /* Campaign header: wrap name + actions */
  .campaign-header {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  /* Info table: UUIDs and long values break */
  .campaign-detail-page code {
    word-break: break-all;
    font-size: 0.8rem;
  }

  /* Physicality table: stack cells */
  .physicality-table td,
  .physicality-table th {
    display: block;
    width: 100%;
    padding: 0.2rem 0.5rem;
  }

  .physicality-table tr {
    display: block;
    margin-bottom: 0.5rem;
  }

  /* URL entry rows: stack vertically */
  .url-entry-row {
    flex-direction: column;
  }

  .url-entry-row input {
    max-width: 100% !important;
  }

  /* Invite links: stack URL and actions */
  .invite-link-row {
    flex-direction: column;
    gap: 0.5rem;
  }

  .invite-link-url {
    font-size: 0.75rem;
    word-break: break-all;
  }

  .invite-link-actions {
    flex-wrap: wrap;
  }

  /* Invite redeem page */
  .invite-redeem-page {
    max-width: 100%;
    padding: 1rem;
  }

  /* Player list */
  .player-row {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  /* Detail actions */
  .detail-actions {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
}
