:root {
    --bg-color: #f1f8f5;
    --surface-color: #ffffff;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --border-color: #edf2f7;
    --primary-color: #10b981;
    
    --card-green-bg: #d1fae5;
    --card-green-text: #059669;
    --card-orange-bg: #ffedd5;
    --card-orange-text: #ea580c;
    --card-pink-bg: #fce7f3;
    --card-pink-text: #db2777;
    --card-blue-bg: #e0e7ff;
    --card-blue-text: #4f46e5;
    --card-gray-bg: #f3f4f6;
    --card-gray-text: #4b5563;
    --card-yellow-bg: #fef3c7;
    --card-yellow-text: #d97706;
    --card-purple-bg: #f3e8ff;
    --card-purple-text: #9333ea;
    --card-red-bg: #fee2e2;
    --card-red-text: #dc2626;
    --card-teal-bg: #ccfbf1;
    --card-teal-text: #0d9488;
}

body {
    background-color: var(--bg-color);
    font-family: 'Inter', sans-serif;
    margin: 0;
    padding: 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    box-sizing: border-box;
}

.background-blob {
    position: fixed;
    top: -100px;
    left: -100px;
    width: 600px;
    height: 600px;
    background: #fdf2f8;
    border-radius: 50%;
    filter: blur(80px);
    z-index: -1;
}

.app-wrapper {
    background: var(--surface-color);
    width: 100%;
    max-width: 1500px;
    height: 92vh; 
    border-radius: 30px;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.05);
    display: flex;
    position: relative;
    overflow: hidden;
}

/* LEFT SIDEBAR */
.sidebar-left {
    width: 140px;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2.5rem 0;
    background: #fff;
    flex-shrink: 0;
    z-index: 10;
}
.sidebar-left .logo {
    font-size: 2.2rem;
    color: var(--primary-color);
    margin-bottom: 4rem;
}
.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #9ca3af;
    text-decoration: none;
    margin-bottom: 2.5rem;
    font-size: 0.8rem;
    font-weight: 500;
    gap: 0.6rem;
    transition: all 0.3s;
}
.nav-item i {
    font-size: 1.4rem;
}
.nav-item span {
    text-align: center;
    line-height: 1.3;
}
.nav-item:hover {
    color: var(--primary-color);
    transform: translateY(-2px);
}
.nav-item.active {
    color: var(--primary-color);
    position: relative;
}
.nav-item.active::before {
    content: '';
    position: absolute;
    right: -25px; /* depends on sidebar width padding */
    top: 50%;
    transform: translateY(-50%);
    height: 30px;
    width: 4px;
    background: var(--primary-color);
    border-radius: 10px;
}
.help-icon {
    margin-top: auto;
    color: #10b981;
    font-size: 1.8rem;
    cursor: pointer;
    background: #d1fae5;
    padding: 10px;
    border-radius: 12px;
}

/* MAIN CONTENT */
.main-content {
    flex: 1;
    padding: 3.5rem 4rem;
    overflow-y: auto;
    background: #fff;
    scroll-behavior: smooth;
}
.header-top {
    margin-bottom: 3.5rem;
}
.header-top h1 {
    font-size: 2.8rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0 0 0.5rem 0;
    letter-spacing: -1px;
}
.header-top p {
    color: var(--text-secondary);
    font-size: 1.2rem;
    margin: 0;
}

/* CARDS GRID */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 4rem;
}
.card {
    border-radius: 20px;
    padding: 1.8rem;
    position: relative;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s;
    text-decoration: none;
    display: block;
    overflow: hidden;
}
.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.05), 0 10px 10px -5px rgba(0,0,0,0.02);
}
.card h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.15rem;
    font-weight: 600;
    position: relative;
    z-index: 2;
}
.card p {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.9;
    line-height: 1.4;
    position: relative;
    z-index: 2;
}
.card i {
    position: absolute;
    bottom: -10px;
    right: -10px;
    font-size: 5rem;
    opacity: 0.15;
    z-index: 1;
    transform: rotate(-15deg);
    transition: transform 0.3s;
}
.card:hover i {
    transform: rotate(0deg) scale(1.1);
}
.card-green { background: var(--card-green-bg); color: var(--card-green-text); }
.card-orange { background: var(--card-orange-bg); color: var(--card-orange-text); }
.card-pink { background: var(--card-pink-bg); color: var(--card-pink-text); }
.card-blue { background: var(--card-blue-bg); color: var(--card-blue-text); }
.card-yellow { background: var(--card-yellow-bg); color: var(--card-yellow-text); }
.card-gray { background: var(--card-gray-bg); color: var(--card-gray-text); }
.card-purple { background: var(--card-purple-bg); color: var(--card-purple-text); }
.card-red { background: var(--card-red-bg); color: var(--card-red-text); }
.card-teal { background: var(--card-teal-bg); color: var(--card-teal-text); }

/* CONTENT ARTICLE */
.doc-content {
    background: #fff;
    max-width: 900px;
}
.article-section {
    margin-bottom: 5rem;
    padding-top: 1rem;
}
.article-section h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 1rem;
    margin-bottom: 1.8rem;
    letter-spacing: -0.5px;
}
.article-section h3 {
    font-size: 1.4rem;
    color: var(--text-primary);
    margin: 2rem 0 1rem;
}
.doc-content p, .article-section p {
    line-height: 1.85;
    color: #334155;
    font-size: 1.05rem;
    margin-bottom: 1.5rem;
}
.doc-content ul, .doc-content ol, .article-section ul, .article-section ol {
    line-height: 1.85;
    color: #334155;
    font-size: 1.05rem;
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}
.doc-content li, .article-section li {
    margin-bottom: 0.8rem;
}
.article-section li::marker {
    color: var(--primary-color);
    font-weight: bold;
}
.article-section img {
    max-width: 100%;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1), 0 1px 3px rgba(0,0,0,0.05); /* Premium shadow */
    margin: 2.5rem 0;
    border: 1px solid var(--border-color);
    display: block;
}
.article-section code {
    background: #f1f5f9;
    padding: 0.2rem 0.4rem;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.9em;
    color: #0f172a;
    border: 1px solid #e2e8f0;
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border-left: 4px solid #f59e0b;
    padding: 1.5rem;
    border-radius: 0 12px 12px 0;
    margin: 2rem 0;
}
.alert-warning h4 {
    color: #b45309;
    margin: 0 0 0.8rem 0;
    font-size: 1.1rem;
}
.alert-warning p {
    margin: 0 !important;
    color: #92400e !important;
}

.alert-info {
    background: #f0f9ff;
    border-left: 4px solid #0ea5e9;
    padding: 1.5rem;
    border-radius: 0 12px 12px 0;
    margin: 2rem 0;
}
.alert-info h4 {
    color: #0369a1;
    margin: 0 0 0.8rem 0;
    font-size: 1.1rem;
}
.alert-info p {
    margin: 0 !important;
    color: #0c4a6e !important;
}

.alert-success {
    background: #ecfdf5;
    border-left: 4px solid #10b981;
    padding: 1.5rem;
    border-radius: 0 12px 12px 0;
    margin: 2rem 0;
}
.alert-success h4 {
    color: #047857;
    margin: 0 0 0.8rem 0;
    font-size: 1.1rem;
}
.alert-success p {
    margin: 0 !important;
    color: #064e3b !important;
}

/* RIGHT SIDEBAR - TOC */
.sidebar-right {
    width: 350px;
    border-left: 1px solid var(--border-color);
    background: #fff;
    padding: 2.5rem;
    flex-shrink: 0;
    overflow-y: auto;
    position: relative;
    z-index: 10;
}
.user-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 3.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}
.user-profile img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 12px;
}
.user-info h4 {
    margin: 0 0 0.2rem;
    color: var(--text-primary);
    font-weight: 700;
}
.user-info p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.toc h3 {
    color: var(--primary-color);
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    font-size: 1.2rem;
}
.toc-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}
.toc-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
.toc-item {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.2s;
}
.toc-item:hover {
    transform: translateX(5px);
}
.toc-number {
    font-size: 2.2rem;
    font-weight: 800;
    color: #d1fae5; /* Very subtle default */
    line-height: 1;
    transition: color 0.4s;
    font-family: inherit;
    letter-spacing: -1px;
}
.toc-text h4 {
    margin: 0 0 0.2rem 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    transition: color 0.4s;
}
.toc-text p {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Active State TOC */
.toc-item.active .toc-number {
    color: var(--primary-color);
}
.toc-item.active .toc-text h4 {
    color: var(--primary-color);
}

/* Responsive */
@media (max-width: 1200px) {
    .sidebar-right { width: 300px; padding: 2rem; }
    .main-content { padding: 3rem 2rem; }
}
@media (max-width: 1024px) {
    .sidebar-right { display: none; }
}
.menu-overlay, .mobile-menu-btn, .close-menu-btn { display: none; }
@media (max-width: 768px) {
    .app-wrapper {
        flex-direction: column;
        border-radius: 0;
        height: 100vh;
    }
    body { padding: 0; }
    .sidebar-left {
        flex-direction: row;
        width: 100%;
        box-sizing: border-box;
        height: auto;
        padding: 1rem 1.5rem;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        justify-content: space-between;
        position: sticky;
        top: 0;
        z-index: 100;
    }
    .mobile-menu-btn {
        display: block;
        background: none;
        border: none;
        font-size: 1.5rem;
        cursor: pointer;
        color: var(--text-primary);
        margin-right: 15px;
        padding: 0;
    }
    .mobile-logo-group {
        display: flex;
        align-items: center;
    }
    .sidebar-left nav {
        position: fixed;
        top: 0;
        left: -300px;
        width: 250px;
        height: 100vh;
        background: #fff;
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
        padding: 4rem 2rem;
        box-shadow: 10px 0 20px rgba(0,0,0,0.1);
        z-index: 1000;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto;
    }
    .sidebar-left nav.open {
        left: 0;
    }
    .close-menu-btn {
        display: block;
        position: absolute;
        top: 20px;
        right: 20px;
        background: none;
        border: none;
        font-size: 1.5rem;
        color: var(--text-secondary);
        cursor: pointer;
    }
    .menu-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0,0,0,0.5);
        z-index: 90;
    }
    .menu-overlay.open {
        display: block;
    }
    .sidebar-left .logo, .help-icon { margin: 0; font-size: 1.5rem; flex-shrink: 0; z-index: 10; }
    .nav-item { margin-bottom: 2rem; font-size: 0.95rem; flex-direction: row; gap: 1rem; width: 100%; justify-content: flex-start; }
    .nav-item i { width: 30px; text-align: center; }
    .nav-item span { text-align: left; white-space: nowrap; }
    .nav-item.active::before { display: none; }
    
    .main-content { padding: 1.5rem; }
    .header-top h1 { font-size: 1.6rem !important; line-height: 1.35 !important; }
    .article-section h2 { font-size: 1.45rem; margin-bottom: 1.5rem; }
    .article-section h3 { font-size: 1.25rem; margin: 1.5rem 0 1rem; }
    .doc-content p, .article-section p { font-size: 0.98rem; line-height: 1.7; }
    .doc-content ul, .doc-content ol, .article-section ul, .article-section ol { font-size: 0.98rem; line-height: 1.7; }
    .alert-info, .alert-success, .alert-warning { padding: 1.2rem; }
}
