.botcoder-database-container {
    display: flex;
    height: 100vh;
    width: 100%;
    background-color: var(--surface, #1e293b);
    color: var(--text, #f8fafc);
}

.botcoder-db-sidebar {
    width: 300px;
    background-color: var(--surface-hover, #334155);
    border-right: 1px solid var(--border, #475569);
    display: flex;
    flex-direction: column;
}

.botcoder-db-header {
    padding: 16px;
    border-bottom: 1px solid var(--border, #475569);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.botcoder-db-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
}

.botcoder-table-list {
    flex-grow: 1;
    overflow-y: auto;
    padding: 8px 0;
}

.botcoder-table-item {
    padding: 8px 16px;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}
.botcoder-table-item:hover { background-color: rgba(255,255,255,0.05); }

.botcoder-query-builder {
    padding: 16px;
    border-top: 1px solid var(--border, #475569);
    background-color: var(--surface, #1e293b);
}

.botcoder-query-builder h4 {
    margin: 0 0 8px;
    font-size: 13px;
    color: var(--text-muted, #94a3b8);
}

.botcoder-query-builder select,
.botcoder-query-builder textarea {
    width: 100%;
    background: var(--surface-active, #0f172a);
    border: 1px solid var(--border, #475569);
    color: var(--text, #f8fafc);
    padding: 8px;
    border-radius: 4px;
    margin-bottom: 8px;
    font-size: 13px;
    font-family: inherit;
}
.botcoder-query-builder textarea {
    height: 100px;
    resize: vertical;
}

.botcoder-db-main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.botcoder-er-canvas-container {
    height: 60%;
    position: relative;
    border-bottom: 1px solid var(--border, #475569);
    overflow: hidden;
    background: repeating-linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
                repeating-linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
    background-size: 20px 20px;
}

.botcoder-er-toolbar {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 10;
    background: var(--surface, #1e293b);
    border: 1px solid var(--border, #475569);
    border-radius: 6px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 13px;
    font-weight: 500;
}
.botcoder-er-controls { display: flex; gap: 4px; }

.botcoder-er-canvas {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0; left: 0;
}

.er-canvas-wrapper {
    position: absolute;
    top: 0; left: 0;
    width: 4000px; height: 3000px;
    transition: transform 0.2s;
}

.er-table-node {
    position: absolute;
    background: var(--surface, #1e293b);
    border: 1px solid var(--border, #475569);
    border-radius: 8px;
    width: 200px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.er-table-header {
    background: var(--surface-hover, #334155);
    padding: 10px 14px;
    font-weight: 600;
    font-size: 14px;
    border-bottom: 1px solid var(--border, #475569);
    border-radius: 8px 8px 0 0;
    color: var(--accent, #3b82f6);
}

.er-table-body {
    padding: 8px 0;
}

.er-field {
    padding: 6px 14px;
    font-size: 13px;
    color: var(--text-muted, #94a3b8);
}

.er-field:hover { background: rgba(255,255,255,0.05); }

.botcoder-data-grid-container {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.botcoder-grid-toolbar {
    padding: 10px 16px;
    background: var(--surface-hover, #334155);
    border-bottom: 1px solid var(--border, #475569);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.botcoder-data-grid {
    flex-grow: 1;
    overflow: auto;
    padding: 16px;
}

.botcoder-grid-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.botcoder-grid-table th {
    text-align: left;
    padding: 8px 12px;
    background: var(--surface-hover, #334155);
    border-bottom: 2px solid var(--border, #475569);
    color: var(--text-muted, #94a3b8);
    position: sticky;
    top: -16px;
}

.botcoder-grid-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border, #475569);
}

.botcoder-grid-table tr:hover { background: rgba(255,255,255,0.03); }

.botcoder-btn {
    padding: 6px 16px;
    font-size: 13px;
    font-weight: 500;
    background: var(--surface, #1e293b);
    border: 1px solid var(--border, #475569);
    border-radius: 4px;
    color: var(--text, #f8fafc);
    cursor: pointer;
}
.botcoder-btn-primary {
    background: var(--accent, #3b82f6);
    border-color: var(--accent, #3b82f6);
}
