/* ── Ultron Theme ──────────────────────────────────────────────────────────── */
:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-tertiary: #1a1a2e;
  --bg-hover: #222238;
  --bg-active: #2a2a45;
  --bg-card: #16162a;
  --border: #2a2a40;
  --border-light: #333350;
  --text-primary: #e8e8f0;
  --text-secondary: #9898b0;
  --text-muted: #606080;
  --accent: #6c5ce7;
  --accent-light: #a29bfe;
  --accent-dark: #4834d4;
  --accent-glow: rgba(108, 92, 231, 0.3);
  --green: #00cec9;
  --green-bg: rgba(0, 206, 201, 0.1);
  --red: #ff6b6b;
  --red-bg: rgba(255, 107, 107, 0.1);
  --yellow: #feca57;
  --yellow-bg: rgba(254, 202, 87, 0.1);
  --blue: #54a0ff;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  --sidebar-width: 280px;
  --transition: 0.2s ease;
}

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

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

.hidden { display: none !important; }

/* ── Login ─────────────────────────────────────────────────────────────────── */
.login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  background: linear-gradient(135deg, #0a0a1a 0%, #1a1a3e 50%, #0a0a1a 100%);
}

.login-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 48px 40px;
  text-align: center;
  width: 380px;
  max-width: 90vw;
  box-shadow: var(--shadow), 0 0 80px var(--accent-glow);
}

.login-logo {
  font-size: 64px;
  margin-bottom: 8px;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.login-card h1 {
  font-size: 32px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent-light), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 4px;
}

.login-subtitle {
  color: var(--text-muted);
  margin-bottom: 32px;
  font-size: 14px;
}

#login-form input {
  width: 100%;
  padding: 14px 18px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 15px;
  outline: none;
  transition: border var(--transition);
  margin-bottom: 16px;
}

#login-form input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

#login-form button {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  border: none;
  border-radius: var(--radius-sm);
  color: white;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

#login-form button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px var(--accent-glow);
}

.login-error {
  color: var(--red);
  margin-top: 12px;
  font-size: 14px;
  min-height: 20px;
}

/* ── App Layout ────────────────────────────────────────────────────────────── */
.app {
  display: flex;
  height: 100vh;
}

/* ── Sidebar ───────────────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100vh;
  z-index: 100;
}

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

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

.logo-icon {
  font-size: 24px;
}

.logo-text {
  font-size: 20px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent-light), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.btn-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}

.btn-icon:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--accent);
}

/* Nav */
.sidebar-nav {
  display: flex;
  gap: 4px;
  padding: 12px 12px 8px;
}

.nav-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 4px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-xs);
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  transition: all var(--transition);
}

.nav-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.nav-btn.active {
  background: var(--accent-glow);
  border-color: var(--accent);
  color: var(--accent-light);
}

/* Chat list */
.chat-list-container {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.search-box {
  padding: 8px 12px;
}

.search-box input {
  width: 100%;
  padding: 8px 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
  transition: border var(--transition);
}

.search-box input:focus { border-color: var(--accent); }

.chat-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 8px;
}

.chat-item {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all var(--transition);
  margin-bottom: 2px;
  gap: 8px;
}

.chat-item:hover { background: var(--bg-hover); }
.chat-item.active { background: var(--accent-glow); border: 1px solid var(--accent); }

.chat-item-title {
  flex: 1;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-item-time {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

.chat-item-delete {
  opacity: 0;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 4px;
  font-size: 16px;
  transition: all var(--transition);
}

.chat-item:hover .chat-item-delete { opacity: 1; }
.chat-item-delete:hover { color: var(--red); }

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

.btn-text {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  transition: color var(--transition);
}

.btn-text:hover { color: var(--red); }

/* ── Mobile sidebar toggle ─────────────────────────────────────────────────── */
.sidebar-toggle {
  display: none;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 200;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text-primary);
  cursor: pointer;
}

/* ── Main Content ──────────────────────────────────────────────────────────── */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

.page {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.page.hidden { display: none; }

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.page-header h2 {
  font-size: 20px;
  font-weight: 600;
}

.btn-secondary {
  padding: 8px 16px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text-primary);
  font-size: 13px;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-secondary:hover { background: var(--bg-hover); border-color: var(--accent); }

/* ── Chat ──────────────────────────────────────────────────────────────────── */
.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
  min-height: 56px;
}

.chat-header h2 {
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-badge {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 20px;
  background: var(--green-bg);
  color: var(--green);
  display: none;
}

.status-badge.active {
  display: inline-block;
  animation: statusPulse 1.5s ease-in-out infinite;
}

@keyframes statusPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Messages */
.messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  scroll-behavior: smooth;
}

.welcome-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  color: var(--text-secondary);
}

.welcome-icon {
  font-size: 72px;
  margin-bottom: 16px;
  animation: pulse 2s ease-in-out infinite;
}

.welcome-screen h2 {
  font-size: 24px;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.welcome-screen p {
  font-size: 15px;
  line-height: 1.6;
  max-width: 400px;
}

.quick-actions {
  display: flex;
  gap: 10px;
  margin-top: 24px;
  flex-wrap: wrap;
  justify-content: center;
}

.quick-btn {
  padding: 10px 16px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 13px;
  cursor: pointer;
  transition: all var(--transition);
}

.quick-btn:hover {
  background: var(--bg-hover);
  border-color: var(--accent);
  transform: translateY(-1px);
}

/* Message bubbles */
.message {
  margin-bottom: 20px;
  max-width: 85%;
  animation: fadeIn 0.3s ease;
}

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

.message.user {
  margin-left: auto;
}

.message-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

.message-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.message.user .message-avatar {
  background: var(--accent);
  color: white;
}

.message.assistant .message-avatar {
  background: var(--green);
  color: #0a0a0f;
}

.message-body {
  padding: 14px 18px;
  border-radius: var(--radius);
  line-height: 1.7;
  font-size: 14px;
}

.message.user .message-body {
  background: var(--accent);
  color: white;
  border-bottom-right-radius: 4px;
}

.message.assistant .message-body {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

/* Markdown in messages */
.message-body h1, .message-body h2, .message-body h3 {
  margin-top: 16px;
  margin-bottom: 8px;
}

.message-body h1 { font-size: 18px; }
.message-body h2 { font-size: 16px; }
.message-body h3 { font-size: 15px; }

.message-body p { margin-bottom: 10px; }
.message-body p:last-child { margin-bottom: 0; }

.message-body ul, .message-body ol {
  margin: 8px 0;
  padding-left: 20px;
}

.message-body li { margin-bottom: 4px; }

.message-body code {
  background: rgba(0, 0, 0, 0.3);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 13px;
}

.message-body pre {
  background: #0d1117;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 16px;
  overflow-x: auto;
  margin: 10px 0;
  position: relative;
}

.message-body pre code {
  background: transparent;
  padding: 0;
  font-size: 13px;
  line-height: 1.5;
}

.message-body pre .copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 4px 10px;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-muted);
  font-size: 11px;
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--transition);
}

.message-body pre:hover .copy-btn { opacity: 1; }
.message-body pre .copy-btn:hover { color: var(--text-primary); }

.message-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0;
  font-size: 13px;
}

.message-body th, .message-body td {
  padding: 8px 12px;
  border: 1px solid var(--border);
  text-align: left;
}

.message-body th {
  background: var(--bg-tertiary);
  font-weight: 600;
}

.message-body blockquote {
  border-left: 3px solid var(--accent);
  padding: 8px 16px;
  margin: 10px 0;
  color: var(--text-secondary);
  background: rgba(108, 92, 231, 0.05);
  border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
}

.message-body a {
  color: var(--accent-light);
  text-decoration: none;
}

.message-body a:hover { text-decoration: underline; }

/* Tool use display */
.tool-use {
  margin: 8px 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  overflow: hidden;
  font-size: 13px;
}

.tool-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg-tertiary);
  cursor: pointer;
  user-select: none;
}

.tool-header .tool-icon {
  font-size: 14px;
}

.tool-header .tool-name {
  font-weight: 600;
  color: var(--accent-light);
}

.tool-header .tool-toggle {
  margin-left: auto;
  color: var(--text-muted);
  font-size: 12px;
}

.tool-body {
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.2);
  max-height: 300px;
  overflow: auto;
  display: none;
}

.tool-body.open { display: block; }

.tool-body pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-all;
  font-size: 12px;
  color: var(--text-secondary);
  font-family: 'SF Mono', 'Fira Code', monospace;
}

.tool-result-badge {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--green-bg);
  color: var(--green);
  margin-left: auto;
}

/* Thinking indicator */
.thinking-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  color: var(--text-muted);
  font-size: 13px;
}

.thinking-dots {
  display: flex;
  gap: 4px;
}

.thinking-dots span {
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  animation: bounce 1.4s ease-in-out infinite;
}

.thinking-dots span:nth-child(2) { animation-delay: 0.2s; }
.thinking-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

/* Chat input */
.chat-input-area {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: var(--bg-secondary);
}

.input-container { max-width: 100%; }

.input-wrapper {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 12px;
  transition: border var(--transition);
}

.input-wrapper:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.attach-btn {
  border: none !important;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

#user-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.5;
  resize: none;
  outline: none;
  max-height: 150px;
  min-height: 24px;
  font-family: inherit;
}

#user-input::placeholder { color: var(--text-muted); }

.btn-send, .btn-stop {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all var(--transition);
  flex-shrink: 0;
}

.btn-send {
  background: var(--accent);
  color: white;
}

.btn-send:hover { background: var(--accent-dark); }
.btn-send:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-stop {
  background: var(--red);
  color: white;
}

.btn-stop:hover { background: #ee5a5a; }

.btn-queue {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all var(--transition);
  flex-shrink: 0;
  background: var(--green);
  color: white;
}

.btn-queue:hover { background: #00b3ae; }

/* Task Queue */
.task-queue {
  margin-top: 8px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.task-queue-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  font-size: 12px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}

.btn-text-small {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 11px;
  cursor: pointer;
  transition: color var(--transition);
}

.btn-text-small:hover { color: var(--red); }

.queue-list {
  max-height: 150px;
  overflow-y: auto;
}

.queue-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  font-size: 13px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  animation: fadeIn 0.2s ease;
}

.queue-item:last-child { border-bottom: none; }

.queue-item-num {
  color: var(--accent-light);
  font-weight: 600;
  font-size: 11px;
  min-width: 20px;
}

.queue-item-text {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-secondary);
}

.queue-item-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  padding: 0 4px;
  opacity: 0;
  transition: all var(--transition);
}

.queue-item:hover .queue-item-remove { opacity: 1; }
.queue-item-remove:hover { color: var(--red); }

.queue-item.active {
  background: var(--accent-glow);
}

.queue-item.active .queue-item-text {
  color: var(--accent-light);
}

.queue-item.done .queue-item-text {
  color: var(--text-muted);
  text-decoration: line-through;
}

/* ── Dashboard ─────────────────────────────────────────────────────────────── */
#page-dashboard {
  overflow-y: auto;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  padding: 20px 24px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all var(--transition);
}

.stat-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.stat-icon {
  font-size: 32px;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
}

.stat-icon.cpu { background: rgba(108, 92, 231, 0.15); }
.stat-icon.memory { background: rgba(0, 206, 201, 0.15); }
.stat-icon.disk { background: rgba(254, 202, 87, 0.15); }
.stat-icon.uptime { background: rgba(84, 160, 255, 0.15); }

.stat-info { flex: 1; }
.stat-label { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.5px; }
.stat-value { font-size: 22px; font-weight: 700; }
.stat-detail { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }

.section {
  padding: 0 24px 24px;
}

.section h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-secondary);
}

.github-repos {
  display: grid;
  gap: 10px;
}

.repo-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  transition: all var(--transition);
}

.repo-card:hover { border-color: var(--accent); }

.repo-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--accent-light);
  margin-bottom: 4px;
}

.repo-info {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.recent-chats {
  display: grid;
  gap: 8px;
}

.recent-chat-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
}

.recent-chat-item:hover { border-color: var(--accent); background: var(--bg-hover); }

.recent-chat-title {
  flex: 1;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recent-chat-date {
  font-size: 11px;
  color: var(--text-muted);
}

/* ── File Browser ──────────────────────────────────────────────────────────── */
#page-files {
  overflow-y: auto;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px 24px;
  font-size: 13px;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.breadcrumb-item {
  cursor: pointer;
  color: var(--accent-light);
  transition: color var(--transition);
}

.breadcrumb-item:hover { color: var(--accent); text-decoration: underline; }

.breadcrumb-sep {
  color: var(--text-muted);
  margin: 0 2px;
}

.file-list {
  padding: 0 24px 24px;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all var(--transition);
  border-bottom: 1px solid var(--border);
}

.file-item:hover { background: var(--bg-hover); }

.file-icon {
  font-size: 20px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  border-radius: var(--radius-xs);
}

.file-name {
  flex: 1;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-size {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

.file-date {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

.file-actions-row {
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity var(--transition);
}

.file-item:hover .file-actions-row { opacity: 1; }

.file-action-btn {
  padding: 4px 8px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-secondary);
  font-size: 11px;
  cursor: pointer;
  transition: all var(--transition);
}

.file-action-btn:hover { background: var(--accent); color: white; border-color: var(--accent); }

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.modal-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-width: 80vw;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
}

.file-preview-content {
  width: 800px;
}

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

.modal-header h3 {
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
  padding: 0 4px;
}

.modal-close:hover { color: var(--text-primary); }

.preview-code {
  flex: 1;
  overflow: auto;
  padding: 16px 20px;
  margin: 0;
  background: #0d1117;
  font-size: 13px;
  line-height: 1.5;
}

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

/* ── Scrollbar ─────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── Mobile ────────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: -100%;
    top: 0;
    height: 100vh;
    transition: left 0.3s ease;
    box-shadow: var(--shadow);
  }

  .sidebar.open { left: 0; }
  .sidebar-toggle { display: flex; }

  .main-content { padding-top: 0; }

  .chat-header { padding-left: 56px; }

  .message { max-width: 95%; }

  .dashboard-grid { grid-template-columns: 1fr 1fr; gap: 10px; padding: 16px; }

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

  .file-size, .file-date { display: none; }
}

@media (max-width: 480px) {
  .dashboard-grid { grid-template-columns: 1fr; }
}
