/* CSS variables matching premium light-theme */
:root {
    --bg: #f8fafc;
    --sidebar-bg: #ffffff;
    --surface: #ffffff;
    --border: #e2e8f0;
    --border-bright: #cbd5e1;
    --text: #0f172a;
    --text-dim: #64748b;
    --accent: #a855f7;      /* Purple for Sales & Order */
    --accent-dim: rgba(168, 85, 247, 0.08);
    
    --purple: #a855f7;
    --purple-dim: rgba(168, 85, 247, 0.08);
    --blue: #3b82f6;
    --blue-dim: rgba(59, 130, 246, 0.08);
    --amber: #f59e0b;
    --amber-dim: rgba(245, 158, 11, 0.08);
    --green: #22c55e;
    --green-dim: rgba(34, 197, 94, 0.08);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    background: radial-gradient(ellipse at bottom right, #f1f5f9, var(--bg));
    color: var(--text);
    min-height: 100vh;
    display: grid;
    grid-template-columns: 280px 1fr;
    line-height: 1.6;
}

/* SIDEBAR STYLE */
aside.app-sidebar {
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    padding: 1.75rem 1.25rem;
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: sticky;
    top: 0;
    overflow-y: auto;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.5rem;
}

.logo-icon {
    font-size: 1.8rem;
}

.logo-text h1 {
    font-size: 1.15rem;
    font-weight: 800;
    background: linear-gradient(135deg, #a855f7, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-text p {
    font-size: 0.65rem;
    color: var(--text-dim);
    letter-spacing: 0.8px;
    text-transform: uppercase;
    font-weight: 700;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    flex-grow: 1;
}

.menu-title {
    font-size: 0.68rem;
    font-weight: 800;
    color: var(--text-dim);
    letter-spacing: 1px;
    margin: 1rem 0 0.5rem 0.25rem;
    text-transform: uppercase;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0.85rem;
    border-radius: 0.5rem;
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    cursor: pointer;
}

.nav-item:hover, .nav-item.active {
    background: rgba(0, 0, 0, 0.02);
    color: var(--text);
    border-color: var(--border);
}

.nav-item.active {
    background: var(--accent-dim);
    color: var(--accent);
    border-color: rgba(168, 85, 247, 0.15);
}

.sidebar-footer {
    border-top: 1px solid var(--border);
    padding-top: 1rem;
    margin-top: 1.5rem;
}

.btn-back {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-dim);
    text-decoration: none;
    padding: 0.55rem 1rem;
    border: 1px solid var(--border);
    border-radius: 0.375rem;
    background: var(--bg);
    transition: all 0.2s;
}

.btn-back:hover {
    color: var(--text);
    border-color: var(--border-bright);
    background: #ffffff;
}

/* MAIN APP CONTENT */
main.app-main {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow-y: auto;
}

.top-bar {
    background: rgba(248, 250, 252, 0.85);
    border-bottom: 1px solid var(--border);
    padding: 1rem 2.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    backdrop-filter: blur(10px);
    z-index: 10;
}

.breadcrumb {
    font-weight: 700;
    font-size: 0.95rem;
    background: linear-gradient(135deg, #0f172a, #475569);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.quick-links {
    display: flex;
    gap: 0.65rem;
}

.btn-link {
    font-size: 0.78rem;
    color: var(--text-dim);
    text-decoration: none;
    padding: 0.45rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: 0.375rem;
    background: rgba(255, 255, 255, 0.6);
    transition: all 0.2s ease;
    font-weight: 600;
}

.btn-link:hover {
    color: var(--text);
    border-color: var(--border-bright);
    background: #ffffff;
}

.content-area {
    padding: 2.5rem;
    width: 100%;
    max-width: 100%;
}

/* Glass Cards */
.glass-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 8px 32px rgba(15, 23, 42, 0.03);
    margin-bottom: 2rem;
    transition: border-color 0.3s ease;
}

.glass-card:hover {
    border-color: var(--border-bright);
}

.header-banner h1 {
    font-size: 2.25rem;
    font-weight: 800;
    background: linear-gradient(135deg, #0f172a, #a855f7, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-top: 0.75rem;
    margin-bottom: 0.5rem;
}

.header-banner .subtitle {
    color: var(--text-dim);
    font-size: 1.05rem;
    font-weight: 500;
    max-width: 780px;
}

.glass-card h2 {
    font-size: 1.35rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.card-desc {
    font-size: 0.9rem;
    color: var(--text-dim);
    margin-bottom: 1.5rem;
}

/* SVG Styling */
.visual-model-wrap {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.domain-svg {
    max-width: 800px;
}

.svg-aggregate-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 800;
    font-size: 11px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.svg-entity-node rect {
    transition: filter 0.25s, stroke-width 0.25s;
}

.svg-entity-node:hover rect {
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.04));
    stroke-width: 2.5px;
}

.entity-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 800;
    font-size: 12px;
    fill: #0f172a;
}

.entity-badge {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 8px;
    fill: #3b82f6;
    text-transform: uppercase;
}

.entity-badge.entity { fill: #64748b; }
.entity-badge.variant { fill: #a855f7; }
.entity-badge.vo { fill: #ef4444; }

.svg-text-small {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 9px;
    font-weight: 700;
    fill: #94a3b8;
}

/* Aggregates Grid */
.aggregates-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.aggregate-info-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1.5rem;
    transition: all 0.25s;
}

.aggregate-info-card:hover {
    border-color: var(--border-bright);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
}

.aggregate-info-card h3 {
    font-size: 1.15rem;
    font-weight: 800;
    margin: 0.5rem 0;
}

.detail-text {
    font-size: 0.85rem;
    color: var(--text-dim);
    margin-bottom: 1rem;
    line-height: 1.5;
}

.business-rules-list {
    list-style: none;
    padding-left: 0;
}

.business-rules-list li {
    font-size: 0.85rem;
    color: var(--text-dim);
    margin-bottom: 0.65rem;
    position: relative;
    padding-left: 1.25rem;
    line-height: 1.5;
}

.business-rules-list li::before {
    content: '▪';
    color: var(--accent);
    position: absolute;
    left: 0;
    top: 0;
    font-size: 1rem;
    line-height: 1.4;
}

.business-rules-list li b {
    color: var(--text);
    font-weight: 700;
}

/* VCA Explanation */
.vca-explanation {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1.5rem;
}

.vca-flow-diagram {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.flow-step-static {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 1rem;
    flex: 1;
}

.badge-vca-step {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    display: block;
    margin-bottom: 0.25rem;
}

.flow-step-static h4 {
    font-size: 0.85rem;
    font-weight: 800;
    margin-bottom: 0.25rem;
}

.flow-step-static p {
    font-size: 0.75rem;
    color: var(--text-dim);
    line-height: 1.4;
}

.flow-step-arrow {
    color: var(--text-dim);
    font-weight: bold;
}

.vca-text-desc h4 {
    font-size: 0.95rem;
    font-weight: 800;
    margin-bottom: 0.25rem;
}

.vca-text-desc p {
    font-size: 0.82rem;
    color: var(--text-dim);
    line-height: 1.5;
}

/* Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.2rem 0.55rem;
    border-radius: 9999px;
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid transparent;
}

.badge-indigo { background: var(--accent-dim); color: var(--accent); border-color: rgba(168, 85, 247, 0.15); }
.badge-purple { background: var(--purple-dim); color: var(--purple); border-color: rgba(168, 85, 247, 0.15); }
.badge-blue { background: var(--blue-dim); color: var(--blue); border-color: rgba(59, 130, 246, 0.15); }
.badge-amber { background: var(--amber-dim); color: var(--amber); border-color: rgba(245, 158, 11, 0.15); }
.badge-green { background: var(--green-dim); color: #16a34a; border-color: rgba(34, 197, 94, 0.15); }

/* Guide Section */
.guide-steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-top: 0.5rem;
}

.step-item {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 1.25rem;
    position: relative;
}

.step-number {
    position: absolute;
    top: -12px;
    left: 12px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--accent);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 800;
}

.step-content h4 {
    font-size: 0.85rem;
    font-weight: 800;
    margin-bottom: 0.35rem;
    color: var(--text);
    margin-top: 0.25rem;
}

.step-content p {
    font-size: 0.78rem;
    color: var(--text-dim);
    line-height: 1.4;
}

section {
    scroll-margin-top: 90px;
}

/* Responsive */
@media (max-width: 900px) {
    body { grid-template-columns: 1fr; }
    aside.app-sidebar { display: none; }
    .aggregates-grid { grid-template-columns: 1fr; }
    .vca-flow-diagram { flex-direction: column; }
    .flow-step-arrow { transform: rotate(90deg); margin: 0.25rem 0; }
    .guide-steps { grid-template-columns: 1fr; }
}
