body {
    background-color: #f0f2f5;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.sidebar {
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 16.666667%;
    overflow-y: auto;
}

.main-content {
    margin-left: 16.666667%;
}

.nav-link.active {
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 5px;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
}

/* Contract Editor */
.placeholder-item {
    cursor: move;
    padding: 10px;
    margin: 8px 0;
    background: white;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    transition: all 0.2s;
}

.placeholder-item:hover {
    background: #e9ecef;
    border-color: #667eea;
    transform: translateX(5px);
}

.placeholder-item.dragging {
    opacity: 0.5;
}

.contract-canvas-container {
    position: relative;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    background: #ffffff;
    min-height: 600px;
    overflow: auto;
    max-height: 800px;
}

.contract-canvas-container.drag-over {
    border-color: #667eea;
    background: #f8f9fa;
}

.pdf-canvas {
    display: block;
    margin: 0 auto;
}

.field-marker {
    position: absolute;
    padding: 6px 12px;
    background: #667eea;
    color: white;
    border-radius: 4px;
    font-size: 12px;
    cursor: move;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    z-index: 10;
}

.field-marker:hover {
    background: #5568d3;
}

.field-marker .remove-btn {
    background: rgba(255, 255, 255, 0.3);
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
}

.field-marker .remove-btn:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Image Drop Zone */
.drop-zone {
    min-height: 200px;
    border: 3px dashed #dee2e6;
    border-radius: 8px;
    padding: 30px;
    background: white;
    transition: all 0.3s;
    cursor: pointer;
}

.drop-zone:hover {
    border-color: #667eea;
    background: #f8f9fa;
}

.drop-zone.drag-over {
    border-color: #667eea;
    background: #e9ecef;
}

/* Chat */
.chat-container {
    height: 500px;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.message {
    margin: 15px 0;
    padding: 12px 18px;
    border-radius: 12px;
    max-width: 70%;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.message.bot {
    background: white;
    margin-right: auto;
    border: 1px solid #dee2e6;
}

.message.user {
    background: #667eea;
    color: white;
    margin-left: auto;
    text-align: right;
}

/* Card hover effect */
.card {
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Loading spinner */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}