/* ===== Base ===== */
* { box-sizing: border-box; }
body { -webkit-font-smoothing: antialiased; }

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(76, 110, 245, 0.25); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(76, 110, 245, 0.4); }

/* ===== Main Tabs ===== */
.main-tab {
    color: #9ca3af;
    border-color: transparent;
}
.main-tab:hover {
    color: #4c6ef5;
    border-color: rgba(76, 110, 245, 0.3);
}
.main-tab.active {
    color: #4c6ef5;
    border-color: #4c6ef5;
}

/* ===== Member Cards ===== */
.member-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 1rem;
    padding: 1.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}
.member-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    border-radius: 1rem 1rem 0 0;
}
.member-card[data-dept="lead"]::before { background: linear-gradient(90deg, #f59e0b, #f97316); }
.member-card[data-dept="content"]::before { background: linear-gradient(90deg, #8b5cf6, #a855f7); }
.member-card[data-dept="aff"]::before { background: linear-gradient(90deg, #0ea5e9, #6366f1); }
.member-card[data-dept="admin"]::before { background: linear-gradient(90deg, #10b981, #14b8a6); }
.member-card:hover {
    border-color: #bac8ff;
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(76, 110, 245, 0.1);
}

/* ===== Status Badge ===== */
.status-badge { display:inline-flex; align-items:center; gap:0.375rem; padding:0.2rem 0.625rem; border-radius:999px; font-size:0.6875rem; font-weight:600; }
.status-badge::before { content:''; width:6px; height:6px; border-radius:50%; flex-shrink:0; }
.status-badge.active { background:#ecfdf5; color:#059669; }
.status-badge.active::before { background:#10b981; }
.status-badge.onboarding { background:#fffbeb; color:#d97706; }
.status-badge.onboarding::before { background:#f59e0b; }
.status-badge.inactive { background:#fef2f2; color:#dc2626; }
.status-badge.inactive::before { background:#ef4444; }

/* ===== AI Level Badge ===== */
.ai-level { display:inline-flex; align-items:center; gap:0.25rem; padding:0.2rem 0.625rem; border-radius:999px; font-size:0.6875rem; font-weight:600; }
.ai-level.beginner { background:#f3f4f6; color:#6b7280; }
.ai-level.intermediate { background:#eff6ff; color:#2563eb; }
.ai-level.advanced { background:#f5f3ff; color:#7c3aed; }
.ai-level.expert { background:#fdf4ff; color:#c026d3; }

/* ===== Department Badge ===== */
.dept-badge { display:inline-flex; align-items:center; gap:0.25rem; padding:0.2rem 0.625rem; border-radius:999px; font-size:0.6875rem; font-weight:600; }
.dept-badge.lead { background:#fff7ed; color:#ea580c; }
.dept-badge.content { background:#f5f3ff; color:#7c3aed; }
.dept-badge.aff { background:#f0f9ff; color:#0284c7; }
.dept-badge.admin { background:#ecfdf5; color:#059669; }

/* ===== Tool Chip ===== */
.tool-chip {
    display: inline-flex; align-items: center; gap: 0.25rem;
    padding: 0.375rem 0.75rem; border-radius: 0.625rem;
    font-size: 0.75rem; font-weight: 500;
    background: #f8f9fa; border: 1px solid #e5e7eb; color: #4b5563;
    transition: all 0.2s ease;
}
.tool-chip:hover { border-color: #bac8ff; color: #4c6ef5; background: #f0f4ff; }

/* ===== Tag List ===== */
.tag-list { display: flex; flex-wrap: wrap; gap: 0.375rem; }
.tag-item {
    padding: 0.2rem 0.5rem; border-radius: 0.375rem; font-size: 0.6875rem;
    background: #f3f4f6; color: #6b7280; font-weight: 500;
}

/* ===== Detail Modal Sections ===== */
.detail-section { margin-bottom: 1.5rem; }
.detail-section h4 {
    font-size: 0.8125rem; font-weight: 700; color: #6b7280;
    text-transform: uppercase; letter-spacing: 0.05em;
    margin-bottom: 0.75rem; display: flex; align-items: center; gap: 0.5rem;
}
.detail-list { list-style: none; padding: 0; margin: 0; }
.detail-list li {
    padding: 0.5rem 0.75rem; border-radius: 0.625rem; background: #f8f9fa;
    margin-bottom: 0.375rem; font-size: 0.8125rem; color: #374151;
    display: flex; align-items: flex-start; gap: 0.5rem;
}
.detail-list li::before { content: '→'; color: #4c6ef5; flex-shrink: 0; font-weight: 700; }

/* ===== Toast ===== */
#toast.show { display: block !important; transform: translateY(0); opacity: 1; }

/* ===== Animations ===== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}
.animate-in { animation: fadeInUp 0.4s ease forwards; }

/* ===== Card Actions ===== */
.card-actions { display: flex; gap: 0.25rem; opacity: 0; transition: opacity 0.2s; }
.member-card:hover .card-actions { opacity: 1; }
.card-action-btn {
    width: 1.75rem; height: 1.75rem; border-radius: 0.5rem;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s; background: #f3f4f6; color: #6b7280;
}
.card-action-btn:hover { background: #e5e7eb; }
.card-action-btn.delete:hover { background: #fef2f2; color: #dc2626; }

/* ===== Avatar ===== */
.member-avatar {
    width: 2.75rem; height: 2.75rem; border-radius: 0.875rem;
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem; font-weight: 700; flex-shrink: 0; color: white;
}
.member-avatar.lead { background: linear-gradient(135deg, #f59e0b, #f97316); }
.member-avatar.content { background: linear-gradient(135deg, #8b5cf6, #a855f7); }
.member-avatar.aff { background: linear-gradient(135deg, #0ea5e9, #6366f1); }
.member-avatar.admin { background: linear-gradient(135deg, #10b981, #14b8a6); }

/* ===== Org Chart (Tree Layout) ===== */
.org-tree { display: flex; flex-direction: column; align-items: center; }
.org-tree-leader { display: flex; justify-content: center; }
.org-trunk { width: 2px; height: 32px; background: #cbd5e1; margin: 0 auto; }
.org-branch { width: 66%; height: 2px; background: #cbd5e1; margin: 0 auto; position: relative; }
.org-columns {
    display: grid; grid-template-columns: 2px 1fr 2px 1fr 2px 1fr;
    gap: 0; width: 66%; margin: 0 auto;
}
.org-col-line { width: 2px; background: #cbd5e1; height: 28px; justify-self: center; }
.org-col { display: flex; flex-direction: column; align-items: center; padding: 0 0.5rem; }
.org-col-header {
    display: flex; align-items: center; gap: 4px;
    font-size: 0.7rem; font-weight: 700; color: #94a3b8;
    text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.75rem;
}
.org-col-members { display: flex; flex-direction: column; gap: 0.75rem; align-items: center; width: 100%; }
.org-node {
    background: white; border: 2px solid #e5e7eb; border-radius: 0.875rem;
    padding: 0.875rem 1.25rem; text-align: center; transition: all 0.25s;
    cursor: pointer; width: 100%; max-width: 220px;
}
.org-node:hover { border-color: #4c6ef5; box-shadow: 0 4px 20px rgba(76,110,245,0.1); transform: translateY(-2px); }
.org-node.lead-node { border-color: #f59e0b; background: linear-gradient(135deg, #fffbeb, #fef3c7); }
.org-node.content-node { border-color: #8b5cf6; background: linear-gradient(135deg, #faf5ff, #f3e8ff); }
.org-node.aff-node { border-color: #0ea5e9; background: linear-gradient(135deg, #f0f9ff, #e0f2fe); }
.org-node.admin-node { border-color: #10b981; background: linear-gradient(135deg, #ecfdf5, #d1fae5); }

/* ===== Blueprint Sections ===== */
.blueprint-section {
    background: white; border: 1px solid #e5e7eb; border-radius: 1rem;
    overflow: hidden; margin-bottom: 1.5rem;
}
.blueprint-header {
    padding: 1rem 1.5rem; font-weight: 700; font-size: 0.875rem;
    display: flex; align-items: center; gap: 0.5rem;
}
.blueprint-header.current { background: linear-gradient(135deg, #fffbeb, #fef3c7); color: #92400e; border-bottom: 1px solid #fde68a; }
.blueprint-header.future { background: linear-gradient(135deg, #f0f9ff, #e0f2fe); color: #075985; border-bottom: 1px solid #bae6fd; }
.blueprint-body { padding: 1rem 1.5rem; }
.blueprint-item {
    padding: 0.5rem 0; font-size: 0.8125rem; color: #374151;
    display: flex; align-items: flex-start; gap: 0.5rem;
    border-bottom: 1px solid #f3f4f6;
}
.blueprint-item:last-child { border-bottom: none; }
.blueprint-dot-current { width: 6px; height: 6px; border-radius: 999px; background: #f59e0b; flex-shrink: 0; margin-top: 6px; }
.blueprint-dot-future { width: 6px; height: 6px; border-radius: 999px; background: #0ea5e9; flex-shrink: 0; margin-top: 6px; }

/* ===== Hero Stat Pill ===== */
.hero-stat {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.5rem 1rem; border-radius: 0.75rem;
    background: rgba(255,255,255,0.15); backdrop-filter: blur(8px);
    font-size: 0.8125rem; font-weight: 600;
}
.hero-stat .num { font-size: 1.25rem; font-weight: 800; font-family: 'Inter', sans-serif; }

/* ===== Section Titles (Presentation) ===== */
.section-intro { max-width: 720px; }
.section-title {
    font-size: 1.5rem; font-weight: 800; color: #111827;
    display: flex; align-items: center; gap: 0.75rem;
    margin-bottom: 0.75rem; line-height: 1.3;
}
.section-desc {
    font-size: 0.9375rem; color: #6b7280; line-height: 1.7;
}
.section-subtitle {
    font-size: 1.125rem; font-weight: 700; color: #374151;
    display: flex; align-items: center; gap: 0.5rem;
    margin-bottom: 1rem;
}

/* ===== Reason Cards ===== */
.reason-card {
    display: flex; gap: 1rem; padding: 1.5rem;
    background: white; border: 1px solid #e5e7eb; border-radius: 1rem;
    transition: all 0.25s;
}
.reason-card:hover { border-color: #bac8ff; box-shadow: 0 4px 20px rgba(76,110,245,0.08); }
.reason-number {
    width: 2.5rem; height: 2.5rem; border-radius: 0.75rem;
    background: linear-gradient(135deg, #4c6ef5, #6366f1);
    color: white; font-size: 1.125rem; font-weight: 800;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; font-family: 'Inter', sans-serif;
}

/* ===== Problem Row ===== */
.problem-row {
    padding: 1rem 1.25rem; background: white;
    border: 1px solid #e5e7eb; border-left: 4px solid #f59e0b;
    border-radius: 0.75rem;
}

/* ===== Compare Card ===== */
.compare-card {
    background: white; border: 1px solid #e5e7eb; border-radius: 1rem;
    overflow: hidden;
}
.compare-header {
    padding: 1.25rem 1.5rem; border-bottom: 1px solid #f3f4f6;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
}
.compare-label {
    font-size: 0.8125rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.03em; margin-bottom: 1rem;
    display: flex; align-items: center; gap: 0.5rem;
}
.compare-result {
    padding: 1rem 1.5rem; background: #ecfdf5; border-top: 1px solid #d1fae5;
    font-size: 0.8125rem; color: #065f46;
    display: flex; align-items: center; gap: 0.5rem;
}

/* ===== Priority Dot ===== */
.priority-dot {
    width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-top: 6px;
}
.priority-dot.high { background: #ef4444; }
.priority-dot.medium { background: #f59e0b; }
.priority-dot.low { background: #3b82f6; }

/* ===== Change Row ===== */
.change-row {
    display: flex; gap: 1rem; padding: 1rem 1.25rem;
    background: white; border: 1px solid #e5e7eb; border-radius: 0.75rem;
    transition: all 0.2s;
}
.change-row:hover { border-color: #bac8ff; }
.change-row.high { border-left: 4px solid #ef4444; }
.change-row.medium { border-left: 4px solid #f59e0b; }
.change-row.low { border-left: 4px solid #3b82f6; }
.change-num {
    width: 1.75rem; height: 1.75rem; border-radius: 0.5rem;
    background: #f3f4f6; color: #6b7280;
    font-size: 0.75rem; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; font-family: 'Inter', sans-serif;
}

/* ===== KPI Cards ===== */
.kpi-card {
    background: white; border: 1px solid #e5e7eb; border-radius: 1rem;
    padding: 1.25rem; text-align: center;
}
.kpi-label {
    font-size: 0.6875rem; font-weight: 700; color: #9ca3af;
    text-transform: uppercase; letter-spacing: 0.05em;
}
.kpi-value {
    font-size: 2rem; font-weight: 900; font-family: 'Inter', sans-serif;
    line-height: 1.2; margin-top: 0.25rem;
}
.kpi-sub {
    font-size: 0.6875rem; color: #9ca3af; margin-top: 0.25rem;
}

/* ===== Budget Bar ===== */
.budget-bar {
    height: 4px; background: #f3f4f6; border-radius: 999px;
    margin-top: 0.5rem; overflow: hidden;
}
.budget-fill { height: 100%; border-radius: 999px; transition: width 0.6s ease; }

/* ===== Roadmap Timeline ===== */
.roadmap-timeline { position: relative; padding-left: 2rem; }
.roadmap-timeline::before {
    content: ''; position: absolute; left: 0.5rem; top: 0; bottom: 0;
    width: 2px; background: #e5e7eb;
}
.roadmap-phase { position: relative; margin-bottom: 2rem; }
.roadmap-dot {
    position: absolute; left: -1.5rem; top: 0.5rem;
    width: 14px; height: 14px; border-radius: 50%;
    background: #e5e7eb; border: 3px solid white; z-index: 1;
}
.roadmap-active .roadmap-dot { background: #4c6ef5; box-shadow: 0 0 0 4px rgba(76,110,245,0.2); }
.roadmap-done .roadmap-dot { background: #10b981; }
.roadmap-upcoming .roadmap-dot { background: #f59e0b; }
.roadmap-future .roadmap-dot { background: #d1d5db; }
.roadmap-content {
    background: white; border: 1px solid #e5e7eb; border-radius: 1rem;
    padding: 1.25rem; margin-left: 0.5rem;
}
.roadmap-active .roadmap-content { border-color: #4c6ef5; border-width: 2px; box-shadow: 0 4px 20px rgba(76,110,245,0.08); }
.roadmap-done .roadmap-content { opacity: 0.7; }
.roadmap-badge {
    display: inline-flex; align-items: center; padding: 0.15rem 0.5rem;
    border-radius: 999px; font-size: 0.625rem; font-weight: 700;
}
.roadmap-badge.roadmap-done { background: #ecfdf5; color: #059669; }
.roadmap-badge.roadmap-active { background: #eef2ff; color: #4338ca; }
.roadmap-badge.roadmap-upcoming { background: #fffbeb; color: #d97706; }
.roadmap-badge.roadmap-future { background: #f3f4f6; color: #9ca3af; }

/* ===== Department Plan Card ===== */
.dept-plan-card {
    background: white; border: 1px solid #e5e7eb; border-radius: 1rem;
    overflow: hidden;
}
.dept-plan-header {
    padding: 1rem 1.5rem; color: white;
}
.dept-plan-header.lead { background: linear-gradient(135deg, #f59e0b, #f97316); }
.dept-plan-header.content { background: linear-gradient(135deg, #8b5cf6, #a855f7); }
.dept-plan-header.aff { background: linear-gradient(135deg, #0ea5e9, #6366f1); }
.dept-plan-header.admin { background: linear-gradient(135deg, #10b981, #14b8a6); }

/* ===== KPI Gap Badge ===== */
.kpi-gap {
    display: inline-flex; padding: 0.15rem 0.5rem;
    border-radius: 999px; font-size: 0.6875rem; font-weight: 700;
}
.kpi-gap.needs-work { background: #fff7ed; color: #ea580c; }
.kpi-gap.on-track { background: #ecfdf5; color: #059669; }

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .member-card { padding: 1rem; }
    .card-actions { opacity: 1; }
    .org-node { max-width: 160px; padding: 0.625rem 0.75rem; }
    .org-columns { width: 95% !important; grid-template-columns: 2px 1fr 2px 1fr 2px 1fr; gap: 0; }
    .org-branch { width: 95% !important; }
    .org-col-header { font-size: 0.6rem; }
    .section-title { font-size: 1.25rem; }
    .kpi-value { font-size: 1.5rem; }
    .reason-card { flex-direction: column; gap: 0.75rem; padding: 1rem; }
    .reason-number { width: 2rem; height: 2rem; font-size: 0.875rem; }
    .compare-card .grid-cols-2 { grid-template-columns: 1fr !important; }
    .compare-header { padding: 1rem; }
}
@media (max-width: 480px) {
    .org-columns { grid-template-columns: 1fr !important; gap: 1rem; }
    .org-col-line { display: none; }
    .org-branch { display: none; }
    .section-title { font-size: 1.125rem; }
    .kpi-value { font-size: 1.25rem; }
}
