:root {
  --bg: #07111f;
  --bg2: #0e1a2d;
  --panel: rgba(10, 18, 34, 0.86);
  --panel-strong: rgba(12, 22, 40, 0.96);
  --line: rgba(148, 163, 184, 0.16);
  --line-strong: rgba(148, 163, 184, 0.28);
  --text: #e8eefc;
  --muted: #9fb0cd;
  --primary: #7c3aed;
  --primary2: #06b6d4;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.28);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  color: var(--text);
  font-family: Inter, Arial, Helvetica, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(124, 58, 237, 0.18), transparent 28%),
    radial-gradient(circle at bottom right, rgba(6, 182, 212, 0.18), transparent 30%),
    linear-gradient(135deg, var(--bg), var(--bg2));
}
body { min-height: 100vh; }
a { color: inherit; }
input, textarea, select, button { font: inherit; }
.bg {
  position: fixed;
  z-index: 0;
  border-radius: 999px;
  filter: blur(90px);
  opacity: .28;
  pointer-events: none;
}
.bg1 { width: 360px; height: 360px; background: #6d28d9; top: -120px; left: -90px; }
.bg2 { width: 420px; height: 420px; background: #0891b2; right: -120px; top: 25%; }
.bg3 { width: 320px; height: 320px; background: #2563eb; bottom: -100px; left: 25%; }
.app-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  min-height: 100vh;
}
.panel-surface,
.task-card,
.login-card {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}
.sidebar {
  padding: 24px;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: rgba(5, 11, 22, 0.78);
  backdrop-filter: blur(24px);
}
.main {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}
.logo, .login-logo {
  width: 54px;
  height: 54px;
  filter: drop-shadow(0 12px 24px rgba(124, 58, 237, 0.32));
}
.brand-name { font-size: 20px; font-weight: 800; }
.brand-sub, .user-meta, .section-sub, .topbar-sub, .task-submeta, .row-meta, .entry-time, .quick-head { color: var(--muted); }
.user-card, .stats-card, .side-controls, .quick-info, .topbar, .composer, .panel { border-radius: var(--radius-xl); }
.user-card {
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.avatar, .entry-avatar {
  width: 46px;
  height: 46px;
  border-radius: 999px;
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.22);
}
.stats-card { padding: 16px; }
.stat-line {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  color: var(--muted);
}
.stat-line strong { color: var(--text); }
.side-controls, .quick-info { padding: 16px; display: grid; gap: 12px; }
.side-bottom { margin-top: auto; }
.live-row { display: flex; align-items: center; gap: 10px; }
.live-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #34d399;
  box-shadow: 0 0 0 8px rgba(52, 211, 153, 0.12);
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px 22px;
}
.topbar h1 { margin: 0; font-size: 34px; letter-spacing: -.03em; }
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.revision-meta {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
}
.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(380px, 460px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.composer, .panel { padding: 20px; }
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}
.section-head.compact { margin-bottom: 12px; }
.section-head h2, .stream-head h2 { margin: 0; }
.pill {
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  background: linear-gradient(135deg, #22c55e, #10b981);
  color: #062814;
}
.pill.subtle {
  background: rgba(255,255,255,0.08);
  color: var(--text);
}
.stack { display: grid; gap: 14px; }
.grid.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid.four-col { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
label { display: block; font-size: 13px; font-weight: 700; }
label input, label textarea, label select { margin-top: 8px; }
.field-label { font-size: 12px; color: var(--muted); }
input, textarea, select {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  outline: none;
  background: rgba(255,255,255,0.05);
  color: var(--text);
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
input:focus, textarea:focus, select:focus {
  border-color: rgba(96, 165, 250, 0.56);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
  background: rgba(255,255,255,0.08);
}
textarea { min-height: 110px; resize: vertical; }
input::placeholder, textarea::placeholder { color: #7988a3; }
.dropzone {
  position: relative;
  padding: 24px;
  border-radius: 20px;
  border: 1.5px dashed rgba(129, 140, 248, 0.5);
  background: rgba(124, 58, 237, 0.08);
  text-align: center;
  overflow: hidden;
  transition: transform .2s ease, border-color .2s ease, background .2s ease;
}
.dropzone.dragover {
  transform: translateY(-2px);
  border-color: #c4b5fd;
  background: rgba(124, 58, 237, 0.14);
}
.dropzone input[type=file] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.dropzone-copy { display: grid; gap: 6px; }
.dropzone-copy span { color: var(--muted); font-size: 13px; }
.form-actions, .task-actions, .reply-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.btn {
  border: 0;
  border-radius: 16px;
  padding: 13px 16px;
  cursor: pointer;
  font-weight: 800;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 14px 28px rgba(0,0,0,.22); }
.btn.primary { background: linear-gradient(135deg, var(--primary), var(--primary2)); color: #fff; }
.btn.soft { background: rgba(255,255,255,0.08); color: var(--text); }
.btn.danger { background: rgba(239,68,68,0.12); color: #fecaca; }
.btn.wide { width: 100%; }
.btn.sm { padding: 10px 12px; border-radius: 12px; font-size: 13px; }
.message, .upload-box {
  padding: 14px 16px;
  border-radius: 18px;
  font-size: 14px;
}
.message.success, .upload-box.success { background: rgba(34,197,94,.12); color: #bbf7d0; border: 1px solid rgba(34,197,94,.24); }
.message.error { background: rgba(239,68,68,.12); color: #fecaca; border: 1px solid rgba(239,68,68,.22); }
.upload-box.info { background: rgba(59,130,246,.12); color: #bfdbfe; border: 1px solid rgba(59,130,246,.22); }
.hidden { display: none !important; }
.show { display: block; }
.progress {
  margin: 10px 0 6px;
  height: 10px;
  background: rgba(255,255,255,.08);
  border-radius: 999px;
  overflow: hidden;
}
.progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary2));
}
.category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.category-tab {
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.05);
  color: var(--text);
  padding: 12px 14px;
  border-radius: 16px;
  cursor: pointer;
  display: inline-flex;
  gap: 8px;
  align-items: center;
  font-weight: 700;
}
.category-tab span {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  color: var(--muted);
  padding: 0 8px;
  font-size: 12px;
}
.category-tab.active {
  border-color: rgba(96, 165, 250, 0.34);
  background: linear-gradient(135deg, rgba(124,58,237,0.32), rgba(6,182,212,0.24));
}
.stream-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}
.task-stream { display: grid; gap: 16px; }
.task-card {
  border-radius: var(--radius-xl);
  padding: 18px;
  border: 1px solid var(--line);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.task-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 28px 60px rgba(0,0,0,0.32);
}
.task-unread {
  border-color: rgba(96, 165, 250, 0.34);
  box-shadow: 0 22px 60px rgba(37, 99, 235, 0.12);
}
.task-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 14px;
}
.meta-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.badge, .new-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}
.badge.pending { background: rgba(245,158,11,.16); color: #fcd34d; }
.badge.progress { background: rgba(59,130,246,.16); color: #bfdbfe; }
.badge.done { background: rgba(34,197,94,.16); color: #bbf7d0; }
.badge.priority.high { background: rgba(239,68,68,.15); color: #fecaca; }
.badge.priority.medium { background: rgba(139,92,246,.16); color: #ddd6fe; }
.badge.priority.low { background: rgba(16,185,129,.14); color: #bbf7d0; }
.badge.neutral { background: rgba(255,255,255,.08); color: #dbe6ff; }
.new-badge {
  background: linear-gradient(135deg, #ef4444, #f97316);
  color: #fff;
  letter-spacing: .03em;
}
.category-badge { text-transform: capitalize; }
.task-header h3 { margin: 10px 0 0; font-size: 24px; letter-spacing: -.02em; }
.thread { display: grid; gap: 12px; margin: 14px 0; }
.entry {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 12px;
}
.entry-body {
  background: rgba(255,255,255,.04);
  border: 1px solid var(--line);
  padding: 14px;
  border-radius: 18px;
}
.entry-new .entry-body { border-color: rgba(96,165,250,.3); }
.entry-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.entry-user { font-weight: 800; }
.entry-meta-right {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.entry-message {
  white-space: pre-wrap;
  line-height: 1.55;
}
.entry-file {
  display: inline-flex;
  margin-top: 10px;
  text-decoration: none;
  color: #bfdbfe;
  font-weight: 700;
  word-break: break-all;
}
.reply-box {
  display: grid;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}
.reply-box textarea { min-height: 84px; }
.users-list { display: grid; gap: 12px; margin-top: 16px; }
.user-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,.04);
}
.user-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.user-dot {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  display: inline-block;
}
.row-name { font-weight: 700; }
.empty-state {
  border-radius: var(--radius-xl);
  padding: 34px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line-strong);
  background: rgba(255,255,255,0.04);
}
.empty-state.small { padding: 18px; }
.toast-stack {
  position: fixed;
  top: 18px;
  right: 18px;
  display: grid;
  gap: 10px;
  z-index: 1000;
}
.toast {
  min-width: 280px;
  max-width: 360px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(96,165,250,.28);
  background: rgba(10, 20, 37, 0.96);
  box-shadow: 0 18px 40px rgba(0,0,0,0.32);
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity .2s ease, transform .2s ease;
}
.toast.visible {
  opacity: 1;
  transform: translateY(0);
}
.toast strong { display: block; margin-bottom: 4px; }
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  overflow: hidden;
  position: relative;
}
.login-glow {
  position: absolute;
  border-radius: 999px;
  filter: blur(80px);
  opacity: .26;
}
.login-glow-a { width: 360px; height: 360px; background: #7c3aed; top: -100px; left: -120px; }
.login-glow-b { width: 420px; height: 420px; background: #0891b2; bottom: -120px; right: -140px; }
.login-shell { position: relative; z-index: 1; display: grid; gap: 18px; justify-items: center; padding: 24px; }
.login-brand { text-align: center; }
.login-brand h1 { margin: 10px 0 0; }
.login-brand p { margin: 6px 0 0; color: var(--muted); }
.login-card {
  width: min(460px, 92vw);
  display: grid;
  gap: 14px;
  padding: 24px;
  border-radius: var(--radius-xl);
}
.login-card h2 { margin: 0; }
@media (max-width: 1280px) {
  .dashboard-grid { grid-template-columns: 1fr; }
}
@media (max-width: 1060px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--line); }
}
@media (max-width: 820px) {
  .main, .sidebar { padding: 16px; }
  .grid.four-col, .grid.two-col { grid-template-columns: 1fr 1fr; }
  .topbar, .task-header { flex-direction: column; align-items: stretch; }
}
@media (max-width: 640px) {
  .grid.four-col, .grid.two-col { grid-template-columns: 1fr; }
  .category-tabs { display: grid; grid-template-columns: 1fr; }
  .task-actions, .form-actions, .reply-actions, .topbar-actions { width: 100%; }
  .btn.wide, .btn { width: 100%; }
  .entry { grid-template-columns: 1fr; }
  .entry-avatar { width: 38px; height: 38px; }
  .toast-stack { left: 16px; right: 16px; }
  .toast { min-width: auto; max-width: none; }
}
