/* ============================================
   USE CASE LIST
   ============================================ */
.uc-list { list-style: none; }

.uc-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
    transition: border-color var(--transition-fast);
}
.uc-item:hover { border-color: var(--border-light); }

.uc-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}
.uc-id {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--primary-light);
    background: rgba(99,102,241,0.1);
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
}
.uc-title { font-weight: 600; color: var(--text-bright); flex: 1; }
.uc-actions { display: flex; gap: 0.3rem; opacity: 0; transition: opacity var(--transition-fast); }
.uc-item:hover .uc-actions { opacity: 1; }

.uc-detail { font-size: 0.875rem; color: var(--text); }
.uc-detail-label { color: var(--text-muted); font-size: 0.75rem; font-weight: 600; margin-top: 0.5rem; }

.uc-actors {
    display: flex; gap: 0.4rem; margin-top: 0.3rem; flex-wrap: wrap;
}
.uc-actor {
    font-size: 0.7rem;
    padding: 0.1rem 0.4rem;
    background: rgba(6,182,212,0.1);
    color: var(--accent);
    border-radius: 4px;
    border: 1px solid rgba(6,182,212,0.2);
}

/* ============================================
   BUSINESS RULE LIST
   ============================================ */
.br-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 0.5rem;
}
.br-category {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    flex-shrink: 0;
    min-width: 70px;
    text-align: center;
}
.br-cat-validation { background: rgba(99,102,241,0.15); color: var(--primary-light); }
.br-cat-calculation { background: rgba(234,179,8,0.15); color: #facc15; }
.br-cat-workflow { background: rgba(249,115,22,0.15); color: var(--secondary); }
.br-cat-security { background: rgba(239,68,68,0.15); color: #f87171; }
.br-cat-data { background: rgba(6,182,212,0.15); color: var(--accent); }
.br-text { flex: 1; font-size: 0.875rem; }

/* ============================================
   STAKEHOLDER TABLE
   ============================================ */
.stakeholder-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}
.stakeholder-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem;
}
.stakeholder-card:hover { border-color: var(--border-light); }
.stakeholder-role { font-weight: 600; color: var(--text-bright); margin-bottom: 0.25rem; }
.stakeholder-function { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.5rem; }
.stakeholder-tasks { list-style: none; }
.stakeholder-tasks li {
    font-size: 0.8rem;
    padding: 0.15rem 0;
    color: var(--text);
}
.stakeholder-tasks li::before { content: "- "; color: var(--primary-light); }
.stakeholder-meta {
    display: flex; gap: 0.75rem; margin-top: 0.5rem; padding-top: 0.5rem;
    border-top: 1px solid var(--border);
}
.stakeholder-meta span { font-size: 0.7rem; color: var(--text-muted); }

/* ============================================
   PROCESS FLOW
   ============================================ */
.process-flow {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    overflow-x: auto;
    padding: 1rem 0;
}
.process-step {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    min-width: 140px;
    text-align: center;
    flex-shrink: 0;
}
.process-step:hover { border-color: var(--primary); }
.process-step-number {
    font-size: 0.65rem;
    color: var(--primary-light);
    font-weight: 700;
}
.process-step-label { font-size: 0.8rem; color: var(--text-bright); font-weight: 500; }
.process-arrow { color: var(--text-muted); font-size: 1.2rem; flex-shrink: 0; }

/* ============================================
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    gap: 1rem;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 0.5rem;
}
    width: 10px; height: 10px;
    border-radius: 50%;
}
    font-size: 0.7rem;
    color: var(--text-muted);
    text-align: center;
}
/* ============================================
   MODULE CARDS (Decomposition)
   ============================================ */
.module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}
.module-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
}
.module-card:hover { border-color: var(--primary); }
.module-card.selected { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(99,102,241,0.2); }
.module-card-header { display: flex; justify-content: space-between; align-items: start; margin-bottom: 0.5rem; }
.module-card-code { font-weight: 700; color: var(--text-bright); font-size: 1rem; }
.module-card-type {
    font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.05em;
    padding: 0.15rem 0.5rem; border-radius: 4px;
    background: rgba(99,102,241,0.1); color: var(--primary-light);
}
.module-card-desc { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.5rem; }
.module-card-meta { display: flex; gap: 0.75rem; font-size: 0.7rem; color: var(--text-muted); }
.module-card-meta span { display: flex; align-items: center; gap: 0.2rem; }
.module-card-remove {
    position: absolute; top: 0.5rem; right: 0.5rem;
    background: none; border: none; color: var(--text-muted);
    cursor: pointer; font-size: 0.8rem; opacity: 0;
    transition: opacity var(--transition-fast);
}
.module-card:hover .module-card-remove { opacity: 1; }
.module-card-remove:hover { color: var(--error); }

/* ============================================
   TABS (Module Specification)
   ============================================ */
.tab-bar {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.5rem;
    overflow-x: auto;
}
.tab-btn {
    padding: 0.6rem 1rem;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--transition-fast);
}
.tab-btn:hover { color: var(--text-bright); background: var(--bg-hover); }
.tab-btn.active { color: var(--primary-light); border-bottom-color: var(--primary); font-weight: 500; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ============================================
   ENTITY TABLE
   ============================================ */
.entity-block {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 1rem;
    overflow: hidden;
}
.entity-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.75rem 1rem;
    background: var(--bg-hover);
    border-bottom: 1px solid var(--border);
}
.entity-name { font-weight: 600; color: var(--text-bright); }
.entity-desc { font-size: 0.8rem; color: var(--text-muted); }
.attr-table { width: 100%; border-collapse: collapse; }
.attr-table th {
    text-align: left; font-size: 0.7rem; text-transform: uppercase;
    letter-spacing: 0.05em; color: var(--text-muted); padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border); font-weight: 600;
}
.attr-table td {
    padding: 0.5rem 0.75rem; font-size: 0.85rem;
    border-bottom: 1px solid rgba(51,65,85,0.3);
}
.attr-required { color: var(--error); font-weight: 700; }

/* ============================================
   DEPENDENCY VISUALIZATION
   ============================================ */
.dep-graph {
    display: flex; flex-direction: column; gap: 1.5rem;
    padding: 1.5rem; background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 10px;
}
.dep-layer {
    display: flex; align-items: center; gap: 1rem;
}
.dep-layer-label {
    font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase;
    letter-spacing: 0.05em; min-width: 80px; font-weight: 600;
}
.dep-layer-modules { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.dep-module {
    padding: 0.4rem 0.8rem; border-radius: 6px;
    background: rgba(99,102,241,0.1); border: 1px solid rgba(99,102,241,0.3);
    color: var(--primary-light); font-size: 0.8rem; font-weight: 500;
}
.dep-arrow {
    text-align: center; color: var(--text-muted); font-size: 1.2rem;
    padding-left: 80px;
}

/* ============================================
   STAT CARDS (Handoff)
   ============================================ */
.stat-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem; margin-bottom: 1.5rem;
}
.stat-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 10px; padding: 1rem; text-align: center;
}
.stat-value { font-size: 1.8rem; font-weight: 700; color: var(--text-bright); }
.stat-label { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.2rem; }

/* ============================================
   CONSOLIDATION
   ============================================ */
.interaction-item {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.75rem 1rem; background: var(--bg-card);
    border: 1px solid var(--border); border-radius: 8px;
    margin-bottom: 0.5rem; font-size: 0.85rem;
}
.interaction-arrow { color: var(--primary-light); font-weight: 700; font-size: 1.1rem; }
.interaction-type {
    font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.05em;
    padding: 0.15rem 0.4rem; border-radius: 4px;
    background: rgba(6,182,212,0.1); color: var(--accent);
}
.e2e-flow {
    display: flex; align-items: center; gap: 0.3rem;
    overflow-x: auto; padding: 1rem 0;
}
.e2e-step {
    padding: 0.5rem 0.75rem; border-radius: 6px; text-align: center;
    font-size: 0.75rem; flex-shrink: 0;
    background: var(--bg-card); border: 1px solid var(--border);
}
.e2e-step-module { font-weight: 600; color: var(--primary-light); font-size: 0.65rem; }
.e2e-step-action { color: var(--text-bright); }

/* ============================================
   DATA MODEL (Consolidation)
   ============================================ */
.dm-summary {
    display: flex; gap: 1.5rem; margin-bottom: 1.5rem;
    padding: 1rem 1.5rem; background: var(--bg-card);
    border: 1px solid var(--border); border-radius: 10px;
}
.dm-summary-item { display: flex; align-items: baseline; gap: 0.4rem; }
.dm-summary-value { font-size: 1.4rem; font-weight: 700; color: var(--text-bright); }
.dm-summary-label { font-size: 0.8rem; color: var(--text-muted); }
.dm-module-group { margin-bottom: 1.5rem; }
.dm-module-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.5rem 0; margin-bottom: 0.75rem;
    border-bottom: 2px solid var(--primary);
}
.dm-module-name { font-weight: 700; color: var(--primary-light); font-size: 1rem; }
.dm-module-count { font-size: 0.75rem; color: var(--text-muted); }
.dm-entity-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 1rem;
}
.dm-entity-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 10px; overflow: hidden;
    transition: border-color var(--transition-fast);
}
.dm-entity-card:hover { border-color: var(--border-light); }
.dm-entity-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.6rem 0.75rem; background: var(--bg-hover);
    border-bottom: 1px solid var(--border);
}
.dm-entity-name { font-weight: 600; color: var(--text-bright); font-size: 0.95rem; }
.dm-entity-attr-count {
    font-size: 0.65rem; color: var(--text-muted);
    background: rgba(99,102,241,0.1); padding: 0.1rem 0.4rem; border-radius: 4px;
}
.dm-entity-desc {
    padding: 0.5rem 0.75rem; font-size: 0.8rem; color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}
.dm-attr-table { width: 100%; border-collapse: collapse; }
.dm-attr-table th {
    text-align: left; font-size: 0.65rem; text-transform: uppercase;
    letter-spacing: 0.05em; color: var(--text-muted); padding: 0.4rem 0.75rem;
    border-bottom: 1px solid var(--border); font-weight: 600;
}
.dm-attr-table td { padding: 0.35rem 0.75rem; font-size: 0.8rem; border-bottom: 1px solid rgba(51,65,85,0.2); }
.dm-attr-name { font-weight: 500; color: var(--text-bright); white-space: nowrap; }
.dm-attr-desc { color: var(--text-muted); }
.dm-relations {
    padding: 0.5rem 0.75rem; border-top: 1px solid var(--border);
    background: rgba(6,182,212,0.03);
}
.dm-relations-title {
    font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.05em;
    color: var(--accent); font-weight: 600; margin-bottom: 0.3rem;
}
.dm-relation-item {
    font-size: 0.8rem; color: var(--text); padding: 0.15rem 0;
    padding-left: 0.75rem; border-left: 2px solid var(--accent);
    margin-bottom: 0.2rem;
}

/* ============================================
   STRUCTURE TAB (Sections/Resources)
   ============================================ */
.struct-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 1rem;
    overflow: hidden;
}
.struct-section-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--bg-hover);
    border-bottom: 1px solid var(--border);
}
.struct-section-code {
    font-weight: 600;
    color: var(--text-bright);
    font-size: 0.95rem;
}
.struct-section-desc {
    flex: 1;
    font-size: 0.8rem;
    color: var(--text-muted);
}
.struct-section-badge {
    font-size: 0.65rem;
    color: var(--text-muted);
    background: rgba(99,102,241,0.1);
    padding: 0.1rem 0.5rem;
    border-radius: 4px;
    white-space: nowrap;
}
.struct-resources {
    padding: 0.5rem 0;
}
.struct-resource {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    padding: 0.35rem 1rem 0.35rem 1.5rem;
    font-size: 0.85rem;
    transition: background var(--transition-fast);
}
.struct-resource:hover {
    background: var(--bg-hover);
}
.struct-resource-icon {
    color: var(--primary-light);
    font-size: 0.7rem;
    flex-shrink: 0;
}
.struct-resource-name {
    font-weight: 500;
    color: var(--text-bright);
}
.struct-resource-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ============================================
   STRUCTURE LEGEND
   ============================================ */
.struct-legend {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    margin-bottom: 1.25rem;
}
.struct-legend-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}
.struct-legend-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem 1.5rem;
}
.struct-legend-item {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.4;
}
.struct-legend-code {
    display: inline-block;
    font-weight: 600;
    color: var(--accent);
    background: rgba(6,182,212,0.1);
    padding: 0.05rem 0.4rem;
    border-radius: 3px;
    font-size: 0.72rem;
    margin-right: 0.3rem;
    font-family: monospace;
}

/* ============================================
   SECTION GROUPS (Hierarchical Mode)
   ============================================ */
.section-group {
    margin-bottom: 1.5rem;
    border-left: 3px solid var(--primary);
    padding-left: 0;
}
.section-group-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: rgba(99,102,241,0.05);
    border-bottom: 1px solid var(--border);
    margin-bottom: 0.5rem;
    border-radius: 0 6px 0 0;
}
.section-group-icon {
    font-size: 0.6rem;
    color: var(--primary-light);
}
.section-group-label {
    font-weight: 600;
    color: var(--primary-light);
    font-size: 0.9rem;
}
.section-group-route {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-family: 'Courier New', monospace;
    background: var(--bg-input);
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
}
