/* ═══════════════════════════════════════
   TERMINAL WINDOW — kit: .terminal-window
   ═══════════════════════════════════════ */
.terminal-window {
    border: 1px solid var(--green-border);
    background: var(--bg-surface);
    margin-bottom: 1rem;
    border-radius: var(--radius-lg);
    overflow-x: auto;
    overflow-y: hidden;
}

/* ═══════════════════════════════════════════════════
   CYANOS DARK — Components
   ═══════════════════════════════════════════════════ */

/* ═══ BUTTONS ═══ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  white-space: nowrap; border-radius: 6px;
  font-size: 14px; font-weight: 500; font-family: var(--font-sans);
  padding: 9px 16px; cursor: pointer; border: none;
  transition: all 0.2s; line-height: 1;
  height: 36px;
}

.btn:disabled { opacity: 0.5; pointer-events: none; }

.btn-default { background: var(--primary); color: var(--primary-foreground); }
.btn-default:hover { background: rgba(0,229,255,0.9); box-shadow: 0 0 15px rgba(0,229,255,0.3); }

.btn-destructive { background: var(--destructive); color: #fff; }
.btn-destructive:hover { background: rgba(239,68,68,0.9); }

.btn-outline {
  background: transparent; border: 1px solid var(--border);
  color: var(--foreground);
}
.btn-outline:hover { background: var(--accent); color: var(--accent-foreground); }

.btn-secondary { background: var(--secondary); color: var(--secondary-foreground); }
.btn-secondary:hover { background: rgba(26,30,46,0.8); }

.btn-ghost { background: transparent; color: var(--foreground); }
.btn-ghost:hover { background: var(--accent); color: var(--accent-foreground); }

.btn-link {
  background: transparent; color: var(--primary);
  text-decoration: underline; text-underline-offset: 4px; padding: 0; height: auto;
}
.btn-link:hover { opacity: 0.8; }

.btn-sm { padding: 6px 12px; font-size: 13px; height: 32px; }
.btn-lg { padding: 10px 24px; font-size: 15px; height: 40px; }
.btn-icon { padding: 9px; width: 36px; height: 36px; }

.btn--loading { opacity: 0.7; pointer-events: none; }

/* ═══ INPUTS ═══ */
.input, .input-term, .input-field {
  background: var(--input-bg); border: 1px solid var(--border);
  color: var(--foreground); padding: 12px 16px;
  font-family: var(--font-sans); font-size: 14px; font-weight: 400;
  width: 100%; border-radius: 8px; outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input::placeholder, .input-term::placeholder, .input-field::placeholder { color: var(--muted-foreground); }

.input:focus, .input-term:focus, .input-field:focus {
  border-color: rgba(0,229,255,0.5);
  box-shadow: 0 0 0 3px rgba(0,229,255,0.15);
}

.input:disabled, .input-term:disabled, .input-field:disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }

.input-sm { padding: 8px 12px; font-size: 13px; }

textarea.input, textarea.input-term, textarea.input-field {
  resize: vertical; min-height: 100px; line-height: 1.5;
}

select.input, select.input-term, select.input-field {
  cursor: pointer; appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M0 0l6 8 6-8z' fill='%236B7280'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
  padding-right: 32px;
}

/* Multi-select fix: no dropdown arrow, styled options */
select[multiple].input, select[multiple].input-term, select[multiple].input-field {
  appearance: auto;
  -webkit-appearance: none;
  background-image: none;
  padding: 8px;
}
select[multiple].input option, select[multiple].input-term option, select[multiple].input-field option {
  padding: 10px 12px;
  border-radius: 6px;
  color: var(--foreground);
  background: var(--input-bg);
  cursor: pointer;
}
select[multiple].input option:checked, select[multiple].input-term option:checked, select[multiple].input-field option:checked {
  background: rgba(0,229,255,0.15);
  color: var(--primary);
}
select[multiple].input option:disabled, select[multiple].input-term option:disabled, select[multiple].input-field option:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}


/* ═══ TAGS ═══ */
.tag {
  display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: 4px;
  font-size: 12px; font-family: var(--font-mono);
  border: 1px solid transparent;
}

.tag-cyan   { background: rgba(0,229,255,0.1);  color: #00E5FF; border-color: rgba(0,229,255,0.3); }
.tag-violet { background: rgba(124,58,237,0.1); color: #a78bfa; border-color: rgba(124,58,237,0.3); }
.tag-amber  { background: rgba(255,176,32,0.1);  color: #FFB020; border-color: rgba(255,176,32,0.3); }
.tag-green  { background: rgba(46,204,113,0.1);  color: #2ECC71; border-color: rgba(46,204,113,0.3); }
.tag-red    { background: rgba(239,68,68,0.1);   color: #EF4444; border-color: rgba(239,68,68,0.3); }
.tag-default { background: rgba(113,113,122,0.15); color: #a1a1aa; border-color: rgba(113,113,122,0.3); }
.tag-frontend { background: rgba(0,229,255,0.1); color: #00E5FF; border-color: rgba(0,229,255,0.3); }
.tag-design { background: rgba(124,58,237,0.1); color: #a78bfa; border-color: rgba(124,58,237,0.3); }
.tag-backend { background: rgba(255,176,32,0.1); color: #FFB020; border-color: rgba(255,176,32,0.3); }
.tag-devops { background: rgba(239,68,68,0.1); color: #EF4444; border-color: rgba(239,68,68,0.3); }

/* ═══ BADGES ═══ */
.badge {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 6px; border: 1px solid transparent;
  padding: 2px 8px; font-size: 12px; font-weight: 500;
  width: fit-content; white-space: nowrap;
}

.badge-default { background: var(--primary); color: var(--primary-foreground); }
.badge-secondary { background: var(--secondary); color: var(--secondary-foreground); }
.badge-destructive { background: var(--destructive); color: #fff; }
.badge-outline { border-color: var(--border); color: var(--foreground); background: transparent; }

/* ═══ STATUS TAGS ═══ */
.status-open        { color: var(--chart-1); }
.status-in_progress { color: var(--chart-4); }
.status-completed   { color: var(--chart-3); }
.status-draft       { color: var(--muted-foreground); }
.status-cancelled   { color: var(--chart-5); }
.status-active      { color: var(--chart-1); }
.status-extended    { color: var(--chart-4); }
.status-submitted   { color: var(--chart-1); }
.status-approved    { color: var(--chart-3); }
.status-rejected    { color: var(--chart-5); }

/* ═══ CARDS ═══ */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.card-header {
  padding: 24px 24px 0;
  display: flex; flex-direction: column; gap: 4px;
}

.card-title {
  font-size: 18px; font-weight: 500; color: var(--foreground);
}

.card-desc {
  font-size: 14px; color: var(--muted-foreground);
}

.card-content { padding: 24px; font-size: 14px; color: var(--foreground); }
.card-body { padding: 24px; }
.card-footer { padding: 0 24px 24px; display: flex; align-items: center; gap: 8px; }

/* ═══ STARS (Difficulty) ═══ */
.stars { display: flex; gap: 2px; }
.star-filled { fill: #FFB020; stroke: #FFB020; filter: drop-shadow(0 0 3px #FFB020); }
.star-empty { fill: none; stroke: #374151; }

/* ═══ STAT CARD ═══ */
.stat-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
  display: flex; flex-direction: column; gap: 4px;
}

.stat-label {
  font-size: 12px; color: #6B7280; text-transform: uppercase;
  letter-spacing: 0.05em; font-family: var(--font-mono);
}

.stat-value {
  font-family: var(--font-mono); font-weight: 700; font-size: 24px;
}

.stat-sub { font-size: 12px; color: #6B7280; }
.stat-change { font-size: 11px; font-family: var(--font-mono); }

/* ═══ HUD GRID ═══ */
.hud-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.hud-grid .hud-panel { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; display: flex; flex-direction: column; }
.hud-panel-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.hud-panel-title { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: #6B7280; font-family: var(--font-mono); display: flex; align-items: center; gap: 6px; }
.hud-panel-title svg { opacity: 0.7; flex-shrink: 0; }
.hud-panel-body { padding: 12px 16px; flex: 1; }
.hud-panel-body .chart-container { max-width: 100%; overflow: hidden; }

/* ═══ ACTIVITY FEED (HUD) ═══ */
.activity-feed { display: flex; flex-direction: column; }
.activity-item { display: flex; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--border); transition: background 0.15s; }
.activity-item:last-child { border-bottom: none; }
.activity-item:hover { background: rgba(0,229,255,0.03); }
.activity-icon { flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%; background: rgba(0,229,255,0.06); display: flex; align-items: center; justify-content: center; }
.activity-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.activity-text { font-size: 12px; color: var(--foreground); line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.activity-time { font-size: 10px; color: #6B7280; font-family: var(--font-mono); }
.activity-empty { padding: 24px 16px; text-align: center; color: #6B7280; font-size: 12px; }

/* ═══ MILESTONES (HUD) ═══ */
.milestone-section { display: flex; flex-direction: column; }
.milestone-item { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.milestone-item:last-child { border-bottom: none; }
.milestone-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.milestone-name { font-size: 13px; font-weight: 500; color: var(--foreground); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.milestone-date { font-size: 10px; color: #6B7280; font-family: var(--font-mono); }
.milestone-countdown { text-align: center; flex-shrink: 0; margin-left: 12px; }
.countdown-value { font-size: 22px; font-weight: 700; font-family: var(--font-mono); color: var(--primary); line-height: 1; }
.countdown-value.urgent { color: var(--chart-4); }
.countdown-value.overdue { color: #EF4444; }
.countdown-unit { font-size: 11px; font-weight: 400; color: #6B7280; margin-left: 1px; }
.countdown-label { font-size: 9px; text-transform: uppercase; letter-spacing: 0.05em; color: #6B7280; font-family: var(--font-mono); margin-top: 2px; }

/* ═══ HUD responsive ═══ */
@media (max-width: 1200px) { .hud-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .hud-grid { grid-template-columns: 1fr; } }

/* ═══ MISSION CARD ═══ */
.mission-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 16px;
  display: flex; flex-direction: column; gap: 12px;
  transition: all 0.2s; cursor: pointer;
}

.mission-card:hover {
  border-color: rgba(0,229,255,0.25);
  box-shadow: 0 0 20px rgba(0,229,255,0.08);
}

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

.mission-card-code { font-family: var(--font-mono); font-size: 9px; color: #525252; }
.mission-card-title { font-size: 13px; font-weight: 600; color: var(--foreground); margin-bottom: 4px; }
.mission-card-desc { font-size: 11px; color: var(--muted-foreground); margin-bottom: 8px; line-height: 1.4; }
.mission-card-footer { display: flex; justify-content: space-between; align-items: center; }
.mission-card-xp { font-family: var(--font-mono); font-size: 12px; color: var(--primary); font-weight: 700; }

.mission-id { font-family: var(--font-mono); font-size: 12px; color: #6B7280; }

.mission-title {
  color: var(--foreground); font-size: 14px; font-weight: 500;
  line-height: 1.3; margin-top: 8px;
}

.mission-meta {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px;
}

.mission-footer {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 12px; border-top: 1px solid rgba(255,255,255,0.06);
}

.mission-xp {
  display: flex; align-items: center; gap: 4px;
  font-family: var(--font-mono); font-weight: 700; font-size: 14px;
  color: var(--primary);
}

.mission-deadline {
  display: flex; align-items: center; gap: 4px;
  color: #6B7280; font-size: 12px;
}

.mission-claim {
  width: 100%; padding: 8px; border-radius: 8px;
  font-size: 12px; font-family: var(--font-mono); font-weight: 600;
  background: rgba(0,229,255,0.1); color: var(--primary);
  border: 1px solid rgba(0,229,255,0.3); cursor: pointer;
  text-align: center; transition: all 0.2s;
}

.mission-claim:hover { background: rgba(0,229,255,0.2); }
.mission-claim:disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }

/* ═══ MISSION LIST ROW ═══ */
.mission-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,0.04);
}

.mission-row:last-child { border-bottom: none; }
.mission-row-id { font-family: var(--font-mono); font-size: 13px; color: var(--primary); }
.mission-row-name { font-size: 13px; color: var(--foreground); }
.mission-row-meta { font-family: var(--font-mono); font-size: 11px; color: var(--muted-foreground); }
.mission-row-xp { font-family: var(--font-mono); font-size: 13px; color: var(--primary); }

/* ═══ FEED POST ═══ */
.feed-post {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 16px; transition: all 0.2s;
  margin-bottom: 8px;
}

.feed-post.help { border-color: rgba(255,176,32,0.3); box-shadow: 0 0 12px rgba(255,176,32,0.06); }

.feed-help-label {
  display: flex; align-items: center; gap: 6px; margin-bottom: 8px;
}

.feed-help-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #FFB020; animation: pulse 2s ease-in-out infinite;
}

.feed-help-text { font-size: 12px; font-family: var(--font-mono); color: #FFB020; font-weight: 700; }

.feed-header { display: flex; align-items: flex-start; gap: 12px; }
.feed-body { flex: 1; }

.feed-user-row { display: flex; justify-content: space-between; align-items: center; }
.feed-user-name { font-size: 14px; font-weight: 500; color: var(--foreground); }
.feed-time { font-size: 12px; color: #525252; font-family: var(--font-mono); }
.feed-text { font-size: 14px; color: #a1a1aa; margin-top: 4px; }

.feed-text .highlight { color: var(--primary); font-family: var(--font-mono); }
.feed-text .highlight-amber { color: #FFB020; font-family: var(--font-mono); }

.feed-reactions { display: flex; gap: 8px; margin-top: 12px; }

.feed-reaction-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 10px; background: var(--secondary); border-radius: 9999px;
  font-size: 12px; color: #a1a1aa; cursor: pointer; border: none;
  font-family: var(--font-mono); transition: all 0.2s;
}

.feed-reaction-btn:hover { background: #27272A; color: var(--foreground); }

.feed-post-header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.feed-post-author { font-size: 13px; font-weight: 500; color: var(--foreground); }
.feed-post-time { font-family: var(--font-mono); font-size: 9px; color: #525252; margin-left: auto; flex-shrink: 0; }
.feed-post-content { font-size: 13px; line-height: 1.5; color: var(--muted-foreground); margin-bottom: 8px; }
.feed-post-actions { display: flex; gap: 16px; font-size: 12px; color: var(--muted-foreground); padding-top: 4px; }
.feed-post-actions span { cursor: pointer; transition: color 0.15s; }
.feed-post-actions span:hover { color: var(--foreground); }

/* ═══ FEED COMPOSER ═══ */
.feed-composer {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 16px;
  display: flex; align-items: flex-start; gap: 12px;
  margin-bottom: 12px;
}

.feed-composer-input {
  flex: 1; background: var(--secondary); border: 1px solid transparent;
  color: var(--foreground); padding: 10px 14px;
  font-family: var(--font-sans); font-size: 14px; border-radius: 8px;
  outline: none; transition: all 0.2s;
}

.feed-composer-input:focus { border-color: rgba(0,229,255,0.3); }
.feed-composer-input::placeholder { color: var(--muted-foreground); }

.feed-composer-btn {
  padding: 10px 20px; background: var(--primary); color: var(--primary-foreground);
  border: none; border-radius: 8px; font-family: var(--font-mono);
  font-size: 12px; font-weight: 600; cursor: pointer; transition: all 0.2s;
}

.feed-composer-btn:hover { background: rgba(0,229,255,0.9); }

/* ═══ NOTIFICATION ITEM ═══ */
.notif-item {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 12px 16px;
  display: flex; align-items: flex-start; gap: 12px; cursor: pointer;
  transition: all 0.2s;
}

.notif-item.unread { border-color: rgba(0,229,255,0.2); }
.notif-item.read { opacity: 0.7; }

.notif-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--primary); flex-shrink: 0; margin-top: 4px;
  box-shadow: 0 0 6px rgba(0,229,255,0.6);
}

.notif-dot.hidden { visibility: hidden; }

.notif-content { flex: 1; }
.notif-title { font-size: 14px; font-weight: 500; color: var(--foreground); }
.notif-body { font-size: 12px; color: #6B7280; margin-top: 2px; }
.notif-time { font-size: 12px; color: #525252; font-family: var(--font-mono); flex-shrink: 0; }

.notif-icon {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 12px;
}

/* ═══ AGM CARD ═══ */
.agm-card {
  border-radius: var(--radius-lg); padding: 20px; position: relative;
  overflow: hidden; transition: all 0.2s;
}

.agm-card.high {
  border: 1px solid rgba(239,68,68,0.3);
  background: rgba(239,68,68,0.04);
  box-shadow: 0 0 20px rgba(239,68,68,0.06);
}

.agm-card.medium {
  border: 1px solid rgba(124,58,237,0.4);
  background: rgba(124,58,237,0.06);
  box-shadow: 0 0 20px rgba(124,58,237,0.06);
}

.agm-card.low {
  border: 1px solid rgba(124,58,237,0.2);
  background: rgba(124,58,237,0.06);
}

.agm-content { position: relative; }
.agm-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }

.agm-badge {
  font-family: var(--font-mono); font-size: 11px; font-weight: 700;
  padding: 2px 8px; border-radius: 4px;
}

.agm-badge.high { background: rgba(239,68,68,0.2); color: #EF4444; }
.agm-badge.medium { background: rgba(124,58,237,0.2); color: #a78bfa; }
.agm-badge.low { background: rgba(124,58,237,0.15); color: #a78bfa; }

.agm-time { font-family: var(--font-mono); font-size: 11px; color: #525252; }

.agm-body {
  font-family: var(--font-mono); font-size: 13px;
  color: #d4d4d8; line-height: 1.6; letter-spacing: 0.01em;
}

/* ═══ PODIUM ═══ */
.podium {
  display: grid; grid-template-columns: 1fr 1.2fr 1fr;
  gap: 12px; align-items: end;
}

.podium-item { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.podium-avatar { border-radius: 50%; margin: 0 auto; display: flex; align-items: center; justify-content: center; font-family: var(--font-mono); }
.podium-crown { color: #FFB020; filter: drop-shadow(0 0 6px #FFB020); }

.podium-name { font-size: 13px; font-weight: 500; color: var(--foreground); text-align: center; }

.podium-bar {
  width: 100%; border-radius: 8px 8px 0 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}

.podium-bar.first {
  height: 112px;
  background: linear-gradient(180deg, rgba(0,229,255,0.1), rgba(0,229,255,0.05));
  border: 1px solid rgba(0,229,255,0.25);
  box-shadow: 0 0 20px rgba(0,229,255,0.1);
}

.podium-bar.second { height: 80px; background: var(--card); border: 1px solid var(--border); }
.podium-bar.third { height: 64px; background: var(--card); border: 1px solid var(--border); }

.podium-rank {
  font-family: var(--font-mono); font-weight: 700; font-size: 24px;
}

.podium-rank.first { color: var(--primary); text-shadow: 0 0 10px rgba(0,229,255,0.5); }
.podium-rank.second { color: #d4d4d8; }
.podium-rank.third { color: #FFB020; }

.podium-xp { font-family: var(--font-mono); font-size: 11px; color: #6B7280; margin-top: 4px; }
.podium-xp.first { color: var(--primary); }

/* ═══ LEADERBOARD ROW ═══ */
.lb-row {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 12px 16px;
  display: flex; align-items: center; gap: 16px;
  transition: all 0.2s;
}

.lb-row:hover { border-color: rgba(0,229,255,0.2); }

.lb-rank { font-family: var(--font-mono); color: #6B7280; width: 24px; text-align: center; font-size: 14px; }

.lb-rank-change { font-family: var(--font-mono); font-size: 11px; display: flex; align-items: center; gap: 2px; width: 32px; }
.lb-rank-change.up { color: #2ECC71; }
.lb-rank-change.down { color: #EF4444; }
.lb-rank-change.flat { color: #525252; }

.lb-info { flex: 1; }
.lb-name { font-size: 14px; font-weight: 500; color: var(--foreground); }
.lb-title { font-family: var(--font-mono); font-size: 11px; color: #6B7280; margin-top: 1px; }

/* ═══ LEADERBOARD TABLE (UI Kit) ═══ */
.leader-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid rgba(255,255,255,0.04); font-size: 12px; }
.leader-rank { width: 20px; font-family: var(--font-mono); font-size: 10px; color: #525252; text-align: center; }
.leader-name { flex: 1; }
.leader-score { font-family: var(--font-mono); font-size: 11px; color: var(--primary); font-weight: 600; }
.lb-xp { font-family: var(--font-mono); font-weight: 700; font-size: 14px; color: var(--primary); min-width: 96px; text-align: right; }
.lb-xp-bar { flex: 1; max-width: 200px; }

/* ═══ DIALOG / MODAL ═══ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 9998;
  background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
}

.modal-content {
  background: var(--background); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; max-width: 420px;
  width: 90%; box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.modal-close {
  float: right; background: none; border: none;
  color: #6B7280; cursor: pointer; padding: 4px;
}

.modal-title { font-size: 18px; font-weight: 600; color: var(--foreground); margin-bottom: 8px; }
.modal-desc { font-size: 14px; color: var(--muted-foreground); margin-bottom: 20px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; }
.modal-actions .btn { width: auto; }

/* ═══ LEVEL UP MODAL ═══ */
.level-up-modal {
  background: var(--background); border: 1px solid rgba(255,176,32,0.4);
  border-radius: var(--radius-lg); padding: 32px; text-align: center;
  box-shadow: 0 0 40px rgba(255,176,32,0.15);
}

.modal-glow {
  position: absolute; inset: -4px;
  border: 2px solid var(--chart-4);
  animation: pulseGlow 1s ease-in-out infinite alternate;
  pointer-events: none; border-radius: var(--radius-lg);
}

@keyframes pulseGlow {
  from { box-shadow: 0 0 20px rgba(255,179,0,0.3); }
  to   { box-shadow: 0 0 40px rgba(255,179,0,0.6); }
}

.level-up-flash {
  animation: levelUpFlash 0.6s ease-out;
}

@keyframes levelUpFlash {
  0%   { box-shadow: 0 0 0 rgba(255,176,32,0); }
  50%  { box-shadow: 0 0 40px rgba(255,176,32,0.5); }
  100% { box-shadow: 0 0 0 rgba(255,176,32,0); }
}

/* ═══ TABS ═══ */
.tabs-list {
  display: inline-flex; background: var(--muted); padding: 3px;
  border-radius: var(--radius-lg); height: 36px; align-items: center;
}

.tab-trigger {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 4px 12px; border-radius: 10px; font-size: 13px; font-weight: 500;
  background: transparent; color: #6B7280; cursor: pointer; border: none;
  height: calc(100% - 2px); transition: all 0.15s;
}

.tab-trigger.active {
  background: var(--card); color: var(--foreground);
}

/* ═══ TABLE ═══ */
.chart-container {
  position: relative;
  max-width: 100%;
  overflow: hidden;
}
.chart-container canvas {
  max-width: 100%;
  height: auto !important;
  max-height: 300px;
}

.table-view {
  width: 100%; border-collapse: collapse; font-size: 14px;
}

.table-view th {
  text-align: left; font-family: var(--font-mono); font-size: 11px;
  color: #6B7280; text-transform: uppercase; letter-spacing: 0.05em;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
}

.table-view td {
  padding: 12px 16px; border-bottom: 1px solid rgba(255,255,255,0.04);
  color: var(--foreground);
}

.table-view tr:last-child td { border-bottom: none; }
.table-view tr:hover td { background: rgba(255,255,255,0.02); }

/* ═══ SCORE BAR ═══ */
.score-bar-wrap { display: flex; flex-direction: column; gap: 16px; }

.score-bar-header { display: flex; justify-content: space-between; margin-bottom: 6px; }
.score-bar-label { font-family: var(--font-mono); font-size: 12px; color: #a1a1aa; }
.score-bar-value { font-family: var(--font-mono); font-size: 12px; font-weight: 700; }

.score-bar-track {
  height: 8px; background: #27272A; border-radius: 9999px; overflow: hidden;
}

.score-bar-fill {
  height: 100%; border-radius: 9999px; transition: width 0.3s;
}

/* ═══ SKELETON ═══ */
.skeleton {
  background: linear-gradient(90deg, #1A1E2E 25%, #27272A 50%, #1A1E2E 75%);
  background-size: 200% 100%; animation: shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius);
}

/* ═══ TOAST ═══ */
.toast-container {
  position: fixed; top: 16px; right: 16px;
  z-index: 10001;
  display: flex; flex-direction: column;
  gap: 8px; pointer-events: none;
}

.toast {
  pointer-events: auto;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  min-width: 280px; max-width: 400px;
  animation: toastIn 0.3s ease;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

.toast-success { border-color: rgba(0,229,255,0.3); }
.toast-error { border-color: rgba(239,68,68,0.3); }
.toast-info { border-color: rgba(124,58,237,0.3); }

.toast-title {
  color: var(--primary); font-size: 13px; font-weight: 500;
}

.toast-error .toast-title { color: var(--destructive); }
.toast-info .toast-title { color: var(--accent); }

.toast-msg {
  color: var(--muted-foreground); font-size: 12px; margin-top: 2px;
}

@keyframes toastIn {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

@keyframes toastOut {
  from { transform: translateX(0);    opacity: 1; }
  to   { transform: translateX(100%); opacity: 0; }
}

/* ═══ HTMX INDICATOR / SPINNER ═══ */
.htmx-indicator {
  display: none;
}
.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator {
  display: inline-block;
}
.spinner {
  width: 16px; height: 16px; border: 2px solid var(--border);
  border-top-color: var(--primary); border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══ ALPINE TRANSITIONS ═══ */
.toast-enter {
  animation: toastIn 0.3s ease;
}
.toast-leave {
  animation: toastOut 0.3s ease forwards;
}

/* ═══ PROGRESS BAR ═══ */
.progress-track {
  height: 8px; background: rgba(0,229,255,0.2);
  border-radius: 9999px; overflow: hidden;
}

.progress-fill {
  height: 100%; border-radius: 9999px;
  background: var(--primary); transition: all 0.3s;
}

/* ═══ FILTER BAR ═══ */
.filter-bar {
  display: flex; gap: 6px; flex-wrap: wrap; align-items: center;
}

.filter-btn {
  padding: 6px 14px; border-radius: 8px; font-family: var(--font-mono);
  font-size: 11px; cursor: pointer; border: 1px solid transparent;
  transition: all 0.2s;
}

.filter-btn.primary { background: var(--secondary); color: var(--muted-foreground); border-color: transparent; }
.filter-btn.primary:hover { color: var(--foreground); }
.filter-btn.primary.active { background: rgba(0,229,255,0.15); color: var(--primary); border-color: rgba(0,229,255,0.3); }
.filter-btn.violet.active { background: rgba(124,58,237,0.15); color: #a78bfa; border-color: rgba(124,58,237,0.3); }
.filter-btn.amber.active { background: rgba(255,176,32,0.15); color: #FFB020; border-color: rgba(255,176,32,0.3); }

/* ═══ STEP INDICATOR ═══ */
.step-indicator { display: flex; align-items: center; gap: 0; margin-bottom: 24px; }

.step-dot {
  width: 28px; height: 28px; border-radius: 50%; display: flex;
  align-items: center; justify-content: center; font-family: var(--font-mono);
  font-size: 11px; font-weight: 700; flex-shrink: 0; transition: all 0.3s;
}

.step-dot.completed { background: var(--primary); color: var(--primary-foreground); }
.step-dot.active { background: rgba(0,229,255,0.2); color: var(--primary); border: 2px solid var(--primary); }
.step-dot.pending { background: var(--secondary); color: #525252; }
.step-line { flex: 1; height: 2px; background: var(--secondary); margin: 0 4px; }
.step-line.completed { background: var(--primary); }

/* ═══ SETTINGS ═══ */
.settings-section { margin-bottom: 24px; }

.settings-section-title {
  font-family: var(--font-mono); font-size: 12px; color: var(--muted-foreground);
  text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 12px;
  padding-bottom: 8px; border-bottom: 1px solid var(--border);
}

.settings-field { margin-bottom: 12px; }

.settings-field label {
  display: block; font-size: 12px; color: #a1a1aa; margin-bottom: 4px;
  font-family: var(--font-mono);
}

.settings-input {
  width: 100%; background: var(--input-bg); border: 1px solid var(--border);
  color: var(--foreground); padding: 10px 14px; border-radius: 8px;
  font-family: var(--font-sans); font-size: 14px; outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.settings-input:focus { border-color: rgba(0,229,255,0.5); box-shadow: 0 0 0 3px rgba(0,229,255,0.15); }

/* ═══ SWITCH / TOGGLE ═══ */
.switch-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,0.04);
}

.switch-row:last-child { border-bottom: none; }
.switch-label { font-size: 13px; color: var(--foreground); }
.switch-desc { font-size: 11px; color: var(--muted-foreground); margin-top: 1px; }

.switch-track {
  width: 36px; height: 20px; background: #374151; border-radius: 9999px;
  position: relative; cursor: pointer; transition: all 0.2s; flex-shrink: 0;
}

.switch-track.on { background: var(--primary); }

.switch-thumb {
  width: 16px; height: 16px; background: #fff; border-radius: 50%;
  position: absolute; top: 2px; left: 2px; transition: all 0.2s;
}

.switch-track.on .switch-thumb { left: 18px; }

/* ═══ CHAT ═══ */
.chat-layout { display: flex; border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; background: var(--card); }

.chat-conv-list { width: 200px; border-right: 1px solid var(--border); flex-shrink: 0; }

.chat-conv-header {
  padding: 12px; border-bottom: 1px solid var(--border);
  font-family: var(--font-mono); font-size: 10px; color: var(--muted-foreground);
  text-transform: uppercase; letter-spacing: 0.05em;
}

.chat-conv-item {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; cursor: pointer; transition: all 0.15s;
}

.chat-conv-item:hover { background: rgba(255,255,255,0.03); }
.chat-conv-item.active { background: rgba(0,229,255,0.08); }
.chat-conv-name { font-size: 12px; color: var(--foreground); flex: 1; }
.chat-conv-time { font-size: 10px; color: #525252; font-family: var(--font-mono); }

.chat-main { flex: 1; display: flex; flex-direction: column; }

.chat-main-header {
  padding: 12px 14px; border-bottom: 1px solid var(--border);
  font-size: 13px; font-weight: 500; color: var(--foreground);
}

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

.chat-msg { max-width: 75%; padding: 8px 12px; border-radius: 12px; font-size: 13px; line-height: 1.4; }
.chat-msg.own { align-self: flex-end; background: var(--primary); color: var(--primary-foreground); border-bottom-right-radius: 4px; }
.chat-msg.other { align-self: flex-start; background: var(--secondary); color: var(--foreground); border-bottom-left-radius: 4px; }
.chat-msg-time { font-size: 9px; opacity: 0.6; margin-top: 2px; font-family: var(--font-mono); }

.chat-composer { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--border); }

.chat-composer input {
  flex: 1; background: var(--secondary); border: 1px solid transparent;
  color: var(--foreground); padding: 8px 12px; border-radius: 8px;
  font-size: 13px; outline: none;
}

.chat-composer input:focus { border-color: rgba(0,229,255,0.3); }

.chat-composer button {
  padding: 8px 14px; background: var(--primary); color: var(--primary-foreground);
  border: none; border-radius: 8px; cursor: pointer;
  font-family: var(--font-mono); font-size: 11px; font-weight: 600;
}

/* ═══ BADGE GRID ═══ */
.badge-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }

.badge-cell {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 16px 8px; text-align: center;
  transition: all 0.2s;
}

.badge-cell.unlocked { border-color: rgba(0,229,255,0.25); background: rgba(0,229,255,0.04); }
.badge-cell.locked { opacity: 0.4; }
.badge-cell-icon { font-size: 24px; margin-bottom: 4px; display: block; }
.badge-cell-name { font-family: var(--font-mono); font-size: 9px; color: var(--foreground); }

/* ═══ BOTTLENECK ITEM ═══ */
.bottleneck-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px; border-radius: 8px; margin-bottom: 6px;
}

.bottleneck-item.high { background: rgba(239,68,68,0.05); border: 1px solid rgba(239,68,68,0.2); }
.bottleneck-item.medium { background: rgba(255,176,32,0.05); border: 1px solid rgba(255,176,32,0.15); }

.bottleneck-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.bottleneck-dot.high { background: #EF4444; }
.bottleneck-dot.medium { background: #FFB020; }

.bottleneck-title { font-family: var(--font-mono); font-size: 12px; color: var(--foreground); font-weight: 600; }
.bottleneck-desc { font-size: 11px; color: var(--muted-foreground); margin-top: 1px; }
.bottleneck-action { margin-left: auto; font-family: var(--font-mono); font-size: 11px; color: var(--primary); cursor: pointer; }
.bottleneck-action:hover { text-decoration: underline; }

/* ═══ TIMER ═══ */
.mission-timer {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 8px;
  border: 1px solid var(--border);
  font-size: 11px; font-family: var(--font-mono);
  transition: border-color 0.3s, color 0.3s;
  border-radius: var(--radius-sm);
}

.timer-green { color: var(--chart-3); border-color: var(--chart-3); }
.timer-amber { color: var(--chart-4); border-color: var(--chart-4); }
.timer-red   { color: var(--chart-5); border-color: var(--chart-5); animation: timerBlink 0.5s step-end infinite; }

@keyframes timerBlink {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.5; }
}

/* ═══ HEX CELL ═══ */
.hex-cell {
  width: 80px; height: 92px; cursor: pointer; transition: transform 0.15s;
}

.hex-cell:hover { transform: scale(1.1); }
.hex-svg { width: 100%; height: 100%; }
.hex-bg { fill: var(--secondary); stroke: var(--border); stroke-width: 2; }
.hex-fill { fill: var(--primary); opacity: 0.3; }

.hex-level-1 .hex-fill { opacity: 0.2; }
.hex-level-2 .hex-fill { opacity: 0.4; }
.hex-level-3 .hex-fill { opacity: 0.6; }
.hex-level-4 .hex-fill { opacity: 0.8; }
.hex-level-5 .hex-fill { opacity: 1; }

.hex-label {
  fill: var(--muted-foreground);
  font-family: var(--font-mono); font-size: 10px;
}

.hex-level-text {
  fill: var(--foreground);
  font-family: var(--font-mono); font-size: 14px; font-weight: bold;
}

/* ═══ ONBOARDING CARD ═══ */
.onboarding-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px; max-width: 480px;
  margin: 0 auto;
}

.onboarding-card-title { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.onboarding-card-desc { font-size: 12px; color: var(--muted-foreground); margin-bottom: 16px; }

.interest-tag {
  display: inline-block; padding: 5px 12px; border-radius: 9999px;
  font-family: var(--font-mono); font-size: 10px;
  background: var(--secondary); color: var(--foreground);
  cursor: pointer; border: 1px solid transparent; margin: 3px;
}

.interest-tag.selected {
  background: rgba(0,229,255,0.1); color: var(--primary);
  border-color: rgba(0,229,255,0.2);
}

/* ═══ KEYBOARD SHORTCUT ═══ */
.kbd {
  display: inline-block; border: 1px solid var(--border);
  padding: 2px 6px; font-family: var(--font-mono); font-size: 10px;
  color: var(--muted-foreground); background: var(--input-bg);
  border-radius: 4px;
}

/* ═══ EMPTY STATE ═══ */
.empty-state {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 80px 20px; color: #525252;
}

.empty-state svg { opacity: 0.4; margin-bottom: 12px; }
.empty-state p { font-family: var(--font-mono); font-size: 14px; }

/* ═══ SECTION TITLE ═══ */
.section-title {
  color: var(--muted-foreground);
  font-size: 10px; letter-spacing: 2px; text-transform: uppercase;
  font-weight: 500; margin-bottom: 12px;
  padding-bottom: 4px; border-bottom: 1px solid var(--border);
}

/* ═══ ACCEPTANCE CRITERIA ═══ */
.acceptance-criteria { display: flex; flex-direction: column; gap: 0; }

.acceptance-criteria .criteria-line {
  display: flex; gap: 6px; padding: 0; margin: 0; line-height: 1.5;
}

.acceptance-criteria .criteria-bullet { flex-shrink: 0; }

/* ═══ PROFILE HEADER ═══ */
.profile-header-card {
  display: flex; gap: 20px; align-items: center;
  padding: 20px; margin-bottom: 16px;
}

/* ═══ SKILL BAR ═══ */
.skill-bar-row { display: flex; align-items: center; gap: 12px; }

.skill-bar-name {
  width: 80px; font-family: var(--font-mono); font-size: 11px;
  color: var(--foreground); flex-shrink: 0;
}

.skill-bar-track { flex: 1; }

.skill-bar-value {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--primary); width: 24px; text-align: right;
}

/* ═══ GRID UTILITIES ═══ */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }

/* ═══ SUBMISSION CARD ═══ */
.submission-card {
  border: 1px solid var(--border);
  background: var(--card);
  padding: 16px; margin-bottom: 16px;
  border-radius: var(--radius-lg);
}

.submission-header {
  display: flex; gap: 12px; align-items: center;
  margin-bottom: 8px; font-size: 13px; flex-wrap: wrap;
}

.submission-id { color: var(--primary); font-family: var(--font-mono); }
.submission-user { color: var(--foreground); font-weight: 500; }
.submission-mission { color: var(--muted-foreground); }
.submission-date { color: #525252; font-size: 11px; font-family: var(--font-mono); }

.submission-content {
  color: var(--muted-foreground);
  font-size: 13px; margin-bottom: 12px;
  padding: 8px; background: var(--secondary);
  border: 1px solid var(--border);
  white-space: pre-wrap; line-height: 1.5; border-radius: var(--radius-sm);
}

.submission-actions { display: flex; flex-direction: column; gap: 8px; }

/* ═══ BREADCRUMB ═══ */
.breadcrumb {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; margin-bottom: 16px;
}

.breadcrumb a { color: var(--muted-foreground); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb-sep { color: #525252; }
.breadcrumb-current { color: var(--muted-foreground); }

/* ═══ COMMENT ═══ */
.comment {
  padding: 8px; margin: 6px 0;
  border-left: 2px solid var(--border);
  font-size: 13px;
}

.comment-header { display: flex; gap: 8px; margin-bottom: 4px; }
.comment-author { color: var(--primary); font-size: 12px; font-weight: 500; }
.comment-time { color: #525252; font-size: 11px; font-family: var(--font-mono); }
.comment-content { color: var(--foreground); font-size: 13px; }

.comment-form { display: flex; gap: 8px; margin-top: 8px; }
.comment-form input { flex: 1; }

/* ═══ SKIP LINK ═══ */
.skip-link {
  position: absolute; top: -100px; left: 8px;
  padding: 8px 12px;
  background: var(--card); border: 1px solid var(--primary);
  color: var(--primary); font-family: var(--font-mono); font-size: 12px;
  z-index: 10000; text-decoration: none; transition: top 0.2s;
  border-radius: var(--radius-sm);
}

.skip-link:focus { top: 8px; }

/* ═══ FORM ═══ */
.form-group { display: flex; flex-direction: column; gap: 6px; }

.form-label {
  color: var(--muted-foreground);
  font-size: 12px; font-family: var(--font-mono);
}

.form-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ═══ DETAIL VIEW ═══ */
.detail-header { margin-bottom: 24px; }

.detail-header h2 {
  font-size: 20px; font-weight: 600; color: var(--foreground);
  margin-bottom: 12px;
}

.detail-meta { display: flex; gap: 12px; flex-wrap: wrap; }

.meta-item {
  padding: 4px 8px; border: 1px solid var(--border);
  font-size: 12px; color: var(--muted-foreground);
  border-radius: var(--radius-sm);
}

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

.detail-section h3 {
  font-size: 12px; letter-spacing: 1px;
  color: var(--muted-foreground); font-weight: 500;
  margin-bottom: 8px; padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}

.detail-section .section-content {
  color: var(--foreground);
  white-space: pre-wrap; margin-bottom: 16px;
  line-height: 1.7; font-size: 14px;
}

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

/* ═══ PROFILE GRID ═══ */
.profile-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px; margin: 16px 0;
}

.profile-card {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 24px 16px; border-radius: var(--radius);
  background: var(--card); border: 1px solid var(--border);
  text-decoration: none; transition: all 0.2s; cursor: pointer;
  color: var(--foreground);
}

.profile-card:hover {
  border-color: var(--profile-color, var(--primary));
  box-shadow: 0 0 20px color-mix(in srgb, var(--profile-color, var(--primary)) 15%, transparent);
  transform: translateY(-2px);
}

.profile-card-icon { font-size: 32px; line-height: 1; }
.profile-card-label { font-weight: 600; font-size: 14px; }
.profile-card-desc { font-size: 11px; color: var(--muted-foreground); text-align: center; line-height: 1.4; }
.profile-card-action { font-size: 11px; color: var(--primary); font-family: var(--font-mono); }

/* ═══ STEPPER ═══ */
.stepper { display: flex; gap: 4px; margin-bottom: 20px; justify-content: center; }
.stepper-step {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: var(--radius-sm);
  font-size: 11px; color: #525252; background: var(--surface-2);
}
.stepper-active { color: var(--foreground); background: var(--card); border: 1px solid var(--primary); }
.stepper-done { color: var(--primary); }
.stepper-num {
  width: 20px; height: 20px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 600; background: var(--surface-1);
}
.stepper-active .stepper-num { background: var(--primary); color: #0B0E14; }
.stepper-done .stepper-num { background: rgba(0,229,255,0.15); color: var(--primary); }

/* ═══ CHAT LIST ═══ */
.chat-search { margin-bottom: 16px; }
.chat-search-results { margin-top: 8px; }
.chat-search-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; border-radius: var(--radius-sm);
  text-decoration: none; color: var(--foreground);
  border: 1px solid var(--border); margin-bottom: 4px;
}
.chat-search-item:hover { border-color: var(--primary); background: rgba(0,229,255,0.03); }
.chat-search-name { font-weight: 500; flex: 1; }

.chat-list-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px; border-radius: var(--radius-sm);
  text-decoration: none; color: var(--foreground);
  border: 1px solid transparent; margin-bottom: 4px;
  transition: all 0.15s;
}
.chat-list-item:hover { border-color: var(--border); background: var(--surface-2); }
.chat-list-item.unread { border-color: var(--primary); background: rgba(0,229,255,0.03); }
.chat-list-label { font-size: 13px; font-weight: 500; }
.chat-list-preview { font-size: 11px; color: var(--muted-foreground); margin-top: 2px; }
.chat-list-meta { display: flex; align-items: center; gap: 4px; }
.chat-unread-badge {
  display: flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; border-radius: 9999px;
  background: var(--primary); color: #0B0E14;
  font-size: 10px; font-weight: 700; padding: 0 6px;
}

/* ═══ SKILL ROW ═══ */
.skill-row {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 0; border-bottom: 1px solid var(--border);
}
.skill-row:last-child { border-bottom: none; }
.skill-label { flex: 1; font-size: 12px; color: var(--foreground); }
.skill-slider { display: flex; align-items: center; gap: 8px; }

/* ═══ CHAR COUNT ═══ */
.char-count { font-size: 10px; color: #525252; font-family: var(--font-mono); text-align: right; }

/* ═══ FILE INPUT ═══ */
.file-upload {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; border: 1px dashed var(--border);
  border-radius: var(--radius-sm); cursor: pointer;
  font-size: 12px; transition: border-color 0.2s;
}
.file-upload:hover { border-color: var(--primary); }
.file-upload.has-file { border-style: solid; border-color: var(--primary); background: rgba(0,229,255,0.03); }
.file-upload input[type="file"] { display: none; }
.file-upload-icon { font-size: 16px; }
.file-upload-label { flex: 1; color: var(--muted-foreground); }
.file-upload-button {
  padding: 4px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); font-size: 11px;
  color: var(--foreground);
}

/* ═══ SKILLS COMPACT ═══ */
.skills-compact { display: flex; flex-direction: column; }

/* ═══ ADMIN FILTER BUTTONS ═══ */
.btn-active { border-color: var(--primary); color: var(--primary); background: rgba(0,229,255,0.08); }

/* ═══ CHAT READONLY NOTICE ═══ */
.chat-readonly-notice { font-size: 12px; color: var(--muted-foreground); text-align: center; padding: 16px; }

/* ═══ CSS ALIASES (template compatibility) ═══ */
.btn-primary { background: var(--primary); color: var(--primary-foreground); }
.btn-primary:hover { background: rgba(0,229,255,0.9); box-shadow: 0 0 15px rgba(0,229,255,0.3); }
.btn-danger { background: var(--destructive); color: #fff; }
.btn-danger:hover { background: rgba(239,68,68,0.9); }

.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-family: var(--font-mono); font-size: 11px; color: #6B7280; text-transform: uppercase; letter-spacing: 0.05em; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.table td { padding: 12px 16px; border-bottom: 1px solid rgba(255,255,255,0.04); color: var(--foreground); }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: rgba(255,255,255,0.02); }

.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tab { padding: 6px 14px; border-radius: 8px; font-family: var(--font-mono); font-size: 11px; cursor: pointer; border: 1px solid transparent; transition: all 0.2s; text-decoration: none; color: var(--muted-foreground); background: transparent; }
.tab:hover { color: var(--foreground); background: rgba(255,255,255,0.03); }
.tab.active { background: rgba(0,229,255,0.15); color: var(--primary); border-color: rgba(0,229,255,0.3); }

.badge-success { background: var(--chart-3); color: #0B0E14; }
.badge-warning { background: var(--chart-4); color: #0B0E14; }

/* ═══ TEXT UTILITIES ═══ */
.text-muted { color: var(--muted-foreground); }
.text-sm { font-size: 12px; }
.text-xs { font-size: 10px; }
.text-danger { color: var(--destructive); }
.ml-auto { margin-left: auto; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }

/* ═══ FOCUS VISIBLE ═══ */
:focus-visible { box-shadow: 0 0 0 3px var(--ring); outline: none; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible { box-shadow: 0 0 0 3px var(--ring); outline: none; }

/* ═══ PULSE ═══ */
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.5; } }

/* ═══ LOADING BAR ═══ */
.loading-bar {
  height: 4px; background: var(--secondary);
  border-radius: 9999px; overflow: hidden; position: relative;
}

.loading-bar::after {
  content: ''; position: absolute; top: 0; left: -30%;
  width: 30%; height: 100%;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  animation: loadSlide 1.5s ease-in-out infinite;
}

@keyframes loadSlide {
  0%   { left: -30%; }
  100% { left: 100%; }
}

/* ═══ AVATAR (simple) ═══ */
.avatar-sm {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 10px;
  background: rgba(0,229,255,0.1); color: var(--primary);
  border: 1.5px solid var(--primary); flex-shrink: 0;
}

.avatar-sm.violet { border-color: var(--accent); color: var(--accent); background: rgba(124,58,237,0.1); }
.avatar-sm.amber { border-color: var(--chart-4); color: var(--chart-4); background: rgba(255,176,32,0.1); }

/* ═══ RESPONSIVE OVERRIDES ═══ */
@media (max-width: 768px) {
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-4, .hud-grid, .badge-grid { grid-template-columns: 1fr 1fr; }
  .podium { grid-template-columns: 1fr; }
  .podium-bar.first, .podium-bar.second, .podium-bar.third { height: 60px; }
  .chat-layout { flex-direction: column; }
  .chat-conv-list { width: 100%; border-right: none; border-bottom: 1px solid var(--border); max-height: 120px; overflow-y: auto; }
  .chat-msg { max-width: 85%; }
  .skill-bar-row { flex-direction: column; align-items: flex-start; gap: 4px; }
  .profile-header-card { flex-direction: column; text-align: center; }
  .card-header { padding: 16px 16px 0; }
  .card-content { padding: 16px; }
  .card-body { padding: 16px; }
  .card-footer { padding: 0 16px 16px; }
  .chart-grid-2 { grid-template-columns: 1fr; }
  .missions-grid { grid-template-columns: 1fr; }
  .template-field-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .grid-4, .hud-grid, .badge-grid { grid-template-columns: 1fr; }
  .missions-grid { grid-template-columns: 1fr; }
  .chart-grid-2 { grid-template-columns: 1fr; }
  .template-field-grid { grid-template-columns: 1fr; }
  .stepper { flex-wrap: wrap; justify-content: flex-start; gap: 2px; }
  .stepper-step { font-size: 10px; padding: 4px 8px; }
  .feed-composer { flex-direction: column; }
  .feed-composer-btn { width: 100%; }
  .mission-card-footer { flex-direction: column; align-items: stretch; }
  .mission-actions { flex-direction: column; align-items: stretch; }
  .mission-actions .btn, .mission-actions form { width: 100%; }
  .pagination { flex-direction: column; gap: 8px; }
  .chat-msg { max-width: 95%; }
  .timer-display { font-size: 10px; }
  .table-view th, .table-view td { padding: 8px 8px; }
  .podium-name { font-size: 11px; }
  .filter-bar { flex-direction: column; align-items: stretch; }
  .filter-bar .input-wrap { margin-left: 0 !important; }
  .filter-btn { width: 100%; text-align: center; }
  .detail-meta { gap: 6px; }
  .notif-item { padding: 10px 12px; }
  .comment-form { flex-direction: column; }
  .comment-form .btn { width: 100%; }
  .page-header { flex-direction: column; align-items: stretch; }
  .page-header .btn, .page-header a.btn { width: 100%; text-align: center; }
  .modal-content { width: 95%; padding: 16px; }
  .profile-header-card { flex-direction: column; text-align: center; padding: 16px; }
  .detail-actions { flex-direction: column; }
  .detail-actions .btn, .detail-actions form { width: 100%; }
  .detail-actions form .btn { width: auto; }
  .detail-title { flex-direction: column; align-items: flex-start; }
  .form-actions { flex-direction: column; }
  .form-actions .btn { width: 100%; }
  .stat-row { flex-direction: column; align-items: flex-start; gap: 2px; }
  .breadcrumb { font-size: 11px; }
  .mission-meta { gap: 4px; }
  .mission-row { flex-direction: column; align-items: flex-start; gap: 4px; }
  .filter-form { flex-direction: column; }
  .filter-form > div { width: 100%; }
  .admin-card-body { flex-direction: column; align-items: flex-start; }
  .alert-item { flex-direction: column; align-items: flex-start; }
  .decompose-header { flex-direction: column; align-items: flex-start; }
  .lb-row { flex-wrap: wrap; gap: 8px; }
  .lb-xp-bar { max-width: 100%; width: 100%; }
  .card-header { padding: 12px 12px 0; }
  .card-content { padding: 12px; }
  .card-body { padding: 12px; }
  .card-footer { padding: 0 12px 12px; }
  .submission-header { flex-direction: column; align-items: flex-start; }
  .submission-actions { flex-direction: column; }
  .chat-list-item { flex-direction: column; align-items: flex-start; gap: 4px; }
  .admin-nav-link { min-width: 100%; }
  .engagement-table { font-size: 11px; }
  .settings-section .grid-2 { gap: 12px; }
  .settings-field { margin-bottom: 8px; }
  .tabs-list { width: 100%; overflow-x: auto; }
  .tab-trigger { font-size: 12px; padding: 4px 8px; white-space: nowrap; }
  .onboarding-card { padding: 16px; }
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .kpi-grid .stat-card { padding: 12px; }
  .stat-value { font-size: 18px; }
}

/* ═══════════════════════════════════════
   ADMIN LAYOUT — sidebar + content (CyanOS Dark)
   ═══════════════════════════════════════ */
.admin-layout {
  display: flex;
  gap: 16px;
  min-height: calc(100vh - 120px);
}

.admin-sidebar {
  width: 220px;
  min-width: 220px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  align-self: flex-start;
  position: sticky;
  top: 72px;
}

.admin-sidebar-header {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  text-align: center;
}

.admin-sidebar-title {
  display: block;
  color: var(--primary);
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-family: var(--font-mono);
  margin-bottom: 4px;
}

.admin-sidebar-user {
  display: block;
  color: var(--muted-foreground);
  font-size: 10px;
  font-family: var(--font-mono);
}

.admin-sidebar-nav {
  flex: 1;
  padding: 8px 0;
}

.admin-nav-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  color: var(--muted-foreground);
  text-decoration: none;
  font-size: 12px;
  transition: all 0.15s;
  border-left: 2px solid transparent;
}

.admin-nav-link:hover {
  background: rgba(0, 229, 255, 0.04);
  color: var(--foreground);
}

.admin-nav-link.active {
  background: rgba(0, 229, 255, 0.08);
  color: var(--foreground);
  border-left-color: var(--primary);
}

.admin-nav-link.logout {
  border-top: 1px solid var(--border);
  color: var(--destructive);
  margin-top: auto;
}

.admin-nav-link.logout:hover {
  background: rgba(239, 68, 68, 0.08);
}

.admin-nav-icon {
  color: var(--muted-foreground);
  font-size: 10px;
  font-family: var(--font-mono);
}

.admin-nav-link.active .admin-nav-icon {
  color: var(--primary);
}

.admin-main {
  flex: 1;
  min-width: 0;
}

.admin-main .card {
  margin-bottom: 16px;
}

.admin-sidebar-footer {
  padding: 0;
}

.admin-notif-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; border-radius: 9999px;
  background: var(--primary); color: var(--primary-foreground);
  font-size: 9px; font-weight: 700; padding: 0 5px;
  margin-left: auto;
}

@media (max-width: 768px) {
  .admin-layout { flex-direction: column; }
  .admin-sidebar {
    width: 100%;
    min-width: 100%;
    margin-right: 0;
    margin-bottom: 16px;
    position: static;
    top: auto;
  }
  .admin-sidebar-nav { display: flex; flex-wrap: wrap; padding: 4px; }
  .admin-nav-link { flex: 1; min-width: 120px; justify-content: center; border-left: none; border-bottom: 2px solid transparent; }
  .admin-nav-link.active { border-left-color: transparent; border-bottom-color: var(--primary); }
  .admin-nav-link.logout { border-top: none; margin-top: 0; }
}

/* ═══ MISSING UTILITY CLASSES — added by UI audit refactor ═══ */

/* Page header (title + action button row) */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 12px;
  flex-wrap: wrap;
}
.page-header h1 {
  font-size: 20px;
  font-weight: 600;
}
.page-header p { margin: 0; }

/* Mission list / grid containers */
.missions-list { display: flex; flex-direction: column; gap: 12px; }
.missions-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.input-wrap { position: relative; display: flex; align-items: center; }

/* Detail view */
.detail-view { max-width: 800px; }
.detail-title { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }

/* Submission display */
.submission-field { margin-bottom: 12px; }
.submission-value {
  font-size: 13px;
  color: var(--foreground);
  padding: 8px;
  background: var(--secondary);
  border-radius: var(--radius-sm);
  margin-top: 4px;
  word-break: break-word;
}
.submission-text {
  background: var(--secondary);
  padding: 12px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 12px;
  white-space: pre-wrap;
  line-height: 1.5;
}

/* Criteria list */
.criteria-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.criteria-list li {
  padding: 4px 0;
  padding-left: 16px;
  position: relative;
  font-size: 14px;
  line-height: 1.6;
}
.criteria-list li::before {
  content: "◆";
  position: absolute;
  left: 0;
  color: var(--primary);
  font-size: 10px;
}

/* Mission card inner elements */
.mission-desc {
  font-size: 13px;
  color: var(--muted-foreground);
  line-height: 1.5;
  margin: 4px 0;
}
.mission-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

/* Submission entry (history) */
.submission-entry {
  margin-bottom: 8px;
  padding: 8px;
  background: var(--surface-2);
  border-radius: 6px;
  border-left: 3px solid var(--border);
}

/* Profile layout */
.profile-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 24px;
  align-items: start;
}
.profile-sidebar {
  position: sticky;
  top: 72px;
}
.profile-main { min-width: 0; }
.profile-header {
  display: flex;
  gap: 20px;
  align-items: center;
  margin-bottom: 16px;
}
.profile-avatar { flex-shrink: 0; }
.profile-info { flex: 1; }
.avatar-img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 2px solid var(--primary);
  object-fit: cover;
}
.avatar-placeholder {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--secondary);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 700;
  color: var(--primary);
}
.profile-bio {
  font-size: 14px;
  color: var(--muted-foreground);
  line-height: 1.6;
}

/* Hex grid for skills */
.hex-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

/* Badge display */
.badge-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 8px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-align: center;
}
.badge-item.earned {
  border-color: rgba(0,229,255,0.25);
  background: rgba(0,229,255,0.04);
}
.badge-icon { font-size: 24px; display: block; }
.badge-name {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--foreground);
}

/* Missing badge variants */
.badge-primary {
  background: rgba(0,229,255,0.15);
  color: var(--primary);
  border-color: rgba(0,229,255,0.3);
}
.badge-danger { background: var(--destructive); color: #fff; }
.badge-green { background: var(--chart-3); color: #0B0E14; }

/* Missing tag variants */
.tag-green {
  background: rgba(46,204,113,0.1);
  color: #2ECC71;
  border-color: rgba(46,204,113,0.3);
}
.tag-primary {
  background: rgba(0,229,255,0.1);
  color: #00E5FF;
  border-color: rgba(0,229,255,0.3);
}

/* Feed stream */
.feed-stream {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Feed event inner elements */
.feed-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 12px;
}
.feed-time { font-family: var(--font-mono); color: #525252; }
.feed-user { font-weight: 500; color: var(--foreground); }
.feed-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted-foreground);
  margin-left: auto;
}
.feed-content {
  font-size: 14px;
  color: var(--foreground);
  line-height: 1.6;
  margin-bottom: 8px;
}
.feed-actions { display: flex; gap: 8px; }

/* Event comments */
.event-comments { margin-top: 8px; }

/* Notification item inner elements */
.notif-header {
  display: flex;
  align-items: center;
  gap: 8px;
}
.notif-text { flex: 1; font-size: 14px; color: var(--foreground); }
.notif-msg {
  font-size: 12px;
  color: var(--muted-foreground);
  margin: 4px 0 4px 16px;
}

/* Chat message display */
.chat-message {
  margin-bottom: 8px;
}
.chat-message-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}
.chat-message-author {
  font-weight: 500;
  font-size: 13px;
  color: var(--foreground);
}
.chat-message-time {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #525252;
}
.chat-message-body {
  font-size: 14px;
  color: var(--foreground);
  line-height: 1.5;
}

/* Timer icon */
.timer-icon { font-size: 14px; }
.timer-display { font-family: var(--font-mono); font-size: 13px; font-weight: 600; }

/* Level up flash */
.level-up-flash {
  margin-top: 8px;
  padding: 8px 12px;
  background: rgba(255,176,32,0.1);
  border: 1px solid rgba(255,176,32,0.3);
  border-radius: var(--radius-sm);
  color: #FFB020;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  animation: levelUpFlash 0.6s ease-out;
}

/* Onboarding extras */
.onboarding-body {
  margin: 16px 0;
  text-align: left;
}
.onboarding-body ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.onboarding-step {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  font-size: 13px;
  color: var(--foreground);
}
.onboarding-step span.tag-cyan {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}
.onboarding-hint {
  margin-top: 12px;
  font-size: 11px;
  color: var(--muted-foreground);
  text-align: center;
  font-family: var(--font-mono);
}
.onboarding-title { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.onboarding-sub { font-size: 14px; color: var(--muted-foreground); margin-bottom: 16px; }

/* Highlight row in leaderboard */
.lb-row.highlight {
  border-color: var(--primary);
  background: rgba(0,229,255,0.04);
}

/* Medal in leaderboard */
.lb-medal { font-size: 20px; }
.lb-user a { font-weight: 500; color: var(--foreground); }
.lb-user a:hover { color: var(--primary); }
.lb-level { font-family: var(--font-mono); font-size: 13px; color: var(--muted-foreground); }

/* Comment section wrapper */
.comments-section { margin-top: 12px; }
.comments-list { margin-bottom: 8px; }

/* Stat row (HUD) */
.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
}

/* Missing grid for notifications */
.notif-grid { display: flex; flex-direction: column; gap: 8px; }

/* Pending submissions list */
.pending-list { display: flex; flex-direction: column; gap: 12px; }

/* Admin detail page */
.admin-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 8px;
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px 0;
  margin-top: 16px;
  border-top: 1px solid var(--border);
}

/* KPI grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

/* Chart grid */
.chart-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

/* Admin card body (replaces inline card-body) */
.admin-card-body {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

/* Alerts */
.alert-section { margin-bottom: 24px; }
.alert-title { font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.alert-card {
  border-radius: var(--radius-lg);
  margin-bottom: 8px;
  overflow: hidden;
}
.alert-card.danger { border-color: var(--destructive); }
.alert-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  flex-wrap: wrap;
  gap: 8px;
}

/* Section heading with action */
.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.section-heading h3, .section-heading h4 { margin: 0; border: none; }

/* Card header with actions */
.card-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Activity log */
.activity-log-table { width: 100%; border-collapse: collapse; }
.activity-log-table th {
  padding: 8px 10px;
  color: var(--muted-foreground);
  font-weight: normal;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.activity-log-table td {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  color: var(--muted-foreground);
  font-size: 13px;
}
.activity-log-empty {
  padding: 20px;
  text-align: center;
  color: var(--muted-foreground);
}

/* Submission value display */
.submission-value-row {
  margin: 4px 16px;
  font-size: 12px;
}

/* Decomposed mission card */
.decompose-card {
  margin-bottom: 10px;
}
.decompose-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 6px;
}

/* AI training result */
.ai-result-card {
  border-color: var(--chart-4);
  margin-bottom: 24px;
}
.ai-result-pre {
  white-space: pre-wrap;
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--foreground);
  line-height: 1.6;
}

/* Inactivity breakdown */
.inactivity-section { margin-bottom: 12px; }
.inactivity-row {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  margin-bottom: 4px;
}

/* Mission card header */
.mission-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Engagement table */
.engagement-table { font-size: 12px; }
.engagement-table th {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.engagement-score { color: var(--chart-3); font-weight: 600; text-align: center; }
.engagement-active { font-size: 11px; color: var(--muted-foreground); text-align: center; }

/* Mission filters */
.mission-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* Tab nav */
.tab-nav {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

/* Mission select on assign page */
.mission-select-info {
  color: var(--muted-foreground);
  font-size: 10px;
}

/* Filter form */
.filter-form {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: flex-end;
  margin-bottom: 16px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.filter-label {
  display: block;
  font-size: 10px;
  color: var(--muted-foreground);
  font-family: var(--font-mono);
}

/* Onboarding modal extension */
.onboarding-modal {
  max-width: 520px;
  width: 90%;
}

/* ═══ TEMPLATE FIELD GRID ═══ */
.template-field-grid {
  grid-template-columns: 1fr 1fr 1fr auto;
}

/* ═══ KANBAN BOARD ═══ */
.kanban-board {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
    padding: 16px 20px;
    overflow-x: auto;
    min-height: 500px;
}

.kanban-column {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    min-width: 200px;
    max-height: calc(100vh - 280px);
}

.kanban-column-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: var(--surface);
    border-radius: 8px 8px 0 0;
    z-index: 1;
}

.kanban-column-count {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
    background: rgba(0,229,255,0.12);
    padding: 2px 8px;
    border-radius: 10px;
}

.kanban-column-body {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 60px;
}

.kanban-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 10px 12px;
    cursor: grab;
    transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
}

.kanban-card:hover {
    border-color: var(--primary);
    box-shadow: 0 0 0 1px rgba(0,229,255,0.15);
}

.kanban-card-dragging {
    opacity: 0.4;
    transform: rotate(3deg);
}

.kanban-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.kanban-card-title {
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 4px;
    line-height: 1.4;
}

.kanban-card-title a {
    color: var(--foreground);
    text-decoration: none;
}

.kanban-card-title a:hover {
    color: var(--primary);
}

.kanban-card-desc {
    font-size: 11px;
    line-height: 1.4;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.kanban-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    font-size: 11px;
    color: var(--muted-foreground);
}

.kanban-card-assignee,
.kanban-card-deadline,
.kanban-card-hours,
.kanban-card-points {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.kanban-card-points {
    background: rgba(0,229,255,0.12);
    color: var(--primary);
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 4px;
    font-family: var(--font-mono);
}

/* ── Responsive ── */
@media (max-width: 1200px) {
    .kanban-board {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .kanban-board {
        grid-template-columns: 1fr;
    }
    .kanban-column {
        max-height: none;
    }
    .kanban-column-body {
        max-height: 300px;
    }
}

/* ═══ SIDE DRAWER ═══ */
.drawer-overlay {
    position: fixed; inset: 0; z-index: 9999;
    background: rgba(0,0,0,0.5);
    opacity: 0; visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
}
.drawer-overlay.open {
    opacity: 1; visibility: visible;
}
.drawer-overlay.open .drawer-panel {
    transform: translateX(0);
}

.drawer-panel {
    position: fixed; top: 0; right: 0; bottom: 0;
    width: 480px; max-width: 100vw;
    background: var(--background);
    border-left: 1px solid var(--border);
    box-shadow: -4px 0 24px rgba(0,0,0,0.3);
    display: flex; flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.25s ease;
}

.drawer-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.drawer-title {
    font-size: 16px; font-weight: 600; color: var(--foreground);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    margin-right: 8px;
}
.drawer-close {
    background: none; border: none; color: var(--muted-foreground);
    font-size: 24px; cursor: pointer; padding: 0 4px; line-height: 1;
    flex-shrink: 0;
}
.drawer-close:hover { color: var(--foreground); }

.drawer-body {
    flex: 1; overflow-y: auto;
    padding: 20px;
}
.drawer-footer {
    display: flex; gap: 8px; align-items: center;
    padding: 12px 20px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

/* ── Detail grid inside drawer ── */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}
.detail-field {
    display: flex; flex-direction: column; gap: 2px;
}
.detail-label {
    font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px;
    color: var(--muted-foreground);
}
.detail-section {
    margin-bottom: 20px;
}
.detail-section-title {
    font-size: 13px; font-weight: 600;
    color: var(--foreground);
    margin-bottom: 8px;
}
.detail-text {
    font-size: 13px; line-height: 1.6;
    color: var(--muted-foreground);
    white-space: pre-wrap;
}
.detail-tags {
    display: flex; flex-wrap: wrap; gap: 6px;
}
.detail-list {
    list-style: none; padding: 0; margin: 0;
}
.detail-list li {
    padding: 4px 0;
    font-size: 13px;
    display: flex; align-items: center;
}

@media (max-width: 768px) {
    .drawer-panel { width: 100vw; }
    .detail-grid { grid-template-columns: 1fr; }
}

/* INPUT DATE */
input[type="date"] {
    color-scheme: dark;
}
input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(70%);
    cursor: pointer;
}
/* ═══ KANBAN BOARD (project tasks tab) ═══ */
/* Préfixé "project-" pour ne pas entrer en collision avec le kanban
   admin existant (.kanban-board / .kanban-column / .kanban-card ...
   défini plus haut, utilisé par admin/kanban.html) */
.project-kanban-board {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
  box-sizing: border-box;
}

.project-kanban-column {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.project-kanban-column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.project-kanban-column-count {
  background: var(--secondary);
  color: var(--secondary-foreground);
  border-radius: 999px;
  font-size: 11px;
  padding: 1px 8px;
}

.project-kanban-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 40px;
}

.project-kanban-card {
  background: var(--secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-decoration: none;
  color: var(--foreground);
  transition: all 0.2s;
  min-width: 0;
  overflow-wrap: break-word;
}

.project-kanban-card:hover {
  border-color: var(--primary);
  box-shadow: 0 0 10px rgba(0,229,255,0.15);
}

.project-kanban-card-title {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
}

.project-kanban-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-wrap: wrap;
}

.project-kanban-empty {
  font-size: 12px;
  color: var(--muted-foreground);
  text-align: center;
  padding: 12px 0;
}

@media (max-width: 900px) {
  .project-kanban-board {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: 78vw;
    overflow-x: auto;
    padding-bottom: 8px;
  }
  .project-kanban-column { min-width: 78vw; }
}