/* ============================================
   LAYOUT
   ============================================ */
.app { display: flex; flex-direction: column; min-height: 100vh; }

.header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-logo {
    width: 32px; height: 32px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.85rem; color: #fff;
    flex-shrink: 0;
}

.header-title { font-size: 1rem; font-weight: 600; color: var(--text-bright); }
.header-sep { width: 1px; height: 24px; background: var(--border); }
.header-app-name { font-size: 0.9rem; color: var(--primary-light); font-weight: 500; }
.header-spacer { flex: 1; }

.header-actions { display: flex; gap: 0.5rem; }

.body { display: flex; flex: 1; }

/* ============================================
   SIDEBAR - Container
   ============================================ */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    overflow-y: auto;
    height: calc(100vh - var(--header-height));
    position: sticky;
    top: var(--header-height);
    flex-shrink: 0;
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* ============================================
   MAIN CONTENT - FULL WIDTH
   ============================================ */
.main {
    flex: 1;
    padding: 2rem 3rem;
    overflow-y: auto;
    height: calc(100vh - var(--header-height));
}

.section { margin-bottom: 4rem; }
.section-title {
    font-size: 1.4rem;
    color: var(--text-bright);
    font-weight: 600;
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary);
}
.section-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

/* ============================================
   RESPONSIVE
   ============================================ */
.hamburger-btn {
    display: none;
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-size: 1.2rem;
    padding: 0.2rem 0.5rem;
    cursor: pointer;
    flex-shrink: 0;
}
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 149;
}
.sidebar-overlay.visible { display: block; }

@media (max-width: 768px) {
    .hamburger-btn { display: block; }
    .sidebar {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        z-index: 150;
        box-shadow: 4px 0 24px rgba(0,0,0,0.3);
    }
    .sidebar.mobile-open { display: block; }
    .main { padding: 1rem; }
    .form-row { grid-template-columns: 1fr; }
    .stakeholder-grid { grid-template-columns: 1fr; }
    .module-grid { grid-template-columns: 1fr; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .dm-entity-grid { grid-template-columns: 1fr; }
    .mock-form-row { grid-template-columns: 1fr; }
    .mock-kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .header-actions { gap: 0.25rem; }
    .header-actions .btn-sm { padding: 0.2rem 0.4rem; font-size: 0.7rem; }
    .header-title { display: none; }
    .header-sep { display: none; }
}

/* ============================================
   SEARCH
   ============================================ */
.sidebar-search {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border);
}
.sidebar-search input {
    width: 100%;
    padding: 0.4rem 0.6rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-size: 0.8rem;
    font-family: inherit;
}
.sidebar-search input:focus {
    outline: none;
    border-color: var(--primary);
}
.nav-item.search-hidden { display: none; }
.nav-group.search-hidden { display: none; }
.search-highlight { background: rgba(234,179,8,0.3); border-radius: 2px; }

/* ============================================
   PROGRESS INDICATOR
   ============================================ */
.progress-bar-container {
    width: 100%;
    height: 8px;
    background: var(--bg-hover);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}
.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--success));
    border-radius: 4px;
    transition: width 0.5s ease;
}
.progress-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}
.progress-checks {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.3rem;
}
.progress-check {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.progress-check.done { color: var(--success); }
.progress-check-icon { font-size: 0.9rem; width: 16px; text-align: center; }

/* ============================================
   PRINT
   ============================================ */
@media print {
    .sidebar, .header-actions, .add-btn, .uc-actions, .inline-form, .module-card-remove, .hamburger-btn, .sidebar-search { display: none !important; }
    .main { max-width: 100%; padding: 0.5cm; height: auto; overflow: visible; }
    .body { display: block; }
    .section { display: block !important; page-break-inside: avoid; margin-bottom: 1cm; }
    .section + .section { page-break-before: auto; }
    body { background: #fff !important; color: #1a1a1a !important; }
    * { color-adjust: exact; -webkit-print-color-adjust: exact; }
    .card, .uc-item, .br-item, .module-card, .entity-block, .interaction-item {
        border-color: #ddd !important;
        background: #fff !important;
        color: #1a1a1a !important;
    }
    .card-label, .uc-detail-label, .section-subtitle, .form-label { color: #666 !important; }
    .section-title { color: #1a1a1a !important; border-bottom-color: #333 !important; }
    .tab-panel { display: block !important; page-break-inside: avoid; }
    .tab-bar { display: none !important; }
    .review-panel, .comment-btn-container, .notification, .wireframe-comment, [contenteditable] { display: none !important; }
    .editable { border: none !important; padding: 0 !important; }
    .header { position: static; background: #fff !important; border-bottom-color: #ddd !important; }
    .header-logo { background: #333 !important; }
    .header-title, .header-app-name { color: #1a1a1a !important; }
    a { text-decoration: none !important; color: inherit !important; }
}
