/* ===== GénéaTree Main CSS ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #e0e7ff;
  --secondary: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --bg: #f8fafc;
  --card: #ffffff;
  --border: #e2e8f0;
  --text: #1e293b;
  --text-muted: #64748b;
  --radius: 12px;
  --header-h: 60px;
  --stats-h: 44px;

  /* Generation colors */
  --gen0: #7c3aed;
  --gen1: #6366f1;
  --gen2: #0ea5e9;
  --gen3: #10b981;
  --gen4: #f59e0b;
  --gen5: #ef4444;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
  height: 100vh;
}

/* ===== LOADING ===== */
.app-loading {
  position: fixed;
  inset: 0;
  background: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.loading-inner {
  text-align: center;
  color: white;
}

.loading-icon {
  font-size: 48px;
  color: #6366f1;
  margin-bottom: 16px;
}

/* ===== HEADER ===== */
.app-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: white;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
  z-index: 200;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.header-left { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.header-center { flex: 1; max-width: 400px; margin: 0 auto; }
.header-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.header-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 16px;
  color: var(--primary);
}

.header-brand i { font-size: 18px; }

/* Family Selector */
.family-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--primary-light);
  color: var(--primary-dark);
  border: 1px solid #c7d2fe;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: all 0.2s;
  white-space: nowrap;
  max-width: 200px;
}

.family-btn span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.family-btn:hover { background: #c7d2fe; }

.family-selector { position: relative; }

.family-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 220px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  z-index: 300;
  overflow: hidden;
}

.dropdown-header {
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.family-dropdown-item {
  padding: 10px 14px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.15s;
}

.family-dropdown-item:hover { background: #f8fafc; }
.family-dropdown-item.active { background: var(--primary-light); color: var(--primary-dark); font-weight: 600; }

.dropdown-footer {
  padding: 8px 14px;
  border-top: 1px solid var(--border);
}

.dropdown-footer button {
  background: none;
  border: none;
  color: var(--primary);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'Inter', sans-serif;
  padding: 4px;
}

/* Search */
.search-bar {
  position: relative;
  display: flex;
  align-items: center;
}

.search-bar > i {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
  font-size: 14px;
}

.search-bar input {
  width: 100%;
  padding: 9px 14px 9px 36px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 14px;
  background: #f8fafc;
  font-family: 'Inter', sans-serif;
  color: var(--text);
  transition: all 0.2s;
}

.search-bar input:focus {
  outline: none;
  border-color: var(--primary);
  background: white;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}

.search-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  z-index: 300;
  max-height: 300px;
  overflow-y: auto;
  display: none;
}

.search-results.open { display: block; }

.search-result-item {
  padding: 10px 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background 0.15s;
  font-size: 14px;
}

.search-result-item:hover { background: #f8fafc; }

/* View Toggle */
.view-toggle {
  display: flex;
  background: #f1f5f9;
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}

.view-btn {
  padding: 6px 10px;
  border: none;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.2s;
  font-size: 14px;
}

.view-btn.active {
  background: white;
  color: var(--primary);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* User Menu */
.user-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 6px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 20px;
  cursor: pointer;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  color: var(--text);
  transition: all 0.2s;
}

.user-btn:hover { background: #f8fafc; }

.user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: white;
  background: var(--primary);
  flex-shrink: 0;
}

.user-menu { position: relative; }

.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  z-index: 300;
  overflow: hidden;
}

.user-info {
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar-lg {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: white;
  background: var(--primary);
  flex-shrink: 0;
}

.user-dropdown hr { border: none; border-top: 1px solid var(--border); margin: 4px 0; }

.user-dropdown a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  transition: background 0.15s;
}

.user-dropdown a:hover { background: #f8fafc; }
.user-dropdown a.logout-link { color: var(--danger); }

.font-semibold { font-weight: 600; }
.text-sm { font-size: 12px; }
.text-muted { color: var(--text-muted); }
.font-bold { font-weight: 700; }

/* Role badge */
.role-badge {
  position: fixed;
  top: var(--header-h);
  right: 16px;
  background: var(--primary);
  color: white;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 0 0 8px 8px;
  z-index: 190;
}

/* ===== STATS BAR ===== */
.stats-bar {
  position: fixed;
  top: var(--header-h);
  left: 0; right: 0;
  height: var(--stats-h);
  background: white;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 24px;
  z-index: 190;
  font-size: 13px;
  color: var(--text-muted);
}

.stat-item { display: flex; align-items: center; gap: 6px; }
.stat-item i { color: var(--primary); }
.stat-item span { font-weight: 600; color: var(--text); }
.stat-action { margin-left: auto; }

.btn-add-member {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: all 0.2s;
}

.btn-add-member:hover { background: var(--primary-dark); transform: translateY(-1px); }

/* ===== MAIN ===== */
.app-main {
  position: fixed;
  top: calc(var(--header-h) + var(--stats-h));
  left: 0; right: 0; bottom: 0;
  overflow: hidden;
}

.view-container { width: 100%; height: 100%; }

/* ===== TREE VIEW ===== */
.tree-controls {
  position: absolute;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 50;
}

.tree-controls button {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  background: white;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--text);
  transition: all 0.2s;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.tree-controls button:hover { background: var(--primary); color: white; border-color: var(--primary); }

.tree-viewport {
  width: 100%;
  height: 100%;
  overflow: auto;
  cursor: grab;
  background:
    radial-gradient(circle, #e2e8f0 1px, transparent 1px);
  background-size: 30px 30px;
  background-color: #f8fafc;
  position: relative;
}

.tree-viewport:active { cursor: grabbing; }

.tree-canvas {
  position: relative;
  min-width: 2000px;
  min-height: 1200px;
  transform-origin: 0 0;
}

.tree-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.tree-nodes {
  position: absolute;
  inset: 0;
  z-index: 2;
}

/* Generation Row */
.gen-row {
  display: flex;
  align-items: flex-start;
  gap: 0;
  padding: 0 60px;
  margin-bottom: 0;
}

.gen-section {
  padding: 30px 0 0 0;
}

.gen-label {
  text-align: left;
  padding: 0 60px;
  margin-bottom: 16px;
}

.gen-label-inner {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: rgba(0,0,0,0.05);
  border: 1px solid rgba(0,0,0,0.1);
}

/* ===== MEMBER CARD ===== */
.member-card {
  position: absolute;
  width: 200px;
  background: white;
  border-radius: 14px;
  border: 2px solid var(--border);
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
  transition: all 0.2s;
  cursor: pointer;
  overflow: hidden;
}

.member-card:hover {
  box-shadow: 0 8px 20px rgba(0,0,0,0.12);
  transform: translateY(-2px);
  border-color: var(--primary);
  z-index: 10;
}

.member-card.deceased {
  opacity: 0.85;
}

.card-accent {
  height: 5px;
  width: 100%;
}

.card-body {
  padding: 12px 12px 8px;
}

.card-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  color: white;
  margin: 0 auto 8px;
  position: relative;
}

.deceased-badge {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 16px;
  height: 16px;
  background: #64748b;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  color: white;
  border: 2px solid white;
}

.card-name {
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 3px;
  color: var(--text);
}

.card-dates {
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}

.card-actions {
  display: flex;
  justify-content: center;
  gap: 4px;
  padding: 6px 8px 10px;
}

.card-action-btn {
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  background: #f8fafc;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 11px;
  color: var(--text-muted);
  transition: all 0.15s;
}

.card-action-btn:hover { background: var(--primary); color: white; border-color: var(--primary); }
.card-action-btn.danger:hover { background: var(--danger); border-color: var(--danger); }

/* ===== CONNECTORS (SVG) ===== */
.connector-couple { stroke: #6366f1; stroke-width: 2; stroke-dasharray: 6,3; fill: none; opacity: 0.7; }
.connector-parent { stroke: #94a3b8; stroke-width: 1.5; fill: none; opacity: 0.8; }

/* ===== LIST VIEW ===== */
.list-content {
  padding: 24px;
  height: 100%;
  overflow-y: auto;
}

.list-gen-section { margin-bottom: 32px; }

.list-gen-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border);
}

.list-gen-title h3 { font-size: 14px; font-weight: 700; }
.list-gen-title .count {
  background: var(--primary-light);
  color: var(--primary-dark);
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.list-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.list-member-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: all 0.2s;
  border-top: 4px solid transparent;
}

.list-member-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  transform: translateY(-1px);
}

.list-card-info { flex: 1; min-width: 0; }
.list-card-name { font-weight: 700; font-size: 14px; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-card-sub { font-size: 12px; color: var(--text-muted); }

.deceased-tag {
  font-size: 10px;
  font-weight: 700;
  color: #64748b;
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-block;
  margin-top: 3px;
}

/* ===== SIDE PANEL ===== */
.side-panel {
  position: fixed;
  right: 0;
  top: var(--header-h);
  bottom: 0;
  width: 360px;
  background: white;
  border-left: 1px solid var(--border);
  z-index: 150;
  display: flex;
  flex-direction: column;
  box-shadow: -4px 0 20px rgba(0,0,0,0.1);
  animation: slideInRight 0.25s ease-out;
}

@keyframes slideInRight {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.side-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 15px;
  font-weight: 700;
}

.side-panel-header button {
  width: 30px;
  height: 30px;
  border: 1px solid var(--border);
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  color: var(--text-muted);
}

.side-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.panel-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  z-index: 140;
  display: none;
}

.profile-section { margin-bottom: 20px; }

.profile-header {
  text-align: center;
  padding: 20px;
  background: linear-gradient(135deg, #f8fafc, #f1f5f9);
  border-radius: 14px;
  margin-bottom: 20px;
  position: relative;
}

.profile-avatar-xl {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 800;
  color: white;
  margin: 0 auto 12px;
  position: relative;
}

.profile-name { font-size: 18px; font-weight: 800; margin-bottom: 4px; }
.profile-sub { font-size: 13px; color: var(--text-muted); }

.profile-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

.info-item {
  background: #f8fafc;
  border-radius: 10px;
  padding: 10px 12px;
}

.info-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 3px;
}

.info-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.panel-relations { margin-top: 16px; }
.panel-relations h4 { font-size: 13px; font-weight: 700; margin-bottom: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }

.relation-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  background: var(--primary-light);
  color: var(--primary-dark);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  margin: 3px;
  transition: all 0.15s;
}

.relation-tag:hover { background: var(--primary); color: white; }

.panel-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

.panel-btn {
  flex: 1;
  min-width: 100px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: 'Inter', sans-serif;
  border: 1px solid var(--border);
  background: white;
  color: var(--text);
  transition: all 0.2s;
}

.panel-btn:hover { background: var(--primary); color: white; border-color: var(--primary); }
.panel-btn.danger:hover { background: var(--danger); border-color: var(--danger); }

/* ===== MODALS ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  padding: 20px;
  backdrop-filter: blur(4px);
}

.modal {
  background: white;
  border-radius: 18px;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px rgba(0,0,0,0.25);
  animation: scaleIn 0.2s ease-out;
}

.modal-sm { max-width: 420px; }

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  font-size: 15px;
  font-weight: 700;
  flex-shrink: 0;
}

.modal-header button {
  width: 30px;
  height: 30px;
  border: 1px solid var(--border);
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-body {
  padding: 20px 22px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

/* Form within modals */
.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  color: var(--text);
  background: white;
  transition: all 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}

.form-group textarea { resize: vertical; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* Autocomplete */
.autocomplete-wrap { position: relative; }

.ac-results {
  position: absolute;
  top: 100%;
  left: 0; right: 0;
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  z-index: 100;
  max-height: 180px;
  overflow-y: auto;
  margin-top: 4px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.12);
  display: none;
}

.ac-results.open { display: block; }

.ac-item {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.15s;
}

.ac-item:hover { background: #f8fafc; }

.selected-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  padding: 4px 10px 4px 8px;
  background: var(--primary-light);
  color: var(--primary-dark);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.selected-tag:empty { display: none; }

.selected-tag .remove-tag {
  cursor: pointer;
  margin-left: 4px;
  opacity: 0.6;
}

.selected-tag .remove-tag:hover { opacity: 1; }

/* Buttons */
.btn-primary {
  padding: 9px 18px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.btn-primary:hover { background: var(--primary-dark); }

.btn-secondary {
  padding: 9px 18px;
  background: white;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: all 0.2s;
}

.btn-secondary:hover { background: #f8fafc; }

.btn-danger {
  padding: 9px 18px;
  background: var(--danger);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: all 0.2s;
}

.btn-danger:hover { background: #dc2626; }

/* Alerts */
.alert {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.alert-error { background: #fef2f2; border: 1px solid #fecaca; color: #dc2626; }
.alert-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #16a34a; }

/* Activity Log */
.activity-list { max-height: 400px; overflow-y: auto; }

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.activity-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.activity-info { flex: 1; }
.activity-desc { margin-bottom: 2px; }
.activity-time { font-size: 11px; color: var(--text-muted); }

/* Members permissions list */
.members-permissions-list { max-height: 280px; overflow-y: auto; }

.perm-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.perm-name { flex: 1; font-weight: 600; }

.perm-select {
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
}

/* Invite link */
.copy-link {
  display: flex;
  gap: 8px;
}

.copy-link input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 12px;
  font-family: 'Inter', sans-serif;
  background: #f8fafc;
  color: var(--text-muted);
}

.copy-link button {
  padding: 8px 12px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
}

.invite-link-box { margin-top: 16px; }
.invite-link-box label { font-size: 12px; font-weight: 600; color: var(--text-muted); display: block; margin-bottom: 6px; }

/* Profile modal */
.profile-avatar-section {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
  padding: 14px;
  background: #f8fafc;
  border-radius: 12px;
}

.profile-avatar-lg {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

/* ===== TOAST ===== */
.toast-container {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

.toast {
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  color: white;
  box-shadow: 0 8px 20px rgba(0,0,0,0.2);
  animation: toastIn 0.3s ease-out;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 200px;
  justify-content: center;
}

.toast.success { background: var(--secondary); }
.toast.error { background: var(--danger); }
.toast.info { background: var(--primary); }
.toast.warning { background: var(--warning); }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-20px); }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .header-center { display: none; }
  .brand-name { display: none; }
  .side-panel { width: 100%; }
  .stats-bar { gap: 12px; font-size: 12px; overflow-x: auto; }
  .form-row { grid-template-columns: 1fr; }
}

/* No permission overlay on cards */
.card-locked {
  pointer-events: none;
  opacity: 0.7;
}

.card-locked .card-actions { display: none; }
