* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  color: #ffffff;
  min-height: 100vh;
  margin: 0;
  padding: 0;
}

/* === APP LAYOUT === */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* === AGENT SIDEBAR === */
.agent-sidebar {
  width: 240px;
  background: rgba(0, 0, 0, 0.3);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

/* === USER MENU === */
.user-menu {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.2);
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0, 212, 255, 0.3);
  object-fit: cover;
}

.user-info {
  flex: 1;
  min-width: 0;
}

.user-name {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.logout-link {
  font-size: 0.75rem;
  color: #888;
  text-decoration: none;
}

.logout-link:hover {
  color: #ff6b6b;
}

/* === SIDEBAR SECTIONS === */
.sidebar-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.sidebar-section:first-of-type {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-header h2 {
  font-size: 1rem;
  margin: 0;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.btn-icon {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 6px;
  background: rgba(0, 212, 255, 0.2);
  color: #00d4ff;
  font-size: 1.2rem;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-icon:hover {
  background: rgba(0, 212, 255, 0.4);
}

.agent-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
}

.agent-item {
  padding: 12px 15px;
  margin-bottom: 5px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.agent-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.agent-item.selected {
  background: rgba(0, 212, 255, 0.2);
  border-left: 3px solid #00d4ff;
}

.agent-item-info {
  flex: 1;
  min-width: 0;
}

.agent-item-name {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.agent-item-mode {
  font-size: 0.7rem;
  color: #888;
  text-transform: uppercase;
  margin-top: 2px;
}

.agent-item-mode.training {
  color: #ffc107;
}

.agent-item-mode.operational {
  color: #4caf50;
}

.agent-item-delete {
  opacity: 0;
  background: none;
  border: none;
  color: #ff6b6b;
  cursor: pointer;
  padding: 5px;
  font-size: 0.9rem;
}

.agent-item:hover .agent-item-delete {
  opacity: 1;
}

/* === KNOWLEDGE BASE LIST === */
.kb-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
}

.kb-item {
  padding: 10px 12px;
  margin-bottom: 5px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.kb-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.kb-item.selected {
  background: rgba(123, 44, 191, 0.2);
  border-left: 3px solid #9d4edd;
}

.kb-item-info {
  flex: 1;
  min-width: 0;
}

.kb-item-name {
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kb-item-meta {
  font-size: 0.7rem;
  color: #888;
  margin-top: 2px;
}

.kb-item-meta.owned {
  color: #9d4edd;
}

.kb-item-meta.shared {
  color: #00d4ff;
}

.kb-item-meta.public {
  color: #4caf50;
}

.kb-item-actions {
  display: flex;
  gap: 5px;
  opacity: 0;
}

.kb-item:hover .kb-item-actions {
  opacity: 1;
}

.kb-action-btn {
  background: none;
  border: none;
  color: #888;
  cursor: pointer;
  padding: 4px;
  font-size: 0.8rem;
  border-radius: 4px;
}

.kb-action-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.kb-action-btn.delete:hover {
  color: #ff6b6b;
}

.kb-action-btn.share:hover {
  color: #00d4ff;
}

.sidebar-footer {
  padding: 15px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.empty-agents {
  text-align: center;
  padding: 30px 15px;
  color: #666;
}

.empty-agents .hint {
  font-size: 0.85rem;
  margin-top: 5px;
}

.sidebar-footer .admin-link {
  display: block;
  text-align: center;
  padding: 8px;
  background: rgba(123, 44, 191, 0.2);
  color: #9d4edd;
  text-decoration: none;
  border-radius: 6px;
  font-size: 0.85rem;
}

/* === MAIN CONTENT === */
.main-content {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.container {
  width: 100%;
  max-width: 600px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 20px;
  padding: 30px;
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

header {
  text-align: center;
  margin-bottom: 25px;
}

header .company-name {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: #00d4ff;
  margin-bottom: 5px;
  font-weight: 500;
}

header h1 {
  font-size: 1.8rem;
  font-weight: 600;
  background: linear-gradient(90deg, #00d4ff, #7b2cbf);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-top: 0;
}

header .subtitle {
  color: #888;
  margin-top: 5px;
  font-size: 0.95rem;
}

.settings-panel {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding: 15px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
}

.admin-link {
  margin-right: auto;
  padding: 8px 12px;
  background: rgba(123, 44, 191, 0.2);
  color: #9d4edd;
  text-decoration: none;
  border-radius: 6px;
  font-size: 0.85rem;
  transition: background 0.2s;
}

.admin-link:hover {
  background: rgba(123, 44, 191, 0.4);
}

.settings-panel label {
  font-size: 0.9rem;
  color: #aaa;
}

.settings-panel select {
  flex: 1;
  padding: 10px 15px;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 0.9rem;
  cursor: pointer;
  outline: none;
}

.settings-panel select:focus {
  background: rgba(255, 255, 255, 0.15);
}

.settings-panel select option {
  background: #1a1a2e;
  color: #fff;
}

.chat-container {
  margin-bottom: 15px;
}

.transcript {
  height: 300px;
  overflow-y: auto;
  padding: 15px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 12px;
  scroll-behavior: smooth;
}

.transcript::-webkit-scrollbar {
  width: 6px;
}

.transcript::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
}

.transcript::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

.message {
  padding: 10px 15px;
  margin-bottom: 10px;
  border-radius: 10px;
  max-width: 85%;
  word-wrap: break-word;
  animation: fadeIn 0.3s ease;
}

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

.message.system {
  background: rgba(100, 100, 100, 0.3);
  color: #aaa;
  font-size: 0.85rem;
  text-align: center;
  max-width: 100%;
}

.message.user {
  background: linear-gradient(135deg, #7b2cbf 0%, #9d4edd 100%);
  margin-left: auto;
}

.message.assistant {
  background: linear-gradient(135deg, #00d4ff 0%, #0099cc 100%);
  color: #000;
}

.message.error {
  background: rgba(255, 77, 77, 0.3);
  color: #ff6b6b;
  text-align: center;
  max-width: 100%;
}

.status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding: 0 5px;
}

.status {
  font-size: 0.85rem;
  padding: 5px 12px;
  border-radius: 20px;
  font-weight: 500;
}

.status.disconnected {
  background: rgba(255, 77, 77, 0.2);
  color: #ff6b6b;
}

.status.connecting {
  background: rgba(255, 193, 7, 0.2);
  color: #ffc107;
}

.status.connected {
  background: rgba(76, 175, 80, 0.2);
  color: #4caf50;
}

.audio-status {
  font-size: 0.85rem;
  color: #00d4ff;
}

/* === TOOL INDICATOR === */
/* Shows when agent is using tools like web search or knowledge base */
.tool-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 15px;
  margin: 10px 0;
  background: rgba(0, 212, 255, 0.1);
  border: 1px solid rgba(0, 212, 255, 0.3);
  border-radius: 10px;
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
}

.tool-indicator.visible {
  opacity: 1;
  transform: translateY(0);
}

.tool-indicator-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(0, 212, 255, 0.3);
  border-top-color: #00d4ff;
  border-radius: 50%;
  animation: tool-spin 0.8s linear infinite;
}

@keyframes tool-spin {
  to { transform: rotate(360deg); }
}

.tool-indicator-text {
  font-size: 0.85rem;
  color: #00d4ff;
  font-style: italic;
}

/* Different reasoning states */
.tool-indicator.processing {
  background: rgba(255, 193, 7, 0.1);
  border-color: rgba(255, 193, 7, 0.3);
}

.tool-indicator.processing .tool-indicator-spinner {
  border-color: rgba(255, 193, 7, 0.3);
  border-top-color: #ffc107;
}

.tool-indicator.processing .tool-indicator-text {
  color: #ffc107;
}

.tool-indicator.completing {
  background: rgba(156, 39, 176, 0.1);
  border-color: rgba(156, 39, 176, 0.3);
}

.tool-indicator.completing .tool-indicator-spinner {
  border-color: rgba(156, 39, 176, 0.3);
  border-top-color: #9c27b0;
}

.tool-indicator.completing .tool-indicator-text {
  color: #9c27b0;
}

.tool-indicator.responding {
  background: rgba(76, 175, 80, 0.1);
  border-color: rgba(76, 175, 80, 0.3);
}

.tool-indicator.responding .tool-indicator-spinner {
  border-color: rgba(76, 175, 80, 0.3);
  border-top-color: #4caf50;
}

.tool-indicator.responding .tool-indicator-text {
  color: #4caf50;
}

.controls {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-bottom: 20px;
}

.btn {
  padding: 12px 25px;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  outline: none;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(135deg, #00d4ff 0%, #0099cc 100%);
  color: #000;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 212, 255, 0.4);
}

.btn-danger {
  background: linear-gradient(135deg, #ff4d4d 0%, #cc0000 100%);
  color: #fff;
}

.btn-danger:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(255, 77, 77, 0.4);
}

.btn-mic {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7b2cbf 0%, #9d4edd 100%);
  color: #fff;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-mic:hover:not(:disabled) {
  transform: scale(1.05);
  box-shadow: 0 4px 20px rgba(123, 44, 191, 0.5);
}

.btn-mic.recording {
  animation: pulse 1s infinite;
  background: linear-gradient(135deg, #ff4d4d 0%, #cc0000 100%);
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(255, 77, 77, 0.7);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 0 0 15px rgba(255, 77, 77, 0);
  }
}

.visualizer-container {
  display: flex;
  justify-content: center;
}

#visualizer {
  border-radius: 10px;
  background: #1a1a2e;
}

/* === AGENT INFO === */
.agent-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding: 15px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
}

.agent-info.hidden {
  display: none;
}

.agent-mode {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mode-badge {
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  text-transform: uppercase;
  font-weight: 600;
}

.mode-badge.training {
  background: rgba(255, 193, 7, 0.2);
  color: #ffc107;
}

.mode-badge.operational {
  background: rgba(76, 175, 80, 0.2);
  color: #4caf50;
}

.btn-small {
  padding: 6px 12px;
  font-size: 0.8rem;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 6px;
  color: #fff;
  cursor: pointer;
}

.btn-small:hover {
  background: rgba(255, 255, 255, 0.2);
}

.agent-settings {
  display: flex;
  align-items: center;
  gap: 10px;
}

.agent-settings label {
  font-size: 0.85rem;
  color: #888;
}

.agent-settings select {
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 6px;
  color: #fff;
  font-size: 0.85rem;
}

/* === PENDING CHANGES === */
.pending-changes {
  margin-bottom: 15px;
  padding: 15px;
  background: rgba(255, 193, 7, 0.15);
  border: 1px solid rgba(255, 193, 7, 0.4);
  border-radius: 10px;
}

.pending-changes.hidden {
  display: none;
}

.pending-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.pending-icon {
  width: 22px;
  height: 22px;
  background: #ffc107;
  color: #000;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 0.9rem;
}

.pending-title {
  font-weight: 600;
  color: #ffc107;
}

.pending-description {
  font-size: 0.9rem;
  color: #ccc;
  margin-bottom: 12px;
  line-height: 1.4;
  max-height: 200px;
  overflow-y: auto;
  padding-right: 5px;
}

.pending-description::-webkit-scrollbar {
  width: 5px;
}

.pending-description::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
}

.pending-description::-webkit-scrollbar-thumb {
  background: rgba(255, 193, 7, 0.4);
  border-radius: 3px;
}

.pending-description strong {
  color: #fff;
}

.pending-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.pending-actions .btn {
  padding: 8px 16px;
  font-size: 0.85rem;
}

/* === MODAL === */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: #1a1a2e;
  padding: 30px;
  border-radius: 15px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.modal-content h2 {
  margin: 0 0 20px 0;
  font-size: 1.3rem;
}

.modal-content .form-group {
  margin-bottom: 15px;
}

.modal-content .form-group label {
  display: block;
  margin-bottom: 5px;
  color: #888;
  font-size: 0.9rem;
}

.modal-content .form-group input,
.modal-content .form-group select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.3);
  color: #fff;
  font-size: 0.95rem;
}

.modal-content .form-group input:focus,
.modal-content .form-group select:focus {
  outline: none;
  border-color: #00d4ff;
}

.modal-content .form-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.modal-content .form-actions button {
  flex: 1;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* === FORM HELPERS === */
.form-hint {
  display: block;
  margin-top: 5px;
  font-size: 0.75rem;
  color: #666;
}

.form-group input[type="checkbox"] {
  margin-right: 8px;
}

/* === KB SELECTION MODAL === */
.modal-description {
  color: #888;
  font-size: 0.9rem;
  margin-bottom: 15px;
}

.kb-selection-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
}

.kb-selection-item {
  display: flex;
  align-items: center;
  padding: 12px 15px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s;
}

.kb-selection-item:hover {
  background: rgba(0, 212, 255, 0.1);
  border-color: rgba(0, 212, 255, 0.3);
}

.kb-selection-item .kb-icon {
  font-size: 1.2rem;
  margin-right: 12px;
}

.kb-selection-item .kb-info {
  flex: 1;
}

.kb-selection-item .kb-name {
  font-weight: 500;
  color: #fff;
}

.kb-selection-item .kb-doc-count {
  font-size: 0.8rem;
  color: #888;
  margin-top: 2px;
}

.form-group select[multiple] {
  height: 100px;
}

/* === SHARED USERS LIST === */
.shared-users-list {
  margin-top: 15px;
  margin-bottom: 15px;
  max-height: 150px;
  overflow-y: auto;
}

.shared-user {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 6px;
  margin-bottom: 5px;
}

.shared-user-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.shared-user-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(0, 212, 255, 0.3);
}

.shared-user-email {
  font-size: 0.85rem;
  color: #ccc;
}

.shared-user-remove {
  background: none;
  border: none;
  color: #ff6b6b;
  cursor: pointer;
  font-size: 0.9rem;
  padding: 4px 8px;
}

.shared-user-remove:hover {
  background: rgba(255, 77, 77, 0.2);
  border-radius: 4px;
}

.empty-shared {
  text-align: center;
  color: #666;
  font-size: 0.85rem;
  padding: 10px;
}

/* === HIDDEN UTILITY === */
.hidden {
  display: none !important;
}

/* === VIEW PANELS === */
.view-panel {
  width: 100%;
  max-width: 800px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 20px;
  padding: 30px;
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.management-panel {
  max-height: 90vh;
  overflow-y: auto;
}

/* === PANEL HEADER === */
.panel-header {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 25px;
  padding-bottom: 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.panel-header h1 {
  font-size: 1.5rem;
  background: linear-gradient(90deg, #00d4ff, #7b2cbf);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0;
}

.btn-back {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #00d4ff;
  padding: 8px 15px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.2s;
}

.btn-back:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* === MEMORY SIDEBAR === */
.memory-section {
  flex: 0 0 auto;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.memory-sidebar {
  padding: 15px;
  cursor: pointer;
  transition: background 0.2s;
}

.memory-sidebar:hover {
  background: rgba(255, 255, 255, 0.05);
}

.memory-info {
  color: #9d4edd;
  font-size: 0.9rem;
}

/* === KB MANAGEMENT PANEL === */
.add-document-section {
  margin-bottom: 25px;
  padding: 20px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
}

.add-document-section h3 {
  margin: 0 0 15px 0;
  font-size: 1rem;
  color: #00d4ff;
}

.add-document-section .form-group {
  margin-bottom: 12px;
}

.add-document-section .form-group label {
  display: block;
  margin-bottom: 5px;
  color: #888;
  font-size: 0.85rem;
}

.add-document-section .form-group input,
.add-document-section .form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.3);
  color: #fff;
  font-size: 0.9rem;
  font-family: inherit;
}

.add-document-section .form-group input:focus,
.add-document-section .form-group textarea:focus {
  outline: none;
  border-color: #00d4ff;
}

.add-document-section .form-group input[type="file"] {
  padding: 8px;
  background: rgba(0, 0, 0, 0.2);
}

/* === DOCUMENTS SECTION === */
.documents-section {
  margin-top: 20px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.section-header h3 {
  margin: 0;
  font-size: 1rem;
  color: #fff;
}

.search-input {
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.3);
  color: #fff;
  font-size: 0.85rem;
  width: 200px;
}

.search-input:focus {
  outline: none;
  border-color: #00d4ff;
}

.documents-list {
  max-height: 400px;
  overflow-y: auto;
}

.document-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 15px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  margin-bottom: 8px;
  transition: background 0.2s;
}

.document-item:hover {
  background: rgba(0, 0, 0, 0.3);
}

.document-info {
  flex: 1;
  min-width: 0;
}

.document-title {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.document-preview {
  font-size: 0.8rem;
  color: #888;
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.document-actions {
  display: flex;
  gap: 8px;
  opacity: 0;
  transition: opacity 0.2s;
}

.document-item:hover .document-actions {
  opacity: 1;
}

.doc-action-btn {
  background: none;
  border: none;
  color: #888;
  cursor: pointer;
  padding: 5px 10px;
  font-size: 0.8rem;
  border-radius: 4px;
}

.doc-action-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.doc-action-btn.delete:hover {
  color: #ff6b6b;
}

/* === PROPOSALS SECTION === */
.proposals-section {
  margin-bottom: 20px;
  padding: 15px;
  background: rgba(255, 193, 7, 0.1);
  border: 1px solid rgba(255, 193, 7, 0.3);
  border-radius: 12px;
}

.proposals-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-weight: 600;
  color: #ffc107;
}

.proposals-list {
  max-height: 250px;
  overflow-y: auto;
}

.proposal-item {
  padding: 12px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  margin-bottom: 10px;
}

.proposal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.proposal-title {
  font-weight: 500;
  color: #fff;
}

.proposal-agent {
  font-size: 0.75rem;
  color: #888;
  margin-top: 2px;
}

.proposal-reason {
  font-size: 0.85rem;
  color: #aaa;
  margin-bottom: 10px;
  font-style: italic;
}

.proposal-preview {
  font-size: 0.8rem;
  color: #666;
  padding: 8px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
  max-height: 60px;
  overflow: hidden;
  margin-bottom: 10px;
}

.proposal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.proposal-actions .btn {
  padding: 6px 12px;
  font-size: 0.8rem;
}

/* === MEMORY MANAGEMENT PANEL === */
.category-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.tab-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.1);
  color: #888;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s;
}

.tab-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.tab-btn.active {
  background: rgba(157, 78, 221, 0.3);
  color: #9d4edd;
}

.facts-list {
  max-height: 450px;
  overflow-y: auto;
  margin-bottom: 20px;
}

.fact-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 12px 15px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  margin-bottom: 8px;
}

.fact-content {
  flex: 1;
  min-width: 0;
}

.fact-text {
  color: #fff;
  margin-bottom: 5px;
}

.fact-meta {
  display: flex;
  gap: 15px;
  font-size: 0.75rem;
  color: #666;
}

.fact-category {
  text-transform: capitalize;
  color: #9d4edd;
}

.fact-source {
  color: #00d4ff;
}

.fact-actions {
  display: flex;
  gap: 5px;
  opacity: 0;
  transition: opacity 0.2s;
}

.fact-item:hover .fact-actions {
  opacity: 1;
}

.fact-action-btn {
  background: none;
  border: none;
  color: #888;
  cursor: pointer;
  padding: 4px 8px;
  font-size: 0.8rem;
  border-radius: 4px;
}

.fact-action-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.fact-action-btn.delete:hover {
  color: #ff6b6b;
}

.memory-actions {
  padding-top: 15px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: #666;
}

.empty-state p {
  margin: 0;
}

/* === MODAL WIDE === */
.modal-wide {
  max-width: 600px;
}

.doc-content-view {
  max-height: 400px;
  overflow-y: auto;
  padding: 15px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  white-space: pre-wrap;
  font-size: 0.9rem;
  color: #ccc;
  margin-bottom: 15px;
}

/* === KB LIST BADGES === */
.kb-item-badge {
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: 10px;
  margin-left: 8px;
  vertical-align: middle;
}

.kb-item-badge.pending {
  background: rgba(255, 193, 7, 0.3);
  color: #ffc107;
}

/* === MEMORY SUSPEND TOGGLE === */
.memory-suspend-section {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 20px;
  background: rgba(255, 193, 7, 0.05);
  border: 1px solid rgba(255, 193, 7, 0.2);
  border-radius: 10px;
  margin-bottom: 20px;
}

.memory-suspend-section.active {
  background: rgba(255, 193, 7, 0.15);
  border-color: rgba(255, 193, 7, 0.4);
}

.suspend-info {
  flex: 1;
}

.suspend-label {
  display: block;
  font-weight: 500;
  color: #fff;
}

.suspend-hint {
  display: block;
  font-size: 0.8rem;
  color: #888;
  margin-top: 2px;
}

/* Toggle Switch Styles */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.2);
  transition: 0.3s;
  border-radius: 26px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: #fff;
  transition: 0.3s;
  border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
  background-color: #ffc107;
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(22px);
}

/* Memory Suspended Indicator in Sidebar */
.memory-suspended-indicator {
  font-size: 0.7rem;
  padding: 3px 8px;
  background: rgba(255, 193, 7, 0.2);
  color: #ffc107;
  border-radius: 10px;
  margin-top: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ==========================================================================
   DUAL PANEL LAYOUT - Living Briefing Document
   ========================================================================== */

.dual-panel-view {
  display: flex;
  gap: 20px;
  max-width: 1400px;
  padding: 20px;
  background: transparent;
  box-shadow: none;
}

/* === CONVERSATION PANEL (Left) === */
.conversation-panel {
  flex: 1;
  min-width: 400px;
  max-width: 550px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 20px;
  padding: 25px;
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
}

.conversation-panel header {
  text-align: center;
  margin-bottom: 20px;
}

.conversation-panel .chat-container {
  flex: 1;
  min-height: 0;
}

.conversation-panel .transcript {
  height: 280px;
}

/* === BRIEFING PANEL (Right) === */
.briefing-panel {
  flex: 1;
  min-width: 400px;
  max-width: 600px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 20px;
  padding: 20px;
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  max-height: 90vh;
}

.briefing-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 15px;
}

.briefing-header h2 {
  margin: 0;
  font-size: 1.2rem;
  background: linear-gradient(90deg, #00d4ff, #7b2cbf);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.briefing-status {
  display: flex;
  align-items: center;
  gap: 8px;
}

.briefing-status-text {
  font-size: 0.8rem;
  color: #888;
  display: flex;
  align-items: center;
  gap: 6px;
}

.briefing-status-text.updating {
  color: #ffc107;
}

/* Add spinner before text when updating */
.briefing-status-text.updating::before {
  content: '';
  width: 12px;
  height: 12px;
  border: 2px solid rgba(255, 193, 7, 0.3);
  border-top-color: #ffc107;
  border-radius: 50%;
  animation: briefing-spin 0.8s linear infinite;
}

@keyframes briefing-spin {
  to { transform: rotate(360deg); }
}

.briefing-status-text.updated {
  color: #4caf50;
}

/* Brief flash for updated state */
.briefing-status-text.updated::before {
  content: '✓';
  font-size: 0.9rem;
}

/* === BRIEFING EDITOR === */
.briefing-editor-container {
  flex: 1;
  overflow-y: auto;
  margin-bottom: 15px;
}

.briefing-editor {
  min-height: 100%;
}

/* === BRIEFING SECTIONS === */
.briefing-section {
  margin-bottom: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  overflow: hidden;
  transition: border-color 0.2s;
}

.briefing-section:hover {
  border-color: rgba(255, 255, 255, 0.15);
}

.briefing-section:focus-within {
  border-color: rgba(0, 212, 255, 0.4);
}

.section-title {
  margin: 0;
  padding: 10px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #00d4ff;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.section-content {
  padding: 12px 14px;
  min-height: 50px;
  font-size: 0.9rem;
  line-height: 1.5;
  color: #e0e0e0;
  background: rgba(0, 0, 0, 0.1);
  cursor: text;
}

.section-content:focus {
  outline: none;
  background: rgba(0, 0, 0, 0.15);
}

.section-content .placeholder-text {
  color: #666;
  font-style: italic;
  margin: 0;
}

.section-content p {
  margin: 0 0 8px 0;
}

.section-content p:last-child {
  margin-bottom: 0;
}

.section-content ul,
.section-content ol {
  margin: 0;
  padding-left: 20px;
}

.section-content li {
  margin-bottom: 4px;
}

/* Section-specific colors */
.briefing-section[data-section="context"] .section-title {
  color: #9d4edd;
}

.briefing-section[data-section="goal"] .section-title {
  color: #00d4ff;
}

.briefing-section[data-section="findings"] .section-title {
  color: #4caf50;
}

.briefing-section[data-section="decisions"] .section-title {
  color: #ff9800;
}

.briefing-section[data-section="questions"] .section-title {
  color: #f44336;
}

.briefing-section[data-section="actions"] .section-title {
  color: #2196f3;
}

.briefing-section[data-section="references"] .section-title {
  color: #888;
}

/* === DYNAMIC SECTIONS (agent-generated documents) === */
.dynamic-section {
  border-color: rgba(156, 39, 176, 0.3);
  background: rgba(156, 39, 176, 0.05);
}

.dynamic-section .section-title {
  color: #ce93d8;
}

/* Section header with title and action buttons */
.section-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-right: 10px;
}

.section-header-row .section-title {
  flex: 1;
}

/* Action buttons container */
.section-actions {
  display: flex;
  gap: 5px;
}

.section-actions .btn-icon {
  width: 28px;
  height: 28px;
  padding: 0;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 5px;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s, color 0.2s;
}

.section-actions .btn-icon:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

/* Specific button hover states */
.save-section-btn:hover {
  background: rgba(76, 175, 80, 0.3);
  color: #4caf50;
}

.remove-section-btn:hover {
  background: rgba(244, 67, 54, 0.3);
  color: #f44336;
}

/* === BRIEFING ACTIONS === */
.briefing-actions {
  display: flex;
  gap: 10px;
  padding-top: 15px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.briefing-actions .btn {
  flex: 1;
  padding: 10px 15px;
  font-size: 0.85rem;
}

/* === UPDATE INDICATOR === */
.section-update-indicator {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: #4caf50;
  border-radius: 50%;
  margin-left: 8px;
  animation: pulse-green 1s ease-out;
}

@keyframes pulse-green {
  0% {
    transform: scale(1.5);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 0;
  }
}

/* === RESPONSIVE DUAL PANEL === */
@media (max-width: 1100px) {
  .dual-panel-view {
    flex-direction: column;
    max-width: 700px;
  }

  .conversation-panel,
  .briefing-panel {
    max-width: 100%;
    min-width: 0;
  }

  .briefing-panel {
    max-height: 500px;
  }
}

@media (max-width: 600px) {
  .dual-panel-view {
    padding: 10px;
    gap: 15px;
  }

  .conversation-panel,
  .briefing-panel {
    padding: 15px;
    border-radius: 15px;
  }

  .conversation-panel .transcript {
    height: 200px;
  }

  .briefing-section {
    margin-bottom: 12px;
  }

  .section-title {
    padding: 8px 12px;
    font-size: 0.75rem;
  }

  .section-content {
    padding: 10px 12px;
    font-size: 0.85rem;
    min-height: 40px;
  }

  .briefing-actions {
    flex-direction: column;
  }
}

/* Mobile responsive */
@media (max-width: 768px) {
  .app-layout {
    flex-direction: column;
  }

  .agent-sidebar {
    width: 100%;
    max-height: 200px;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .agent-list {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
  }

  .agent-item {
    flex: 0 0 auto;
    padding: 8px 12px;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 20px;
  }

  header h1 {
    font-size: 1.5rem;
  }

  .transcript {
    height: 250px;
  }

  .controls {
    flex-wrap: wrap;
  }

  .btn {
    padding: 10px 20px;
    font-size: 0.9rem;
  }

  .btn-mic {
    width: 60px;
    height: 60px;
  }

  .view-panel {
    padding: 20px;
    border-radius: 15px;
  }

  .panel-header {
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
  }

  .category-tabs {
    overflow-x: auto;
    padding-bottom: 5px;
  }

  .tab-btn {
    flex-shrink: 0;
    padding: 6px 12px;
    font-size: 0.8rem;
  }

  .fact-item,
  .document-item {
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
  }

  .fact-actions,
  .document-actions {
    opacity: 1;
    align-self: flex-end;
  }

  .search-input {
    width: 100%;
    margin-top: 10px;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
  }
}
