.gangs-page {
  display: flex;
  flex-direction: column;
  gap: 18px;
  color: rgba(255,255,255,.94);
}

.gangs-page .input,
.gangs-page select.input,
.gang-modal .input,
.gang-member-modal .input,
.gang-view-modal .input {
  background: rgba(15, 26, 56, 0.92);
  border: 1px solid rgba(255,255,255,.10);
  color: #eef4ff;
  border-radius: 12px;
  min-height: 42px;
  padding: 10px 12px;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03);
}

.gangs-page .input::placeholder,
.gang-modal .input::placeholder,
.gang-member-modal .input::placeholder {
  color: rgba(226, 234, 255, 0.52);
}

.gangs-page .input:focus,
.gang-modal .input:focus,
.gang-member-modal .input:focus,
.gangs-page select.input:focus,
.gang-modal select.input:focus,
.gang-member-modal select.input:focus {
  border-color: rgba(255, 190, 64, 0.7);
  box-shadow: 0 0 0 3px rgba(255, 190, 64, 0.10);
}

.gangs-page select.input,
.gang-modal select.input,
.gang-member-modal select.input {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(255,255,255,.75) 50%),
    linear-gradient(135deg, rgba(255,255,255,.75) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) calc(50% - 3px),
    calc(100% - 12px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 34px;
}

.gangs-header,
.gangs-header-actions,
.gangs-stats,
.gang-row-main,
.gang-members-toolbar,
.gang-hero,
.gang-hero-info,
.gang-view-grid,
.gang-member-card,
.gang-member-actions {
  display: flex;
}

.gangs-header {
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.gangs-header h1 { margin: 0 0 6px; }
.gangs-header p { margin: 0; opacity: .72; }

.gangs-header-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.gangs-header-actions #gangSearch {
  width: 340px;
  max-width: 100%;
}

.gangs-header-actions #gangFilterStatus,
.gangs-header-actions #gangFilterThreat {
  min-width: 160px;
}

.gangs-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.gangs-card,
.section-card,
.detail-card,
.info-card,
.gang-view-right .card.mini {
  background: linear-gradient(180deg, rgba(28, 44, 84, 0.90), rgba(19, 31, 61, 0.92));
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 16px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03);
}

.gangs-table-wrap { overflow: auto; }
.gangs-table { width: 100%; border-collapse: collapse; }
.gangs-table th,
.gangs-table td {
  padding: 14px 12px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  text-align: left;
  vertical-align: middle;
}
.gangs-table th { opacity: .72; font-weight: 600; }

.gang-row-main { align-items: center; gap: 12px; }
.gang-row-avatar {
  width: 42px; height: 42px; border-radius: 12px;
  overflow: hidden; background: rgba(255,255,255,.06);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
}
.gang-row-avatar img,
.gang-hero-media img { width: 100%; height: 100%; object-fit: cover; }
.gang-row-name { font-weight: 700; }
.gang-row-sub { opacity: .64; font-size: 12px; margin-top: 2px; }

.gang-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.08);
  margin: 2px 6px 2px 0;
}

.gang-badge.status-active { background: rgba(46, 204, 113, .14); }
.gang-badge.status-watch { background: rgba(241, 196, 15, .14); }
.gang-badge.status-dormant { background: rgba(52, 152, 219, .14); }
.gang-badge.status-dismantled { background: rgba(231, 76, 60, .14); }
.gang-badge.threat-low { background: rgba(52, 152, 219, .14); }
.gang-badge.threat-medium { background: rgba(241, 196, 15, .14); }
.gang-badge.threat-high { background: rgba(230, 126, 34, .14); }
.gang-badge.threat-extreme { background: rgba(231, 76, 60, .18); }

.gang-modal,
.gang-view-modal,
.gang-member-modal {
  background: linear-gradient(180deg, rgba(18, 31, 63, 0.98), rgba(13, 24, 48, 0.985));
  border: 1px solid rgba(255, 183, 54, 0.55);
  border-radius: 22px;
  overflow: hidden;
}

.gang-modal .modal-header,
.gang-view-modal .modal-header,
.gang-member-modal .modal-header,
.gang-modal .modal-footer,
.gang-view-modal .modal-footer,
.gang-member-modal .modal-footer {
  background: rgba(255,255,255,.02);
  border-color: rgba(255,255,255,.08);
}

.gang-modal .modal-body,
.gang-view-modal .modal-body,
.gang-member-modal .modal-body {
  max-height: 76vh;
  overflow: auto;
}

.custom-scrollbar {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 192, 72, 0.70) rgba(255,255,255,.05);
}

.custom-scrollbar::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.custom-scrollbar::-webkit-scrollbar-track {
  background: rgba(255,255,255,.04);
  border-radius: 999px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(255, 195, 80, .95), rgba(220, 150, 35, .95));
  border-radius: 999px;
  border: 2px solid rgba(10, 18, 35, 0.35);
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(255, 210, 110, 1), rgba(232, 163, 53, 1));
}

.gang-modal-body { padding-top: 6px; }
.gang-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.gang-form-col { display: flex; flex-direction: column; gap: 16px; }
.section-card, .detail-card, .gang-view-right .card.mini { padding: 16px; }
.section-title { font-size: 15px; font-weight: 700; margin-bottom: 14px; }
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.form-group.full { grid-column: 1 / -1; }
.form-group label {
  display: block;
  margin-bottom: 7px;
  font-size: 13px;
  font-weight: 700;
  color: rgba(233, 240, 255, 0.88);
}

.pick-results {
  max-height: 220px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
  padding-right: 4px;
}

.pick-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 12px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.06);
  cursor: pointer;
  transition: .15s ease;
}

.pick-row:hover {
  background: rgba(255, 192, 72, 0.10);
  border-color: rgba(255, 192, 72, 0.35);
}

.pick-name { font-weight: 700; }
.pick-sub, .pick-meta, .pick-hint, .muted { opacity: .7; font-size: 12px; }

.gang-members-toolbar {
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.gang-members-toolbar .input { flex: 1; }
.gang-members-editor {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}
.gang-member-card {
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(255,255,255,.035);
  border: 1px solid rgba(255,255,255,.06);
}
.gang-member-name { font-weight: 700; }
.gang-member-sub { opacity: .68; font-size: 12px; margin-top: 3px; }
.gang-member-actions { gap: 8px; }

.gang-view-body {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr);
  gap: 16px;
}
.gang-view-left,
.gang-view-right {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}
.gang-hero {
  gap: 16px;
  padding: 16px;
  border-radius: 16px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
}
.gang-hero-media {
  width: 140px;
  height: 140px;
  border-radius: 18px;
  overflow: hidden;
  flex-shrink: 0;
  background: rgba(255,255,255,.05);
}
.gang-view-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 54px; font-weight: 800;
}
.gang-hero-info { flex-direction: column; justify-content: center; gap: 8px; min-width: 0; }
.gang-hero-name { font-size: 28px; font-weight: 800; word-break: break-word; }
.gang-hero-aliases { opacity: .72; word-break: break-word; }
.gang-hero-badges { margin-top: 4px; }
.gang-view-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.info-card { padding: 14px; min-width: 0; }
.info-card strong { display: block; margin-bottom: 8px; opacity: .78; }
.detail-card h3, .card.mini h3 { margin: 0 0 12px; }
.detail-card div { white-space: pre-wrap; line-height: 1.55; opacity: .92; word-break: break-word; }
.gang-view-members {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.gang-view-member {
  padding: 12px;
  border-radius: 12px;
  background: rgba(255,255,255,.035);
  border: 1px solid rgba(255,255,255,.06);
}
.gang-view-member-name { font-weight: 700; }
.gang-view-member-sub { opacity: .68; font-size: 12px; margin-top: 4px; }
.gang-view-member-notes { margin-top: 8px; line-height: 1.45; opacity: .9; word-break: break-word; }

.gang-member-modal {
  max-width: 760px;
}

@media (max-width: 1300px) {
  .gangs-stats,
  .gang-form-grid,
  .gang-view-body,
  .gang-view-grid,
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .gangs-header {
    flex-direction: column;
  }

  .gangs-header-actions {
    width: 100%;
    justify-content: stretch;
  }

  .gangs-header-actions > * {
    flex: 1 1 100%;
  }

  .gangs-header-actions #gangSearch {
    width: 100%;
  }
}