/*
 * ui-fixes.css - rAi Builder UI polish
 * Replaces all inline styles + adds consistency fixes
 */

/* ─── Critical: ensure [hidden] always wins ──────────────── */
[hidden] { display: none !important; }

/* ─── Dropdown icons ─────────────────────────────────────── */
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dropdown-icon {
  flex-shrink: 0;
  opacity: 0.7;
}

/* ─── Panel tabs: SVG icon alignment ─────────────────────── */
.tab,
.panel-tabs .tab {
  display: flex;
  align-items: center;
  gap: 5px;
}

/* ─── Preview tabs: SVG icon alignment ───────────────────── */
.preview-tab {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* ─── Section header icons ───────────────────────────────── */
.section-icon {
  display: inline-flex;
  align-items: center;
  opacity: 0.6;
}

.section-toggle {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.15s;
}
.section-toggle:hover { opacity: 1; }

/* ─── New project button (header) ────────────────────────── */
.btn-new-project {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border-radius: 4px;
  border: 1px solid var(--border-default);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  flex-shrink: 0;
  opacity: 1;
}
.btn-new-project:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  opacity: 1;
}

/* ─── Import handover button ─────────────────────────────── */
.btn.btn-icon.btn-xs {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border-subtle, var(--border));
  color: var(--text-muted);
  padding: 3px 5px;
  border-radius: 4px;
}
.btn.btn-icon.btn-xs:hover {
  background: var(--bg-hover);
  color: var(--text);
}

/* ─── View toggle (list/grid) ─────────────────────────────── */
.view-toggle {
  -webkit-appearance: none;
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 3px 5px;
  background: var(--bg-surface, #faf9f5);
  border: 1px solid var(--border-subtle, rgba(100,85,70,0.1));
  border-radius: var(--radius-sm, 3px);
  cursor: pointer;
  color: var(--text-muted, #78736a);
  transition: all 0.15s;
  flex-shrink: 0;
}
.view-toggle:hover {
  background: var(--bg-hover, #edeae3);
  color: var(--text-primary, #2a2520);
}
.view-icon-list,
.view-icon-grid {
  display: inline-flex;
  align-items: center;
}

/* ─── Projects filter row ────────────────────────────────── */
.projects-filters {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 6px 8px;
  flex-shrink: 0;
  flex-wrap: nowrap;
  border-bottom: 1px solid var(--border-hairline, rgba(100,85,70,0.06));
}

.filter-spacer { flex: 1; }

/* ─── Filter tabs ─────────────────────────────────────────── */
.filter-tab {
  -webkit-appearance: none;
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 500;
  font-family: inherit;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-muted, #78736a);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm, 3px);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
  flex-shrink: 0;
}
.filter-tab:hover {
  color: var(--text-primary, #2a2520);
  background: var(--bg-hover, #edeae3);
}
.filter-tab.active {
  color: var(--accent, #6b2d3c);
  background: var(--accent-subtle, rgba(107,45,60,0.07));
  border-color: var(--border-accent, rgba(107,45,60,0.2));
  font-weight: 600;
}

/* ─── Bulk delete button ─────────────────────────────────── */
.bulk-delete-btn {
  -webkit-appearance: none;
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm, 3px);
  cursor: pointer;
  color: var(--text-muted, #78736a);
  transition: all 0.15s;
  flex-shrink: 0;
}
.bulk-delete-btn:hover {
  color: #c0392b;
  background: rgba(192,57,43,0.08);
  border-color: rgba(192,57,43,0.2);
}

/* ─── Publicera / publish button ─────────────────────────── */
.btn.btn-publish {
  background: linear-gradient(135deg, var(--success, #4a7c59), #3a5632);
  border-color: var(--success, #4a7c59);
  color: white;
  margin-right: 6px;
}
.btn.btn-publish:hover:not(:disabled) {
  background: linear-gradient(135deg, #5a8c69, #4a6642);
  border-color: #5a8c69;
}
.btn.btn-publish:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ─── Presence bar ───────────────────────────────────────── */
.presence-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-right: 8px;
}

/* ─── Team Chat Section ───────────────────────────────────── */
.team-chat-section {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

.team-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.team-chat-empty {
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
  padding: 20px 0;
}

.team-chat-input-row {
  border-top: 1px solid var(--border);
  padding: 8px;
  display: flex;
  gap: 6px;
  align-items: flex-end;
}

.team-chat-textarea {
  flex: 1;
  resize: none;
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--input-bg, var(--surface));
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  line-height: 1.4;
  max-height: 120px;
  overflow-y: auto;
}

.team-chat-send {
  padding: 7px 10px;
  flex-shrink: 0;
  align-self: flex-end;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ─── Share modal ─────────────────────────────────────────── */
.share-modal-content {
  max-width: 420px;
}

.share-modal-body {
  padding: 16px;
}

.share-project-name {
  margin: 0 0 14px;
  font-weight: 600;
  color: var(--text);
}

.share-members-list {
  margin-bottom: 16px;
}

.share-invite-section {
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

.share-invite-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  letter-spacing: 0.05em;
}

.share-invite-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.share-input {
  flex: 1;
  padding: 7px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--input-bg, var(--surface));
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
}
.share-input:focus {
  outline: none;
  border-color: var(--primary);
}

.share-select {
  padding: 7px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--input-bg, var(--surface));
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
}
.share-select:focus {
  outline: none;
  border-color: var(--primary);
}

.share-invite-btn {
  width: 100%;
}

.share-invite-status {
  font-size: 12px;
  margin: 8px 0 0;
  text-align: center;
  min-height: 16px;
  color: var(--text-muted);
}

/* ─── Removed: "Projekt:" prefix / project-label ─────────── */
.project-label {
  display: none;
}

/* ─── Status bar: no bug button ──────────────────────────── */
.status-bug-btn {
  display: none;
}

/* ─── New project modal: removed form tag, fix button ─────── */
#create-project-btn {
  /* matches submit button behavior via JS */
}

/* ─── Modal title icon ──────────────────────────────────── */
.modal-title-icon {
  vertical-align: -2px;
  margin-right: 6px;
}

/* ─── Preview tabs (toolbar) ─────────────────────────────── */
.toolbar-center {
  display: flex;
  align-items: center;
  gap: 8px;
}

.preview-tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  background: linear-gradient(180deg, var(--bg-elevated, #f5f0e8) 0%, var(--bg-surface, #ede8df) 100%);
  border: 1px solid var(--border-subtle, rgba(0,0,0,0.1));
  border-radius: var(--radius-sm, 3px);
  padding: 2px;
  box-shadow: var(--shadow-inset, inset 0 1px 2px rgba(0,0,0,0.06));
}

.preview-tab {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  font-size: 9px;
  font-weight: 500;
  font-family: inherit;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted, #888);
  background: transparent;
  border: none;
  border-radius: 2px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}

.preview-tab:hover {
  color: var(--text-primary, #2a2a2a);
  background: rgba(255,255,255,0.5);
}

.preview-tab.active {
  background: linear-gradient(165deg,
    var(--accent-light, #8a4254) 0%,
    var(--accent, #6b2d3c) 40%,
    #5d2835 100%
  );
  color: #fffdf8;
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,0.15)),
              inset 0 1px 0 rgba(255,255,255,0.12);
}

.preview-tab .tab-badge {
  background: rgba(255,255,255,0.25);
  border-radius: 8px;
  padding: 1px 5px;
  font-size: 8px;
  font-weight: 600;
}

.preview-tab:not(.active) .tab-badge {
  background: var(--accent-subtle, rgba(107,45,60,0.1));
  color: var(--accent, #6b2d3c);
}

/* Divider between content tabs and edit tab */
.preview-tab-divider {
  width: 1px;
  height: 16px;
  background: var(--border-subtle);
  margin: 0 2px;
  flex-shrink: 0;
}

/* Edit (WYSIWYG) tab — distinct green active state */
#wysiwyg-tab {
  gap: 5px;
}

#wysiwyg-tab:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

#wysiwyg-tab.active {
  background: linear-gradient(165deg, #2d7a4f 0%, #1f5c3a 60%, #194d30 100%) !important;
  color: #e6f7ee !important;
  box-shadow: 0 1px 4px rgba(31,92,58,0.35),
              inset 0 1px 0 rgba(255,255,255,0.12) !important;
}

#wysiwyg-tab.active::after {
  content: '';
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #6ee7a0;
  box-shadow: 0 0 6px rgba(110,231,160,0.8);
  margin-left: 2px;
  animation: editPulse 2s ease-in-out infinite;
}

@keyframes editPulse {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; box-shadow: 0 0 10px rgba(110,231,160,0.9); }
}

/* ─── Publish button — rAi-style ─────────────────────────── */
.btn.btn-publish {
  background: linear-gradient(165deg,
    var(--accent-light, #8a4254) 0%,
    var(--accent, #6b2d3c) 40%,
    #5d2835 100%
  );
  border: none;
  color: #fffdf8;
  letter-spacing: 1.2px;
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,0.15)),
              inset 0 1px 0 rgba(255,255,255,0.12);
  margin-right: 0;
}

.btn.btn-publish:hover:not(:disabled) {
  background: linear-gradient(165deg,
    var(--accent-hover, #7d3547) 0%,
    var(--accent, #6b2d3c) 40%,
    #5d2835 100%
  );
  box-shadow: var(--shadow-md, 0 4px 8px rgba(0,0,0,0.2)),
              inset 0 1px 0 rgba(255,255,255,0.15);
  transform: translateY(-1px);
}

.btn.btn-publish:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}


/* ─── Project card layout ───────────────────────────────── */
.project-main {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
  cursor: pointer;
  overflow: visible;
}

/* Actions always flush right on both card and linked-item */
/* Type/status icons — always visible in card, not hidden on hover */
.project-type-icons {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
}

.project-status-pill {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  margin-left: auto;
}

/* Meta time — show normally, hide when actions appear */
.project-card .meta-time {
  font-size: 10px;
  color: var(--text-muted, #78736a);
  white-space: nowrap;
  flex-shrink: 0;
  transition: opacity 0.15s;
}
.project-card:hover .meta-time {
  opacity: 0;
  width: 0;
  overflow: hidden;
}

.project-card > .project-actions-row {
  margin-left: auto;
  flex-shrink: 0;
}

/* ─── Project card action buttons ───────────────────────── */
.project-actions-row {
  display: flex;
  align-items: center;
  gap: 2px;
  padding-right: 8px;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.15s;
}

.project-card:hover .project-actions-row,
.project-card.active .project-actions-row,
.linked-item:hover .project-actions-row,
.linked-item.active .project-actions-row {
  opacity: 1;
}

/* project-menu-btn is display:none by default in app.css — show on linked-item hover too */
.linked-item:hover .project-menu-btn,
.linked-item.active .project-menu-btn {
  display: flex;
}

/* On hover: hide time, show buttons only */
.linked-item .linked-actions .linked-time { display: inline; opacity: 1; }
.linked-item:hover .linked-actions .linked-time,
.linked-item.active .linked-actions .linked-time { display: none; }

/* Button reset + sizing for linked rows — identical behavior to project-card buttons */
.linked-item .action-btn,
.linked-item .favorite-btn-inline,
.linked-item .share-btn-inline,
.linked-item .project-menu-btn {
  -webkit-appearance: none;
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  min-width: 22px;
  padding: 0;
  background: none;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  color: var(--text-muted, #78736a);
  text-decoration: none;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
  box-shadow: none;
  outline: none;
  line-height: 1;
}

.linked-item .action-btn:hover,
.linked-item .favorite-btn-inline:hover,
.linked-item .share-btn-inline:hover,
.linked-item .project-menu-btn:hover {
  background: var(--bg-hover, #edeae3);
  color: var(--text-primary, #2a2520);
}

.linked-item .favorite-btn-inline.is-favorite {
  color: var(--accent, #6b2d3c);
}

/* Right-align actions in linked rows */
.linked-item .linked-actions {
  margin-left: auto;
  flex-shrink: 0;
}

.project-card .action-btn,
.project-card .favorite-btn-inline,
.project-card .share-btn-inline {
  -webkit-appearance: none;
  appearance: none;
  width: 26px;
  height: 26px;
  min-width: 26px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  border-radius: var(--radius-sm, 3px);
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  color: var(--text-muted, #78736a);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
  box-shadow: none;
  outline: none;
}

.project-card .action-btn:hover,
.project-card .favorite-btn-inline:hover,
.project-card .share-btn-inline:hover {
  background: var(--bg-hover, #edeae3);
  color: var(--text-primary, #2a2520);
}

.project-card .favorite-btn-inline.is-favorite {
  color: var(--accent, #6b2d3c);
}

/* Expand linked group button */
.project-card .expand-group-btn {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  font-size: 9px;
  color: var(--text-muted, #78736a);
  transition: color 0.15s;
  flex-shrink: 0;
  box-shadow: none;
}
.project-card .expand-group-btn:hover { color: var(--text-primary, #2a2520); }

/* ─── Send / Stop button toggle ─────────────────────────── */
.btn-send .icon-stop { display: none; }
.btn-send .icon-send { display: block; }

.btn-send.is-stop .icon-send { display: none; }
.btn-send.is-stop .icon-stop { display: block; }

.btn-send.is-stop {
  background: var(--accent, #6b2d3c) !important;
  opacity: 1 !important;
  animation: stopPulse 1.8s ease-in-out infinite;
}

@keyframes stopPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(107,45,60,0.4); }
  50%       { box-shadow: 0 0 0 6px rgba(107,45,60,0); }
}

/* ─── AI busy state: lock project list ───────────────────── */
.app-layout.ai-busy .projects-section {
  pointer-events: none;
}

.app-layout.ai-busy .projects-list {
  opacity: 0.4;
  transition: opacity 0.3s;
}

.app-layout.ai-busy .projects-filters {
  opacity: 0.4;
  transition: opacity 0.3s;
}

/* ─── AI working banner in chat input area ───────────────── */
.app-layout.ai-busy .chat-input-container::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg,
    transparent 0%,
    var(--accent, #6b2d3c) 30%,
    var(--accent-light, #8a4254) 50%,
    var(--accent, #6b2d3c) 70%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: aiSweep 1.5s linear infinite;
  border-radius: 2px 2px 0 0;
}

@keyframes aiSweep {
  0%   { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

.chat-input-container { position: relative; }

/* ─── Status bar: loading animation ─────────────────────── */
.status-indicator.loading .status-dot {
  background: var(--accent, #6b2d3c);
  animation: statusPulse 1s ease-in-out infinite;
}

.status-indicator.loading .status-text {
  color: var(--accent, #6b2d3c);
  font-weight: 500;
}

/* ─── Status icons (replacing text pills) ─────────────── */
.status-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 1;
}
.status-live-icon   { color: var(--success, #4a7c59); }
.status-draft-icon  { color: var(--text-muted, #78736a); }
.status-unsynced    { color: var(--warning, #c07a2b); }

/* ─── Compact meta-time ────────────────────────────────── */
.meta-time {
  font-size: 10px;
  color: var(--text-muted, #78736a);
  letter-spacing: 0;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Remove any old pill styles that might conflict */
.status-pill { display: none; }

/* ═══════════════════════════════════════════════════════════
   PROJEKTGRUPPER — recursive linked project tree
   ═══════════════════════════════════════════════════════════ */

/* ── Group header card ───────────────────────────────── */
.group-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px 7px 10px;
  cursor: pointer;
  background: var(--bg-surface, #faf9f5);
  border-top: 1px solid var(--border-subtle, rgba(100,85,70,0.1));
  border-bottom: 1px solid var(--border-subtle);
  transition: background 0.12s;
  user-select: none;
}
.group-header:hover {
  background: var(--bg-elevated, #edeae3);
}

.group-header-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  background: linear-gradient(135deg, var(--accent-subtle, rgba(107,45,60,0.1)), var(--bg-elevated, #edeae3));
  color: var(--accent, #6b2d3c);
  flex-shrink: 0;
}

.group-header-name {
  flex: 1;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary, #2a2520);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.group-header-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.group-status-dots {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.group-member-count {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-muted, #78736a);
  letter-spacing: 0.3px;
}

.group-expand-btn {
  -webkit-appearance: none;
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  background: none;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0;
  flex-shrink: 0;
  transition: color 0.12s;
}
.group-expand-btn svg {
  transition: transform 0.2s;
}
.group-expand-btn.open svg {
  transform: rotate(180deg);
}
.group-expand-btn:hover { color: var(--text-primary); }

/* Group body (collapsible) */
.group-body {
  display: none;
}
.group-body.open {
  display: flex;
  flex-direction: column;
}

/* Root group wrapper */
.project-group {
  display: flex;
  flex-direction: column;
}

/* Children container — collapsed by default, open class shows it */
.linked-children {
  display: none;
  flex-direction: column;
}
.linked-children.open {
  display: flex;
}

/* Vertical connector line */
.linked-connector {
  display: flex;
  flex-direction: column;
  padding-left: 18px;
  margin-left: 28px;
  border-left: 1.5px solid var(--border-subtle, rgba(100,85,70,0.15));
  padding-bottom: 3px;
  gap: 0;
}

/* Deeper nesting indent */
.linked-connector-deep {
  margin-left: 18px;
  padding-left: 14px;
}

/* Individual linked project row */
.linked-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px 5px 0;
  border-radius: var(--radius-sm, 3px);
  cursor: pointer;
  font-size: 12px;
  color: var(--text-secondary, #6b6560);
  position: relative;
  transition: background 0.1s;
  margin-right: 4px;
}

/* Horizontal branch line */
.linked-item::before {
  content: '';
  position: absolute;
  left: -18px;
  top: 50%;
  width: 16px;
  height: 1.5px;
  background: var(--border-subtle, rgba(100,85,70,0.15));
}

.linked-item:hover {
  background: var(--bg-hover, #edeae3);
  color: var(--text-primary, #2a2520);
}

.linked-item.active {
  background: var(--accent-subtle, rgba(107,45,60,0.07));
  color: var(--accent, #6b2d3c);
}

.linked-item.stale { opacity: 0.6; }

/* Grandchild row — slightly muted */
.linked-item.gc-item {
  font-size: 11px;
  color: var(--text-muted);
}

/* Status dot inside linked row */
.linked-item .project-dot {
  flex-shrink: 0;
}

.linked-icon {
  font-size: 11px;
  width: 16px;
  text-align: center;
  flex-shrink: 0;
  opacity: 0.75;
}

.linked-info {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 5px;
  overflow: hidden;
}

.linked-name {
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.linked-item .linked-type-badge {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  flex-shrink: 0;
  opacity: 0.8;
}

.linked-time {
  font-size: 10px;
  color: var(--text-muted);
  flex-shrink: 0;
  white-space: nowrap;
}

.linked-stale-badge {
  font-size: 9px;
  font-weight: 700;
  color: var(--warning, #c07a2b);
  background: rgba(192,122,43,0.12);
  border-radius: 3px;
  padding: 1px 4px;
  flex-shrink: 0;
}

/* Type-specific badge colours */
.linked-admin   .linked-type-badge { color: var(--accent, #6b2d3c); }
.linked-landing .linked-type-badge { color: #2d6a8a; }
.linked-api     .linked-type-badge { color: #2d6a45; }
.linked-pwa     .linked-type-badge { color: #6b4a2d; }
.linked-report  .linked-type-badge { color: #555; }

/* Child expand button */
.expand-group-btn {
  -webkit-appearance: none;
  appearance: none;
  width: 18px; height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  font-size: 8px;
  color: var(--text-muted);
  transition: transform 0.18s, color 0.12s;
  flex-shrink: 0;
  padding: 0;
}
.expand-group-btn:hover  { color: var(--text-primary); }
.expand-group-btn.open   { transform: rotate(90deg); }

/* Collapsed group summary line */
.group-collapsed-summary {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 12px 4px 46px;
  font-size: 10px;
  color: var(--text-muted);
}

.group-status-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.group-status-dot.dot-live    { background: var(--success, #4a7c59); }
.group-status-dot.dot-pending { background: var(--warning, #c07a2b); }
.group-status-dot.dot-draft   { background: var(--border-subtle); border: 1px solid var(--text-muted); }

.group-member-count {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-left: 2px;
}

/* ═══════════════════════════════════════════════════════════
   STATUSIKONER på projektkort
   ═══════════════════════════════════════════════════════════ */
.project-status-icons {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
}

.project-meta-inline {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  margin-left: auto;
}

.status-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 1;
  opacity: 0.85;
}
.status-icon:hover { opacity: 1; }

.status-live-icon   { color: var(--success, #4a7c59); }
.status-draft-icon  { color: var(--text-muted, #78736a); }
.status-unsynced    { color: var(--warning, #c07a2b); }
.status-shared-icon { color: #2d6a8a; }
.status-linked-icon { color: var(--accent, #6b2d3c); opacity: 0.6; }
.status-single-icon { color: var(--text-muted, #78736a); }
.status-type-icon   { font-size: 11px; line-height: 1; }

/* ═══════════════════════════════════════════════════════════
   PROJEKTLISTA MAXIMERA-KNAPP
   ═══════════════════════════════════════════════════════════ */

.section-maximize {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 5px;
  border-radius: var(--radius-sm, 3px);
  cursor: pointer;
  color: var(--text-muted);
  transition: color 0.12s, background 0.12s;
  flex-shrink: 0;
}
.section-maximize:hover {
  color: var(--accent, #6b2d3c);
  background: var(--bg-hover, #edeae3);
}

/* Default: show expand icon, hide minimize icon */
.section-maximize .icon-minimize { display: none; }
.section-maximize .icon-maximize { display: block; }

/* When maximized: swap icons */
.section-maximize.is-maximized .icon-minimize { display: block; }
.section-maximize.is-maximized .icon-maximize { display: none; }

/* Subtle accent ring when active */
.section-maximize.is-maximized {
  color: var(--accent, #6b2d3c);
  background: var(--accent-subtle, rgba(107,45,60,0.07));
}

/* Group header menu button */
.group-menu-btn {
  opacity: 0;
  transition: opacity 0.15s;
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 5px;
  border-radius: 3px;
  font-size: 13px;
  color: var(--text-secondary);
  flex-shrink: 0;
  margin-left: 2px;
}
.group-header:hover .group-menu-btn {
  opacity: 1;
}
.group-menu-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
