/* ============================================================
   FORGE — forge_app_management.css
   Website management screen
   ============================================================ */

body { background: var(--bg-deepest); overflow: auto; }

.mg-main {
  max-width: 980px;
  margin: 0 auto;
  padding: 96px 24px 48px;
}

.mg-message {
  padding: 64px 16px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.8;
}
.mg-message a { color: var(--yellow); }

.mg-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 20px;
}

/* Tabs */
.mg-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.mg-tab {
  padding: 10px 16px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.mg-tab:hover { color: var(--text-primary); }
.mg-tab.active { color: var(--yellow); border-bottom-color: var(--yellow); }

.mg-search { margin-bottom: 12px; }
.mg-hint { color: var(--text-muted); font-size: 13px; margin-bottom: 12px; }

/* Lists */
.mg-list {
  display: flex;
  flex-direction: column;
  background: var(--bg-sidebar);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.mg-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 14px;
  background: none;
  border: none;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  font-family: var(--font-body);
  text-align: left;
  cursor: pointer;
}
.mg-row:last-child { border-bottom: none; }
.mg-row:hover { background: var(--bg-hover); }
.mg-row-main {
  display: flex;
  flex-direction: column;
  flex: 1 1 180px;
  min-width: 0;
}
.mg-row-name { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mg-row-sub  { font-size: 12px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mg-row-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
  flex: 2 1 200px;
  min-width: 0;
}
.mg-row-level { flex: 0 0 78px; text-align: right; }
.mg-you { color: var(--text-muted); font-weight: 400; }
.mg-empty { padding: 28px; text-align: center; color: var(--text-muted); font-size: 13px; }

.mg-avatar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--bg-well-3);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 700;
  overflow: hidden;
}
.mg-avatar img { width: 100%; height: 100%; object-fit: cover; }
.mg-avatar-lg { width: 56px; height: 56px; font-size: 18px; }

.mg-level {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  background: var(--bg-active);
  color: var(--text-secondary);
}
.mg-level-manager   { background: rgba(91,141,238,0.18); color: #9dbbf5; }
.mg-level-developer { background: rgba(76,175,125,0.18); color: #7fd3a6; }
.mg-level-owner     { background: var(--yellow-dim); color: var(--yellow); }

.mg-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  color: var(--text-muted);
  font-size: 13px;
}
.mg-pager .btn:disabled { opacity: 0.4; cursor: default; }

/* User details */
.mg-drawer-back {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0,0,0,0.5);
}
.mg-drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  z-index: 301;
  width: min(440px, 100%);
  padding: 20px;
  overflow-y: auto;
  background: var(--bg-panel);
  border-left: 1px solid var(--border);
}
.mg-drawer-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.mg-drawer-title { flex: 1; min-width: 0; font-size: 13px; overflow-wrap: anywhere; }
.mg-drawer-name {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}
.mg-close {
  align-self: flex-start;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.mg-close:hover { color: var(--text-primary); }

.mg-block { padding: 16px 0; border-top: 1px solid var(--border); margin-top: 8px; }
.mg-block-title {
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-muted);
}
.mg-muted { color: var(--text-muted); font-size: 13px; }
.mg-note  { margin-top: 6px; font-size: 12px; }
.mg-bio   { margin-bottom: 10px; color: var(--text-secondary); font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }

.mg-held-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.mg-held-tag  { display: inline-flex; align-items: center; gap: 2px; max-width: 100%; }
.mg-tag-remove {
  width: 22px;
  height: 22px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}
.mg-tag-remove:hover { color: var(--red); }
.mg-add-tag { margin-top: 10px; cursor: pointer; }
#mg-level-select { cursor: pointer; }
#mg-level-select:disabled { cursor: default; opacity: 0.6; }

.mg-inline  { display: flex; align-items: center; gap: 8px; }
.mg-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.mg-actions .btn:disabled { opacity: 0.4; cursor: default; }

@media (max-width: 640px) {
  .mg-main { padding: 84px 16px 32px; }
  .home-nav { padding: 0 16px; }
  .mg-row { flex-wrap: wrap; }
  .mg-row-tags { justify-content: flex-start; flex-basis: 100%; order: 3; }
  .mg-row-level { flex: 0 0 auto; }
}

/* Support and feedback */
.mg-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.mg-filter {
  padding: 6px 12px;
  background: var(--bg-sidebar);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.mg-filter:hover { color: var(--text-primary); }
.mg-filter.active { border-color: var(--yellow); color: var(--yellow); }
.mg-filter-count { margin-left: 2px; color: var(--text-muted); font-weight: 400; }
.mg-list-footer { margin: 8px 0 0; }
.mg-list-footer:empty { display: none; }

.mg-pill {
  flex-shrink: 0;
  display: inline-block;
  padding: 1px 8px;
  border-radius: 4px;
  background: var(--bg-active);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.mg-pill-attention { background: var(--yellow-dim); color: var(--yellow); }
.mg-pill-progress { background: rgba(91,141,238,0.18); color: #9dbbf5; }
.mg-pill-added { background: rgba(76,175,125,0.18); color: #7fd3a6; }
.mg-row-owner { flex-shrink: 0; max-width: 130px; }

.mg-thread { display: flex; flex-direction: column; gap: 10px; }
.mg-message-bubble {
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--bg-well-3);
}
.mg-message-staff { border-left: 3px solid var(--yellow); }
.mg-message-head { margin-bottom: 4px; font-size: 12px; color: var(--text-muted); }
.mg-message-body {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.mg-reply { display: block; min-height: 110px; margin-bottom: 8px; resize: vertical; }
.mg-label-gap { margin-top: 12px; }
#mg-drawer .mg-actions { margin-top: 8px; }

.mg-priority-row { cursor: grab; }
.mg-priority-row:focus-visible { outline: 2px solid var(--yellow); outline-offset: -2px; }
.mg-dragging { opacity: 0.5; }
.mg-grip { color: var(--text-muted); font-size: 13px; letter-spacing: -2px; }
.mg-rank {
  flex: 0 0 24px;
  color: var(--yellow);
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}
.mg-move { display: flex; gap: 2px; flex-shrink: 0; }
.mg-move-btn {
  width: 28px;
  height: 28px;
  background: var(--bg-well-3);
  border: none;
  border-radius: 4px;
  color: var(--text-secondary);
  font-size: 11px;
  cursor: pointer;
}
.mg-move-btn:hover:not(:disabled) { color: var(--text-primary); }
.mg-move-btn:disabled { opacity: 0.3; cursor: default; }
