body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; margin: 20px; background-color: #f0f2f5; }
.container { display: flex; gap: 20px; max-width: 1200px; margin: 0 auto; }
.panel { background: white; border: 1px solid #ddd; padding: 20px; border-radius: 8px; flex: 1; box-shadow: 0 2px 4px rgba(0,0,0,0.1); }
h2 { margin-top: 0; color: #333; }

/* Chat Styles */
.chat-container { display: flex; height: 600px; border: 1px solid #ccc; border-radius: 5px; overflow: hidden; margin-bottom: 15px; }
.contacts-sidebar { width: 35%; background: #fff; border-right: 1px solid #ccc; overflow-y: auto; }
.contact-item { padding: 12px 15px; border-bottom: 1px solid #eee; cursor: pointer; transition: 0.2s; }
.contact-item:hover { background: #f0f2f5; }
.contact-item.active { background: #ebebeb; border-left: 4px solid #25d366; padding-left: 11px; }
.chat-area { width: 65%; display: flex; flex-direction: column; background: #efeae2 url('https://user-images.githubusercontent.com/15075759/28719144-86dc0f70-73b1-11e7-911d-60d70fcded21.png'); }
.chat-header { background-color: #f0f2f5; padding: 15px; border-bottom: 1px solid #ddd; display: flex; align-items: center; font-weight: bold; color: #111; }
#chat-box { flex: 1; padding: 15px; overflow-y: auto; display: flex; flex-direction: column; }
.message { margin-bottom: 10px; padding: 8px 12px; border-radius: 7.5px; max-width: 75%; font-size: 14.5px; position: relative; box-shadow: 0 1px 0.5px rgba(0,0,0,0.13); word-wrap: break-word; line-height: 1.4; }
.message.agent { background-color: #d9fdd3; align-self: flex-end; border-top-right-radius: 0; }
.message.customer { background-color: #ffffff; align-self: flex-start; border-top-left-radius: 0; }

/* Chat Input Styles */
.chat-input-bar { background-color: #f0f2f5; padding: 10px 15px; display: flex; flex-direction: column; gap: 10px; border-top: 1px solid #ddd; }
.attachment-toolbar { display: flex; gap: 10px; }
.attach-btn { background: none; border: none; font-size: 18px; cursor: pointer; color: #54656f; padding: 6px; border-radius: 50%; transition: background 0.2s; width: auto; margin: 0; display: flex; justify-content: center; align-items: center; }
.attach-btn:hover:not(:disabled) { background: #d9dbdf; }
.attach-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.attach-btn.active { background: #d1d7db; }

.input-row { display: flex; gap: 10px; align-items: flex-end; }
.input-container { flex: 1; background: #fff; border-radius: 8px; padding: 8px 12px; box-shadow: 0 1px 0.5px rgba(0,0,0,0.13); }
.input-container textarea, .input-container input[type="text"] { border: none; background: transparent; outline: none; padding: 0; margin: 0; resize: none; font-family: inherit; font-size: 15px; width: 100%; box-sizing: border-box; }
.input-container input[type="file"] { margin: 5px 0; font-size: 13px; }
.send-btn { background: #00a884; color: white; border: none; border-radius: 50%; width: 40px; height: 40px; min-width: 40px; display: flex; justify-content: center; align-items: center; cursor: pointer; font-size: 18px; padding: 0; margin: 0; margin-bottom: 2px; transition: 0.2s; }
.send-btn:hover:not(:disabled) { background: #008f6f; }
.send-btn:disabled { background: #a5e0d3; cursor: not-allowed; }

/* Form Styles */
input, textarea, button { width: 100%; box-sizing: border-box; margin-bottom: 10px; padding: 10px; border: 1px solid #ccc; border-radius: 5px; }

/* Rule Styles */
.rule-item { display: flex; justify-content: space-between; align-items: center; border: 1px solid #eee; padding: 10px; margin-bottom: 8px; border-radius: 5px; background: #fafafa; }
.rule-content { flex: 1; margin-right: 15px; }
.rule-keyword { font-weight: bold; color: #075e54; font-size: 1.1em; }
.rule-text { font-size: 0.9em; color: #555; margin-top: 4px; white-space: pre-wrap; }
.delete-btn { background-color: #dc3545; width: auto; padding: 6px 12px; margin: 0; font-size: 14px; }
.delete-btn:hover { background-color: #c82333; }

/* Node Editor Styles */
.workflow-node { position: absolute; width: 230px; background: white; border-radius: 8px; box-shadow: 0 4px 10px rgba(0,0,0,0.15); border: 1px solid #ddd; z-index: 10; user-select: none; }
.workflow-node.selected-node { border: 2px solid #007bff; box-shadow: 0 0 10px rgba(0,123,255,0.3); }
.node-drag-handle { background: #00a884; color: white; padding: 10px 15px; border-radius: 8px 8px 0 0; font-weight: bold; cursor: grab; font-size: 15px; }
.node-drag-handle:active { cursor: grabbing; }
.node-body { padding: 15px; font-size: 13px; color: #444; }
.state-badge { padding: 3px 6px; border-radius: 4px; font-weight: bold; color: white; font-size: 11px; display: inline-block; margin-top: 4px; }
.badge-trigger { background-color: #6c757d; }
.badge-next { background-color: #007bff; }
.node-edit-btn { margin-top: 15px; padding: 6px; font-size: 12px; background: #f0f2f5; color: #333; border: 1px solid #ccc; width: 100%; border-radius: 4px; cursor: pointer; transition: 0.2s; }
.node-edit-btn:hover { background: #e2e6ea; }
.port { position: absolute; width: 12px; height: 12px; background: #fff; border: 2px solid #00a884; border-radius: 50%; cursor: crosshair; z-index: 20; box-shadow: 0 1px 3px rgba(0,0,0,0.2); transition: 0.2s; }
.port:hover { background: #00a884; transform: scale(1.2); }
.port-in { left: -7px; top: 50%; transform: translateY(-50%); border-color: #6c757d; }
.port-out { right: -7px; top: 50%; transform: translateY(-50%); border-color: #007bff; }

/* History Dropdown Styles */
.history-item { padding: 8px 12px; font-size: 13px; cursor: pointer; border-bottom: 1px solid #eee; white-space: nowrap; color: #333; text-align: left; }
.history-item:hover { background: #f0f2f5; }
.history-item:last-child { border-bottom: none; }