/* ═══════════════════════════════════════════════════
   TMR Design System — Light Theme
   ═══════════════════════════════════════════════════ */

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

:root {
  --bg: #ffffff;
  --bg2: #f8f8fa;
  --bg3: #f0f0f4;
  --bg4: #e8e8ee;
  --border: #e2e2ea;
  --text: #1a1a2e;
  --text2: #5c5c74;
  --text3: #9898b0;
  --accent: #7c5cfc;
  --accent2: #9474ff;
  --accent-light: rgba(124, 92, 252, 0.08);
  --green: #16a34a;
  --yellow: #d97706;
  --blue: #2563eb;
  --red: #dc2626;
  --orange: #ea580c;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  height: 100vh;
  overflow: hidden;
}

/* ═══ Layout ═══ */

.app { display: flex; height: 100vh; }

/* ═══ Sidebar ═══ */

.sidebar {
  width: 260px;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.sidebar-head {
  padding: 20px 16px;
  border-bottom: 1px solid var(--border);
}

.logo { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }

.logo-mark {
  width: 32px; height: 32px;
  background: var(--accent);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; color: white;
}

.logo span { font-size: 17px; font-weight: 600; color: var(--text); }

.new-btn {
  width: 100%;
  padding: 9px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}
.new-btn:hover { background: var(--accent2); }

.sidebar-tasks {
  flex: 1;
  overflow-y: auto;
}

.section { padding: 14px 10px 6px; }

.section-label {
  font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.8px; color: var(--text3); padding: 0 8px; margin-bottom: 6px;
}

.item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 7px; cursor: pointer;
  transition: background 0.15s;
}
.item:hover { background: var(--bg3); }
.item.active { background: var(--accent-light); }

.dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.dot.on { background: var(--green); box-shadow: 0 0 6px rgba(22, 163, 74, 0.5); }
.dot.wait { background: var(--yellow); box-shadow: 0 0 6px rgba(217, 119, 6, 0.5); }
.dot.off { background: var(--text3); }

.item-text { flex: 1; min-width: 0; }
.item-name {
  font-size: 13px; font-weight: 500; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.item-sub { font-size: 11px; color: var(--text3); margin-top: 1px; }

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
}

.sidebar-footer button {
  width: 100%;
  padding: 8px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: 12px;
  color: var(--text3);
  cursor: pointer;
  transition: all 0.15s;
}
.sidebar-footer button:hover {
  background: var(--bg3);
  color: var(--text2);
}

/* ═══ Main Area ═══ */

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

.topbar {
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
  font-size: 14px; font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text);
  background: var(--bg);
}

.topbar-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ═══ Chat Area ═══ */

.chat {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* ═══ Input Area ═══ */

.input-area {
  padding: 14px 24px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.input-wrap {
  max-width: 700px;
  margin: 0 auto;
  position: relative;
}

.input {
  width: 100%;
  padding: 12px 48px 12px 16px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}

.input::placeholder { color: var(--text3); }
.input:focus { border-color: var(--accent); }

.send {
  position: absolute;
  right: 6px; top: 50%; transform: translateY(-50%);
  width: 34px; height: 34px;
  border-radius: 7px;
  background: var(--accent);
  border: none; color: white;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 15px;
  transition: background 0.15s;
}
.send:hover { background: var(--accent2); }
.send:disabled { opacity: 0.5; cursor: not-allowed; }

/* ═══ Scrollbar ═══ */

.chat::-webkit-scrollbar { width: 6px; }
.chat::-webkit-scrollbar-track { background: transparent; }
.chat::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.chat::-webkit-scrollbar-thumb:hover { background: var(--text3); }
