
:root { 
    --sidebar-width: 190px;
    --bg-color: #f4f6f8; 
    --primary-color: #0d6efd; 
    --header-height-mobile: 60px;
}

body { 
    background-color: var(--bg-color); 
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    overflow: hidden; 
    height: 100vh; 
}


#wrapper { display: flex; width: 100%; height: 100%; overflow: hidden;
 }

#sidebar-wrapper { 
    width: var(--sidebar-width); 
    height: 100vh; 
    background: #212529; 
    color: #fff; 
    flex-shrink: 0; 
    transition: margin-left 0.3s ease;
    z-index: 1000; 
    overflow-y: auto; 
}
div#table-preview-container {
    zoom: 0.8;
}
#page-content-wrapper { flex-grow: 1; height: 100vh; display: flex;
    flex-direction: column; overflow: hidden; position: relative; width: 100%;
}


.mobile-header { display: none; height: var(--header-height-mobile); background: #fff;
    border-bottom: 1px solid #dee2e6; align-items: center; padding: 0 15px;
flex-shrink: 0; }


.sidebar-heading { padding: 1.5rem 1.25rem;
    font-size: 1.2rem; font-weight: bold; background: #1b1e21; }
.list-group-item { background: transparent;
color: #adb5bd; border: none; padding: 12px 20px; cursor: pointer;
    font-size: 0.95rem; }
.list-group-item:hover, .list-group-item.active { background: #343a40; color: #fff;
border-left: 4px solid var(--primary-color); }
.list-group-item i { margin-right: 10px; width: 20px;
    text-align: center; }


.w-custom-12 { width: 12.5%;
flex: 0 0 12.5%; } .w-custom-25 { width: 25%;
    flex: 0 0 25%; } .w-custom-33 { width: 33.3333%;
flex: 0 0 33.3333%; } .w-custom-50 { width: 50%;
    flex: 0 0 50%; } .w-custom-100 { width: 100%;
flex: 0 0 100%; }
.hidden { display: none !important;
 }


.canvas-area { background-color: #ffffff;
background-image: radial-gradient(#e5e7eb 1px, transparent 1px); background-size: 20px 20px; border: 1px solid #dee2e6;
    min-height: 400px; padding: 30px; border-radius: 8px;
}
.editor-row-container { border: 1px dashed #ced4da; border-radius: 8px; padding: 10px; margin-bottom: 15px; background: rgba(255,255,255,0.6);
    position: relative; }
.form-element-wrapper { background: white;
border: 1px solid #e0e0e0; border-left: 4px solid var(--primary-color); border-radius: 6px; padding: 12px; cursor: grab;
    transition: all 0.2s; height: 100%;
box-shadow: 0 2px 4px rgba(0,0,0,0.03); }
.form-element-wrapper:hover { transform: translateY(-2px); box-shadow: 0 4px 8px rgba(0,0,0,0.08);
    }
.form-element-wrapper.selected { border-color: var(--primary-color); background: #f8fbff;
outline: 2px solid rgba(13,110,253,0.3); }
.form-element-wrapper.drag-over-target { border-top: 4px solid #198754 !important; background: #e8f5e9 !important;
    transform: scale(1.02); }
.type-money { border-left-color: #198754;
} .type-text { border-left-color: #0d6efd; } .type-date { border-left-color: #ffc107;
    } .type-file { border-left-color: #6610f2; }
.draggable-item { padding: 10px;
margin-bottom: 8px; background: #fff; border: 1px solid #dee2e6; border-radius: 4px;
    cursor: grab; font-size: 0.9rem; }
.draggable-item:hover { background-color: #e9ecef; border-color: #adb5bd;
    }


.preview-th-draggable {
    cursor: move;
    background-color: #f8f9fa !important;
    border-bottom: 2px solid #dee2e6;
    position: relative;
    user-select: none;
}
.preview-th-draggable:hover {
    background-color: #e9ecef !important;
}
.preview-th-draggable.dragging-col {
    opacity: 0.5;
    background-color: #cfe2ff !important;
    }
.preview-th-draggable.drag-over-col {
    border-left: 3px solid var(--primary-color);
}


.split-container { display: flex;
    width: 100%; height: 100%; overflow: hidden;
}


.split-left { 
    overflow-y: auto;
    background: #ddd;
    border-right: 1px solid #dee2e6; 
    min-width: 350px; 
    height: 100%; 
    transition: all 0.3s ease;
    }
.split-right { 
    background: #525659;
    display: flex; 
    flex-direction: column; 
    overflow: hidden; 
    transition: all 0.3s ease;
    border-left: 1px solid #444;
}


.layout-fixed-pdf .split-left { flex: 1;
    }
.layout-fixed-pdf .split-right { flex: 0 0 900px; width: 900px;
 }


.pdf-toolbar { background: #343a40; color: white;
    padding: 8px 15px; display: none; justify-content: space-between; align-items: center;
 border-bottom: 1px solid #495057; flex-shrink: 0;
    }

#pdf-render-wrapper { 
    flex: 1; 
    overflow-y: auto; 
    overflow-x: hidden; 
    background-color: #525659;
    display: block; 
    padding: 0px; 
    position: relative;
    text-align: center; 
}


.pdf-page-container {
    position: relative;
    display: inline-block;
    
    margin: 0 auto 20px auto;
    
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    background-color: white;
    max-width: fit-content;
    }


.pdf-page-canvas { 
    display: block; 
    width: 100%;
    height: auto !important;
    max-width: 100%;
    }


.textLayer {
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    opacity: 0.2; 
    line-height: 1.0;
    pointer-events: auto; 
}

.textLayer > span {
    color: transparent;
    position: absolute;
    white-space: pre;
    cursor: text;
    transform-origin: 0% 0%;
}


.textLayer ::selection {
    background: rgba(0, 0, 255, 1);
    
    color: transparent;
}

.pdf-placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center;
    height: 100%; color: #fff; }


.history-scroll-box {
    max-height: 200px;
    
    overflow-y: auto;  
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 10px;
}
.history-timeline { list-style: none; padding: 0; margin: 0; position: relative;
    }
.history-item { 
    padding-left: 15px;
    position: relative; 
    margin-bottom: 8px;
    
    border-left: 2px solid #e0e0e0; 
}
.history-item:last-child { margin-bottom: 0; }
.history-item::before { content: ''; position: absolute;
    left: -5px; top: 3px; width: 8px;
 height: 8px; border-radius: 50%; background: var(--primary-color); }
.history-date { font-size: 0.7rem; color: #999;
    }


.history-msg { 
    font-size: 0.8rem; 
    color: #333; 
    font-weight: 500;
    line-height: 1.3; 
    white-space: pre-wrap;
    
}
.scroll-container { overflow-y: auto; height: 100%; padding: 20px;
    }


.kpi-card {
    transition: transform 0.2s;
    background-color: #fff;
    }
.kpi-card:hover {
    transform: translateY(-2px);
}


.file-btn-group .btn {
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}


.chart-container {
    position: relative;
    height: 60vh;
    width: 100%;
}
.stats-config-card {
    background: #f8f9fa;
    border-right: 1px solid #dee2e6;
    height: 100%;
}


@media (max-width: 768px) {
    #sidebar-wrapper { margin-left: calc(-1 * var(--sidebar-width));
        position: fixed; height: 100%; }
    body.sb-sidenav-toggled #sidebar-wrapper { margin-left: 0; box-shadow: 5px 0 15px rgba(0,0,0,0.3);
        }
    .mobile-header { display: flex; }
    #page-content-wrapper { width: 100%; margin-left: 0;
        }

    .split-container { display: block; overflow-y: auto; height: calc(100vh - var(--header-height-mobile));
        }
    .split-left { width: 100% !important; height: auto !important; border-right: none; border-bottom: 1px solid #dee2e6; overflow-y: visible;
        display: block; min-width: 0; }
    .split-right { width: 100% !important; height: auto !important; min-height: 400px; display: block;
        flex: none; border-left: none; }
    .layout-fixed-pdf .split-right { width: 100% !important; flex: none;
        }
    
    #pdf-render-wrapper { height: auto !important; display: block; overflow: visible; padding: 0;
        }
    .pdf-page-container { margin: 0 auto 10px auto; width: 100% !important; box-shadow: none;
        }
    
    .pdf-page-canvas { width: 100% !important;
        }

    .w-custom-12, .w-custom-25, .w-custom-33, .w-custom-50 { width: 100%; flex: 0 0 100%; margin-bottom: 10px;
        }
    #view-editor .row { flex-direction: column; overflow-y: auto;
        }
    #view-editor .col-md-3, #view-editor .col-md-6 { width: 100%; margin-bottom: 20px;
        }
    .canvas-area { min-height: 400px; }
    .chart-container { height: 400px; }
}



#table-body tr[style*="background-color"] > * {
    background-color: inherit !important;
    color: inherit !important;
    box-shadow: none !important;
    
}