@import url('https://fonts.googleapis.com/css2?family=DM+Sans:opsz,wght@9..40,400;500;600;700&family=Hind:wght@400;500;600&display=swap');

:root {
    /* Brand Colors */
    --c-graphite: #1B1B1B;
    --c-deep-green: #163F2D;
    --c-gray-white: #F5F5F5;
    --c-pacific-mint: #ACFFC9;
    --c-electric-mint: #75FF94;
    
    /* Semantic Colors */
    --bg-app: var(--c-gray-white);
    --bg-surface: #FFFFFF;
    --text-primary: var(--c-graphite);
    --text-secondary: #6B7280;
    --border: #E5E7EB;
    
    --primary: var(--c-deep-green);
    --primary-hover: #0F2D20;
    
    --status-success-bg: #DCFCE7;
    --status-success-text: #166534;
    --status-error-bg: #FEE2E2;
    --status-error-text: #991B1B;
    --status-warning-bg: #FEF3C7;
    --status-warning-text: #92400E;
}

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

body {
    font-family: 'DM Sans', sans-serif;
    background-color: var(--bg-app);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Layout */
.layout { display: flex; min-height: 100vh; }

.sidebar {
    width: 260px;
    background: var(--bg-surface);
    border-right: 1px solid var(--border);
    padding: 32px 24px;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    z-index: 10;
}

.main {
    flex: 1;
    margin-left: 260px;
    padding: 48px;
    max-width: 1400px;
}

/* Typography & Logo */
.logo-container { margin-bottom: 48px; }
.logo-svg { width: 140px; height: auto; display: block; }
.logo-label { 
    font-family: 'Hind', sans-serif;
    font-size: 11px; 
    text-transform: uppercase; 
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-top: 8px;
}

/* Navigation */
.nav-section { margin-bottom: 32px; }
.nav-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
    font-weight: 700;
    margin-bottom: 12px;
    padding-left: 12px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.nav-link:hover {
    background: var(--c-gray-white);
    color: var(--c-deep-green);
}

.nav-link.active {
    background: var(--c-deep-green);
    color: #FFFFFF;
}

/* Cards */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    border-color: var(--c-pacific-mint);
}

.card-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--c-deep-green);
    margin-bottom: 8px;
}

.card-desc {
    color: var(--text-secondary);
    font-size: 14px;
    font-family: 'Hind', sans-serif;
    line-height: 1.6;
    flex-grow: 1;
}

.card-link {
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
}

/* Page Header */
.page-header { margin-bottom: 40px; }
.page-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--c-graphite);
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}
.page-subtitle { color: var(--text-secondary); font-size: 16px; font-family: 'Hind', sans-serif; }

/* Section */
.section { margin-bottom: 48px; }
.section-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--c-graphite);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Content Block */
.content-block {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 32px;
    margin-bottom: 24px;
}

.content-block h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--c-graphite);
}

.content-block p {
    margin-bottom: 16px;
    color: var(--text-secondary);
}

.content-block ul {
    margin-left: 20px;
    margin-bottom: 16px;
    color: var(--text-secondary);
}

.content-block li {
    margin-bottom: 8px;
}

/* Code Block */
.code-block {
    background: #111827; /* Dark background for code */
    color: #F9FAFB;
    border-radius: 8px;
    padding: 16px;
    font-family: 'SF Mono', Monaco, Consolas, monospace;
    font-size: 13px;
    overflow-x: auto;
    margin: 16px 0;
    border: 1px solid #374151;
}

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

.table th {
    text-align: left;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.table td {
    padding: 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
}

.table tr:last-child td { border-bottom: none; }

/* Status Badges */
.status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}
.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}
.status-online { background: var(--status-success-bg); color: var(--status-success-text); }
.status-online .status-dot { background: var(--status-success-text); }

.status-offline { background: var(--status-error-bg); color: var(--status-error-text); }
.status-offline .status-dot { background: var(--status-error-text); }

.status-warning { background: var(--status-warning-bg); color: var(--status-warning-text); }
.status-warning .status-dot { background: var(--status-warning-text); }

/* Tags */
.tag {
    display: inline-flex;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    margin-right: 6px;
}
.tag-blue { background: #DBEAFE; color: #1E40AF; }
.tag-green { background: #DCFCE7; color: #166534; }
.tag-orange { background: #FEF3C7; color: #92400E; }
.tag-gray { background: #F3F4F6; color: #4B5563; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--c-deep-green);
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 14px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s;
}
.btn:hover { background: var(--primary-hover); }

/* User Menu */
.user-menu {
    margin-top: auto;
    border-top: 1px solid var(--border);
    padding-top: 20px;
}
.user-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-secondary);
}
.logout-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
}
.logout-link:hover { color: var(--status-error-text); }

/* Timeline */
.timeline {
    position: relative;
    padding-left: 24px;
}
.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: var(--border);
}
.timeline-item {
    position: relative;
    margin-bottom: 32px;
}
.timeline-item:last-child { margin-bottom: 0; }
.timeline-item::before {
    content: '';
    position: absolute;
    left: -29px;
    top: 6px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--bg-surface);
    border: 2px solid var(--c-deep-green);
}
.timeline-item.completed::before { background: var(--c-deep-green); }
.timeline-item.pending::before { border-color: var(--text-secondary); }

.timeline-date {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
    font-weight: 600;
    text-transform: uppercase;
}
.timeline-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--c-graphite);
    margin-bottom: 4px;
}
.timeline-desc {
    font-size: 14px;
    color: var(--text-secondary);
}

/* ================================
   TABS NAVIGATION
   ================================ */
.tabs-nav {
    margin-bottom: 32px;
    border-bottom: 1px solid var(--border);
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    padding-bottom: 8px;
}

.tab-link {
    padding: 12px 0;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    white-space: nowrap;
}

.tab-link.active {
    color: var(--c-deep-green);
    border-bottom-color: var(--c-deep-green);
}

.tab-link:hover {
    color: var(--c-graphite);
    text-decoration: none;
}

/* ================================
   SIMPLE TABLE (for docs)
   ================================ */
.simple-table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 14px;
}

.simple-table th,
.simple-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.simple-table th {
    background: var(--c-gray-white);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.simple-table tr:hover td {
    background: var(--c-gray-white);
}

/* Table Wrapper for scrolling */
.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ================================
   AGENT CARDS (for docs)
   ================================ */
.agent-card {
    background: var(--c-gray-white);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    border-left: 3px solid var(--c-deep-green);
}

.agent-card h4 {
    margin: 0 0 8px 0;
    color: var(--c-deep-green);
    font-size: 15px;
}

.agent-card p {
    margin: 4px 0;
    font-size: 14px;
    color: var(--text-secondary);
}

/* ================================
   SUBTITLE & HELPERS
   ================================ */
.subtitle {
    color: var(--text-secondary);
    font-style: italic;
    margin-bottom: 24px;
}

/* ================================
   ROADMAP SUMMARY
   ================================ */
.roadmap-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

.summary-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    text-align: center;
}

.summary-value {
    font-size: 2em;
    font-weight: 700;
    color: var(--c-deep-green);
}

.summary-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Quarter headers */
.quarter-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.quarter-badge {
    background: var(--c-deep-green);
    color: white;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

/* ================================
   IDEA CARDS
   ================================ */
.idea-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 16px;
}

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

.idea-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--c-graphite);
}

.idea-desc {
    color: var(--text-secondary);
    margin-bottom: 12px;
    line-height: 1.6;
}

.idea-features {
    list-style: none;
    margin: 0;
    padding: 0;
}

.idea-features li {
    padding: 6px 0;
    color: var(--text-secondary);
    font-size: 14px;
    border-bottom: 1px dashed var(--border);
}

.idea-features li:last-child {
    border-bottom: none;
}

/* ================================
   SECTORS GRID
   ================================ */
.sectors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.sector-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    transition: border-color 0.2s;
}

.sector-card:hover {
    border-color: var(--c-pacific-mint);
}

.sector-icon {
    font-size: 32px;
    margin-bottom: 12px;
}

.sector-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--c-graphite);
    margin-bottom: 8px;
}

.sector-desc {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 12px;
}

.sector-features {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sector-features li {
    font-size: 13px;
    color: var(--text-secondary);
    padding: 4px 0;
}

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

.sector-header h3 {
    margin: 0;
    font-size: 18px;
    color: var(--c-graphite);
}

.sector-details h4 {
    font-size: 13px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 16px 0 8px 0;
}

.sector-details ul {
    list-style: none;
    padding: 0;
    margin: 0 0 12px 0;
}

.sector-details li {
    font-size: 13px;
    color: var(--text-secondary);
    padding: 4px 0;
    padding-left: 16px;
    position: relative;
}

.sector-details li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--c-deep-green);
}

.sector-footer {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.sector-footer .path {
    font-family: 'SF Mono', Monaco, Consolas, monospace;
    font-size: 11px;
    color: var(--text-secondary);
}

.sector-card .tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

/* ================================
   ROADMAP ITEMS
   ================================ */
.roadmap-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

.summary-item {
    background: var(--c-gray-white);
    border-radius: 8px;
    padding: 16px;
    text-align: center;
}

.summary-item .summary-label {
    display: block;
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.summary-item .summary-value {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: var(--c-deep-green);
}

.quarter-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.quarter-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--c-graphite);
}

.quarter-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
}

.roadmap-item {
    display: flex;
    gap: 16px;
    padding: 20px 0;
    border-bottom: 1px solid var(--border);
}

.roadmap-item:last-child {
    border-bottom: none;
}

.item-status {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-top: 6px;
    flex-shrink: 0;
}

.item-status.done {
    background: var(--status-success-text);
}

.item-status.in-progress {
    background: var(--status-warning-text);
}

.item-status.planned {
    background: var(--border);
}

.item-content h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--c-graphite);
    margin: 0 0 8px 0;
}

.item-content p {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0 0 8px 0;
}

.item-content ul {
    margin: 8px 0;
    padding-left: 20px;
    font-size: 13px;
    color: var(--text-secondary);
}

.item-content li {
    margin-bottom: 4px;
}

/* Status variants used in pages */
.status.online {
    background: var(--status-success-bg);
    color: var(--status-success-text);
}

.status.degraded {
    background: var(--status-warning-bg);
    color: var(--status-warning-text);
}

.status.offline {
    background: var(--status-error-bg);
    color: var(--status-error-text);
}

/* Tag variants */
.tag.yellow {
    background: var(--status-warning-bg);
    color: var(--status-warning-text);
}

.tag.blue {
    background: #DBEAFE;
    color: #1E40AF;
}

/* Legend in ideas page */
.legend {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

/* ================================
   MOBILE MENU HAMBURGER
   ================================ */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    padding: 0 20px;
    align-items: center;
    justify-content: space-between;
    z-index: 100;
}

.mobile-logo { 
    height: 28px; 
    width: auto;
    /* Rendi il logo più visibile su mobile */
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.1));
}

/* Alternative: mostra solo icona su mobile invece del logo completo */
.mobile-header .logo-icon-only {
    display: none;
    width: 40px;
    height: 40px;
    background: var(--c-deep-green);
    border-radius: 10px;
    padding: 8px;
}
.mobile-header .logo-icon-only svg {
    fill: white;
}

.hamburger {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--c-graphite);
    transition: all 0.3s ease;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* ================================
   RESPONSIVE: TABLET (max 1024px)
   ================================ */
@media (max-width: 1024px) {
    .sidebar { width: 220px; padding: 24px 16px; }
    .main { margin-left: 220px; padding: 32px 24px; }
    .logo-svg { width: 120px; }
    .page-title { font-size: 28px; }
    .cards-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
    .content-block { padding: 24px; }
}

/* ================================
   RESPONSIVE: MOBILE (max 768px)
   ================================ */
@media (max-width: 768px) {
    /* Show mobile header, hide sidebar by default */
    .mobile-header { display: flex; }
    
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        width: 280px;
        padding-top: 80px; /* Space for mobile header */
        z-index: 101;
    }
    .sidebar.active { transform: translateX(0); }
    
    .main {
        margin-left: 0;
        padding: 80px 16px 32px 16px; /* Top padding for mobile header */
        max-width: 100%;
    }
    
    /* Typography adjustments */
    .page-title { font-size: 24px; }
    .page-subtitle { font-size: 14px; }
    .section-title { font-size: 16px; }
    .card-title { font-size: 16px; }
    .card-desc { font-size: 13px; }
    
    /* Cards full width on mobile */
    .cards-grid { 
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    /* Content block smaller padding */
    .content-block { 
        padding: 20px 16px;
        border-radius: 8px;
    }
    
    /* Tables horizontal scroll */
    .table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .table { min-width: 600px; }
    .table th, .table td { padding: 12px 8px; font-size: 13px; }
    
    /* Code blocks scroll */
    .code-block { 
        font-size: 12px;
        padding: 12px;
        white-space: pre;
    }
    
    /* Tabs navigation scrollable */
    .tabs-nav {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap;
        gap: 8px;
        padding-bottom: 12px;
    }
    .tab-link {
        white-space: nowrap;
        padding: 8px 12px;
        font-size: 13px;
    }
    
    /* Sector cards full width */
    .sectors-grid { grid-template-columns: 1fr; }
    
    /* Roadmap adjustments */
    .roadmap-summary { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .summary-value { font-size: 1.5em; }
    
    /* Ideas grid */
    .idea-card { padding: 16px; }
    .idea-header { flex-direction: column; align-items: flex-start; gap: 8px; }
    
    /* Buttons full width on mobile */
    .btn { width: 100%; justify-content: center; }
    
    /* Status badges smaller */
    .status { font-size: 11px; padding: 3px 8px; }
}

/* ================================
   RESPONSIVE: SMALL MOBILE (max 480px)
   ================================ */
@media (max-width: 480px) {
    .main { padding: 70px 12px 24px 12px; }
    .page-title { font-size: 20px; }
    .page-header { margin-bottom: 24px; }
    
    .content-block { padding: 16px 12px; }
    .code-block { font-size: 11px; padding: 10px; }
    
    .roadmap-summary { grid-template-columns: 1fr 1fr; }
    .quarter-header { flex-direction: column; align-items: flex-start; gap: 8px; }
    
    .simple-table { font-size: 12px; }
    .simple-table th, .simple-table td { padding: 8px 6px; }
}

/* ================================
   VISUAL DIAGRAMS & FLOWCHARTS
   ================================ */

/* Mermaid Diagram Container */
.diagram-container {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    margin: 24px 0;
    overflow-x: auto;
}

.diagram-container .mermaid {
    text-align: center;
    width: 100%;
    min-height: 200px;
    background: transparent;
    font-family: inherit;
    white-space: pre-wrap;
}

.diagram-container pre.mermaid {
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
}

.diagram-container .mermaid svg {
    max-width: 100%;
    height: auto;
}

.diagram-container .mermaid svg {
    width: 100% !important;
    height: auto !important;
    max-width: 100%;
}

/* Diagram Labels */
.diagram-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 16px;
    font-weight: 600;
}

/* ================================
   VISUAL DIRECTORY TREE
   ================================ */
.directory-tree {
    background: linear-gradient(135deg, var(--bg-surface) 0%, var(--c-gray-white) 100%);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    margin: 24px 0;
}

.tree-node {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    margin: 4px 0;
    border-radius: 8px;
    transition: background 0.2s;
}

.tree-node:hover {
    background: rgba(22, 63, 45, 0.05);
}

.tree-node.folder {
    font-weight: 600;
    color: var(--c-deep-green);
}

.tree-node.file {
    color: var(--text-secondary);
}

.tree-icon {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    flex-shrink: 0;
}

.tree-icon.folder-icon {
    color: #F59E0B; /* Amber for folders */
}

.tree-icon.file-icon {
    color: var(--text-secondary);
}

.tree-icon.python-icon {
    color: #3B82F6; /* Blue for Python */
}

.tree-icon.yaml-icon {
    color: #10B981; /* Green for YAML */
}

.tree-level-1 { margin-left: 0; }
.tree-level-2 { margin-left: 24px; }
.tree-level-3 { margin-left: 48px; }
.tree-level-4 { margin-left: 72px; }

.tree-connector {
    display: inline-flex;
    align-items: center;
    margin-right: 8px;
    color: var(--border);
}

/* ================================
   ARCHITECTURE FLOW CARDS
   ================================ */
.flow-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 24px 0;
}

.flow-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.flow-card {
    background: var(--bg-surface);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 16px 24px;
    text-align: center;
    min-width: 140px;
    transition: all 0.2s;
}

.flow-card:hover {
    border-color: var(--c-pacific-mint);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.flow-card.primary {
    background: var(--c-deep-green);
    color: white;
    border-color: var(--c-deep-green);
}

.flow-card.highlight {
    background: var(--c-pacific-mint);
    color: var(--c-graphite);
    border-color: var(--c-electric-mint);
}

.flow-card.secondary {
    background: var(--c-gray-white);
}

.flow-card-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
}

.flow-card-desc {
    font-size: 12px;
    opacity: 0.8;
}

.flow-arrow {
    color: var(--c-deep-green);
    font-size: 24px;
    flex-shrink: 0;
}

.flow-arrow-down {
    font-size: 20px;
    color: var(--c-deep-green);
    margin: 8px 0;
}

/* ================================
   SERVICE BOX GRID
   ================================ */
.service-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin: 24px 0;
}

.service-box {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    transition: all 0.2s;
}

.service-box:hover {
    border-color: var(--c-pacific-mint);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.service-box-icon {
    font-size: 32px;
    margin-bottom: 12px;
}

.service-box-title {
    font-weight: 600;
    color: var(--c-graphite);
    margin-bottom: 8px;
}

.service-box-port {
    font-family: 'SF Mono', Monaco, Consolas, monospace;
    font-size: 12px;
    color: var(--text-secondary);
    background: var(--c-gray-white);
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-block;
}

/* ================================
   STEP FLOW (numbered steps)
   ================================ */
.step-flow {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 24px 0;
}

.step-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.step-number {
    width: 32px;
    height: 32px;
    background: var(--c-deep-green);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

.step-content {
    flex: 1;
}

.step-title {
    font-weight: 600;
    color: var(--c-graphite);
    margin-bottom: 4px;
}

.step-desc {
    font-size: 14px;
    color: var(--text-secondary);
}

/* ================================
   COPY BUTTON FOR CODE
   ================================ */
.code-wrapper {
    position: relative;
}

.copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.7);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
}

.copy-btn:hover {
    background: rgba(255,255,255,0.2);
    color: white;
}

.copy-btn.copied {
    background: var(--status-success-bg);
    color: var(--status-success-text);
    border-color: var(--status-success-text);
}

/* ================================
   RESPONSIVE DIAGRAMS
   ================================ */
@media (max-width: 768px) {
    .flow-row {
        flex-direction: column;
    }
    
    .flow-arrow {
        transform: rotate(90deg);
    }
    
    .flow-card {
        width: 100%;
        max-width: 280px;
    }
    
    .service-grid {
        grid-template-columns: 1fr;
    }
    
    .tree-level-2 { margin-left: 16px; }
    .tree-level-3 { margin-left: 32px; }
    .tree-level-4 { margin-left: 48px; }
    
    .diagram-container {
        padding: 16px;
    }
}
