* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: #f8fafc; color: #1a202c; height: 100vh; overflow: hidden; }

/* Header */
.header { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; padding: 12px 20px; box-shadow: 0 2px 10px rgba(0,0,0,0.1); position: relative; z-index: 100; }
.nav-menu { display: flex; gap: 0; align-items: center; }
.nav-item { background: none; border: none; color: white; padding: 10px 16px; cursor: pointer; border-radius: 6px; transition: all 0.2s; font-size: 14px; font-weight: 500; }
.nav-item:hover { background: rgba(255,255,255,0.1); transform: translateY(-1px); }
.nav-item.active { background: rgba(255,255,255,0.2); }

/* Layout */
.main-container { display: flex; height: calc(100vh - 60px); position: relative; }
.sidebar { width: 60px; background: #2d3748; transition: width 0.3s ease; overflow: hidden; position: relative; z-index: 50; }
.sidebar.expanded { width: 200px; }
.sidebar-toggle { background: none; border: none; color: #a0aec0; padding: 15px; cursor: pointer; width: 100%; text-align: left; font-size: 18px; }
.sidebar-toggle:hover { color: white; background: #4a5568; }
.sidebar-menu { list-style: none; }
.sidebar-item { display: flex; align-items: center; padding: 12px 15px; color: #a0aec0; cursor: pointer; transition: all 0.2s; white-space: nowrap; }
.sidebar-item:hover { background: #4a5568; color: white; }
.sidebar-item.active { background: #667eea; color: white; }
.sidebar-item i { width: 20px; margin-right: 12px; text-align: center; }

.content-area { flex: 1; display: flex; gap: 1px; background: #e2e8f0; }
.left-panel, .right-panel { background: white; overflow-y: auto; position: relative; }
.left-panel { flex: 1; min-width: 400px; }
.right-panel { flex: 1; min-width: 400px; }

.panel-header { background: #f7fafc; border-bottom: 1px solid #e2e8f0; padding: 16px 20px; font-weight: 600; color: #2d3748; position: sticky; top: 0; z-index: 10; }
.panel-content { padding: 20px; }

/* Tool menu */
.tool-menu { display: flex; gap: 8px; margin-top: 8px; }

/* Toolbar (right) */
.toolbar { padding: 10px; border-bottom: 1px solid #e2e8f0; display: flex; gap: 8px; flex-wrap: wrap; }

/* Forms */
.form-group { margin-bottom: 16px; }
.form-label { display: block; margin-bottom: 6px; font-weight: 500; color: #374151; font-size: 14px; }
.form-input, .form-textarea, .form-select { width: 100%; padding: 10px 12px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 14px; transition: border-color 0.2s; }
.form-input:focus, .form-textarea:focus, .form-select:focus { outline: none; border-color: #667eea; box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1); }
.form-textarea { min-height: 120px; resize: vertical; }

/* Buttons */
.btn { padding: 10px 16px; border: none; border-radius: 6px; font-weight: 500; cursor: pointer; transition: all 0.2s; font-size: 14px; }
.btn-small { padding: 6px 10px; font-size: 12px; }
.btn-primary { background: #667eea; color: white; }
.btn-primary:hover { background: #5a67d8; transform: translateY(-1px); }
.btn-secondary { background: #e2e8f0; color: #4a5568; }
.btn-secondary:hover { background: #cbd5e0; }
.btn-danger { background: #f56565; color: white; }
.btn-danger:hover { background: #e53e3e; }

.center { text-align: center; margin-top: 8px; }

/* Search results */
.search-result { border: 1px solid #e2e8f0; border-radius: 8px; padding: 16px; margin-bottom: 12px; transition: all 0.2s; }
.search-result:hover { border-color: #667eea; box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
.search-result.selected { border-color: #667eea; background: #f0f4ff; }
.result-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.result-title { font-weight: 600; color: #2d3748; font-size: 14px; }
.result-meta { font-size: 12px; color: #718096; margin-bottom: 8px; }
.result-content { color: #4a5568; font-size: 14px; line-height: 1.5; }
.select-all { margin-bottom: 8px; }

/* Blocks container (compose) */
.blocks-container { margin-top: 16px; border-top: 1px solid #e2e8f0; padding-top: 12px; max-height: 240px; overflow-y: auto; }

/* Messages */
.status-message { padding: 12px 16px; border-radius: 6px; margin-bottom: 16px; font-size: 14px; }
.status-success { background: #f0fff4; border: 1px solid #9ae6b4; color: #276749; }
.status-error { background: #fed7d7; border: 1px solid #feb2b2; color: #c53030; }
.status-info { background: #ebf8ff; border: 1px solid #90cdf4; color: #2b6cb0; }

/* Footer */
.footer { background: #2d3748; color: #a0aec0; padding: 16px 20px; text-align: center; font-size: 14px; border-top: 1px solid #4a5568; }
.footer a { color: #667eea; text-decoration: none; }
.footer a:hover { text-decoration: underline; }

/* Hidden */
.hidden { display: none; }

/* Loading */
.loading { text-align: center; padding: 40px; color: #718096; }
.spinner { display: inline-block; width: 20px; height: 20px; border: 3px solid #f3f3f3; border-top: 3px solid #667eea; border-radius: 50%; animation: spin 1s linear infinite; margin-right: 8px; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* Responsive */
@media (max-width: 768px) {
  .content-area { flex-direction: column; }
  .nav-menu { flex-wrap: wrap; gap: 4px; }
  .nav-item { padding: 8px 12px; font-size: 12px; }
}
