:root {
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --c-bg: #ffffff;
  --c-sidebar-bg: #f9f9fb;
  --c-border: #eef0f2;
  --c-text-main: #1f2937;
  --c-text-muted: #6b7280;
  --c-primary: #3b82f6;
  --c-primary-hover: #2563eb;
  --c-hover-bg: #f3f4f6;
  --c-bubble-user: #f3f4f6;
  --c-bubble-ai: #e0f2fe;
}

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

body {
  font-family: var(--font-family);
  background-color: var(--c-bg);
  color: var(--c-text-main);
  font-size: 14px;
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.text-muted { color: var(--c-text-muted) !important; }
.bg-primary { background-color: var(--c-primary) !important; }
.text-white { color: #fff !important; }

.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 20;
}
.icon-small { font-size: 16px !important; }
.icon-sm { font-size: 20px !important; }

/* App Container */
.app-container {
  display: flex;
  width: 100%;
  height: 100%;
}

/* Sidebar Mini (Navigation) */
.sidebar-mini {
  width: 64px;
  border-right: 1px solid var(--c-border);
  background-color: var(--c-sidebar-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 0;
  flex-shrink: 0;
}

.workspace-icon {
  width: 32px;
  height: 32px;
  background-color: #fce7f3;
  color: #db2777;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 24px;
}

.mini-nav {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  align-items: center;
}

.mini-item {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: var(--c-text-muted);
  text-decoration: none;
  transition: all 0.2s;
}
.mini-item:hover {
  background-color: #e5e7eb;
  color: var(--c-text-main);
}
.mini-item.active {
  background-color: #e0e7ff;
  color: #3730a3;
}
.mini-item.active .material-symbols-outlined {
  color: #3730a3;
}

/* Chat List Pane */
.chat-list-pane {
  width: 320px;
  border-right: 1px solid var(--c-border);
  background-color: var(--c-bg);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.pane-header {
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--c-border);
  height: 64px;
}

.pane-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--c-text-main);
}

.header-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.chat-list {
  flex-grow: 1;
  overflow-y: auto;
}

.chat-item {
  display: flex;
  padding: 12px 16px;
  gap: 12px;
  border-bottom: 1px solid var(--c-border);
  cursor: pointer;
  transition: background 0.2s;
}
.chat-item:hover {
  background-color: var(--c-hover-bg);
}
.chat-item.active {
  background-color: #f0fdf4;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  color: var(--c-text-muted);
  flex-shrink: 0;
}

.chat-info {
  flex-grow: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.chat-top-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 4px;
}

.chat-name {
  font-weight: 500;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-time {
  font-size: 12px;
  color: var(--c-text-muted);
  flex-shrink: 0;
  margin-left: 8px;
}

.chat-preview {
  font-size: 13px;
  color: var(--c-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Chat Main Pane */
.chat-main-pane {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  background-color: #fcfcfc;
  position: relative;
}

.chat-header {
  height: 64px;
  border-bottom: 1px solid var(--c-border);
  background-color: var(--c-bg);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-header-text h3 {
  font-size: 15px;
  font-weight: 600;
}
.chat-header-sub {
  font-size: 13px;
  color: var(--c-text-muted);
}

.chat-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--c-text-muted);
  text-align: center;
}
.empty-icon {
  font-size: 48px !important;
  margin-bottom: 16px;
  color: #d1d5db;
}

.chat-messages-area {
  flex-grow: 1;
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.message-row {
  display: flex;
  width: 100%;
}

.message-row.user {
  justify-content: flex-start;
}

.message-row.assistant {
  justify-content: flex-end;
}

.message-bubble {
  max-width: 70%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
  position: relative;
}

.message-row.user .message-bubble {
  background-color: var(--c-bubble-user);
  color: var(--c-text-main);
  border-bottom-left-radius: 4px;
}

.message-row.assistant .message-bubble {
  background-color: var(--c-bubble-ai);
  color: #0c4a6e;
  border-bottom-right-radius: 4px;
}

.message-sender {
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 4px;
  opacity: 0.7;
}

.message-time {
  font-size: 10px;
  text-align: right;
  margin-top: 4px;
  opacity: 0.6;
}

.loading-state {
  padding: 24px;
  text-align: center;
  color: var(--c-text-muted);
}

.badge-status {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  background-color: #f3f4f6;
  color: #374151;
}
.badge-status.open {
  background-color: #dcfce7;
  color: #166534;
}
.badge-status.closed {
  background-color: #fee2e2;
  color: #991b1b;
}

.btn-ghost {
  background: none;
  border: none;
  color: var(--c-text-muted);
  cursor: pointer;
}
.btn-ghost:hover {
  color: var(--c-text-main);
}
