@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&display=swap");

:root {
  color-scheme: dark;
  --bg: #0a0e14;
  --panel: #12181f;
  --panel2: #0d1117;
  --border: rgba(255,255,255,0.08);
  --border-hover: rgba(255,255,255,0.15);
  --text: rgba(255,255,255,0.95);
  --muted: rgba(255,255,255,0.55);
  --accent: #3b82f6;
  --accent-hover: #60a5fa;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Space Grotesk", ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  border-bottom: 1px solid var(--border);
  background: rgba(12, 16, 22, 0.85);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
  gap: 16px;
}

.brand { 
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1;
}

/* Brand should read as a title, not a control. */
body:not(.atlas-core-embedded) .brand {
  color: rgba(219, 234, 254, 0.95); /* light accent tint */
}

/* Make the app title read as a title (not a button). */
body:not(.atlas-core-embedded) .brand::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  box-shadow: 0 0 0 3px rgba(59,130,246,0.12);
  flex: 0 0 auto;
}

.brand .brand-text {
  font: inherit;
  letter-spacing: inherit;
}

.topbar .right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.wrap { padding: 18px; max-width: 1200px; margin: 0 auto; }
/* Some views (Mail) need more horizontal space */
.wrap.wide { max-width: none; }

/* Mail tab: render mail UI in an iframe (shared with embedded mail). */
body.view-mail main.wrap {
  height: calc(100vh - 80px);
}

body.view-mail #mailView {
  height: 100%;
}

.mailTabWrap {
  height: 100%;
}

.mailFrame {
  display: block;
  width: 100%;
  height: 100%;
  /* Use a smaller min-height so it doesn't force overflow on small screens */
  min-height: 100px; 
  border: 0;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
}

.hidden { display: none !important; }

h1, h2, h3 { margin: 0 0 10px; }
.muted { color: var(--muted); }

.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}
@media (max-width: 720px) { .grid2 { grid-template-columns: 1fr; } }

label { display: block; margin: 10px 0 6px; color: var(--muted); font-size: 13px; }
input, textarea, select {
  width: 100%;
  padding: 10px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel2);
  color: var(--text);
  outline: none;
}

.row { display: flex; gap: 10px; align-items: center; margin-top: 12px; }
.space { justify-content: space-between; align-items: flex-end; }

.btn {
  padding: 2px 30px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s ease;
}
.btn:hover { 
  background: rgba(255,255,255,0.1); 
  border-color: var(--border-hover);
}
.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}
.btn.primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}
.btn.subtle { 
  background: transparent; 
  border-color: transparent;
  color: var(--muted);
}
.btn.subtle:hover {
  background: rgba(255,255,255,0.06);
  color: var(--text);
}

.select { min-width: 220px; }

.msg { margin-top: 10px; color: var(--muted); font-size: 13px; min-height: 18px; }

/* Files (Drive-like) */
.filesLayout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 12px;
  align-items: start;
  margin-top: 12px;
}

@media (max-width: 900px) {
  .filesLayout {
    grid-template-columns: 1fr;
  }
}

.filesSidebar {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
}

.filesNav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.filesNavItem {
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
}

.filesNavItem:hover {
  background: rgba(255,255,255,0.06);
  border-color: var(--border);
}

.filesNavItem.active {
  background: rgba(255,255,255,0.10);
  border-color: var(--border);
}

.filesFolderRow {
  display: flex;
  align-items: center;
  gap: 6px;
}

.filesFolderToggle {
  width: 22px;
  height: 22px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.filesFolderToggle:hover {
  background: rgba(255,255,255,0.06);
  border-color: var(--border);
  color: var(--text);
}

.filesFolderToggleSpacer {
  width: 22px;
  flex: 0 0 auto;
}

.filesFolderNameBtn {
  flex: 1;
}

.filesMain {
  min-width: 0;
}

.filePreviewCard {
  width: min(900px, 100%);
  height: min(82vh, 900px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.filePreviewBody {
  flex: 1;
  min-height: 0;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel2);
  padding: 12px;
}

.filePreviewBody iframe {
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 10px;
  background: transparent;
}

.filePreviewBody img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
  border-radius: 10px;
}

.filePreviewBody video {
  width: 100%;
  max-height: 100%;
  border-radius: 10px;
  background: #000;
}

.filePreviewBody audio {
  width: 100%;
}

.audioPreviewWrap {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 120px;
}

.filePreviewText {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
}

.uploadProgress {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
}

.uploadProgressRow {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.uploadProgressBar {
  height: 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  overflow: hidden;
}

.uploadProgressFill {
  height: 100%;
  width: 0%;
  background: var(--accent);
}

/* Google Sign-In styles */
.authCard {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 32px;
  max-width: 400px;
  margin: 60px auto;
  text-align: center;
}

.authCard h1 {
  margin-bottom: 8px;
}

.authLogo {
  font-size: 48px;
  margin-bottom: 16px;
}

.authFooter {
  margin-top: 24px;
  font-size: 12px;
}

/* Login Form styles */
.authForm {
  margin: 24px 0 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.authForm .input {
  padding: 12px 14px;
  font-size: 14px;
  text-align: left;
}

.authForm .btn.primary.full {
  width: 100%;
  padding: 12px;
  font-size: 14px;
  font-weight: 600;
}

.board {
  display: grid;
  gap: 16px;
  margin-top: 20px;
  padding-bottom: 16px;
  align-items: start;

  /* Default (non-small screens): fit columns into the available width
     so users don't need horizontal scrolling to see the board. */
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  overflow-x: hidden;
}

/* Small screens: allow horizontal scrolling instead of squeezing/wrapping too much */
@media (max-width: 900px) {
  .board {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: 320px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

.column {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  min-width: 0;
  min-height: 400px;
}

.columnHeader {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.columnTitle { 
  font-weight: 600; 
  font-size: 14px;
  color: var(--text);
}

.columnHeader .cardMeta {
  background: rgba(255,255,255,0.08);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
}

.dropzone {
  min-height: 300px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cardItem {
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  cursor: grab;
  transition: all 0.15s ease;
}

.cardItem:hover {
  border-color: var(--border-hover);
  background: rgba(255,255,255,0.04);
}

.cardItem:active { cursor: grabbing; }

.cardItem.dragging {
  opacity: 0.5;
  transform: scale(0.95);
  border-color: var(--accent);
  box-shadow: 0 10px 25px rgba(59, 130, 246, 0.3);
}

.cardTitle { font-weight: 500; font-size: 14px; margin-bottom: 6px; }
.cardMeta { color: var(--muted); font-size: 11px; }

.presence {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
}

.pill {
  font-size: 11px;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.03);
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: grid;
  place-items: center;
  padding: 18px;
}
.modalCard {
  width: min(700px, 100%);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
}

.modalCard.cardModalCard {
  height: min(82vh, 900px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#cardModalView,
#cardModalEdit {
  overflow: auto;
  min-height: 0;
  padding-right: 6px;
}

.cardViewDesc {
  margin-top: 12px;
}
.modalCard.small {
  width: min(400px, 100%);
}

/* Navigation tabs */
.mainNav {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  flex: 1 1 auto;
  justify-content: center;
  align-items: center;
}

.navGroup {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  padding: 4px;
  border-radius: 12px;
}

.navGroupLabel {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(147, 197, 253, 0.78); /* distinct from muted tab text */
  padding: 0 8px;
  border-right: 1px solid var(--border);
  user-select: none;
}

.navGroupTabs {
  display: flex;
  gap: 4px;
}

.navMenu {
  position: relative;
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  padding: 4px;
  border-radius: 12px;
}

.navMenuBtn {
  padding: 7px 14px;
  border-radius: 7px;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.navMenuBtn:hover {
  background: rgba(255,255,255,0.06);
  color: var(--text);
}

.navMenuBtn.active {
  background: rgba(255,255,255,0.1);
  color: var(--text);
}

.navMenuDropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(320px, calc(100vw - 24px));
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px;
  box-shadow: 0 18px 40px rgba(0,0,0,0.45);
  z-index: 200;
}

.navMenuSectionLabel {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(147, 197, 253, 0.78);
  padding: 6px 8px;
}

/* Admin section title should read as a warning/privileged area */
.navMenuSection.adminOnly .navMenuSectionLabel {
  color: rgba(248, 113, 113, 0.92);
}

.navMenuItem.navTab {
  width: 100%;
  text-align: left;
  padding: 10px 10px;
  border-radius: 10px;
}

.navMenuDivider {
  height: 1px;
  background: var(--border);
  margin: 8px 6px;
}

@media (max-width: 980px) {
  .topbar {
    flex-wrap: wrap;
  }

  .mainNav {
    order: 3;
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 620px) {
  .navGroupLabel {
    display: none;
  }

  .navMenuDropdown {
    left: 0;
    right: 0;
    margin: 0 auto;
  }
}

.navTab {
  padding: 7px 14px;
  border-radius: 7px;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 500;
  font-size: 13px;
  transition: all 0.15s;
}
.navTab:hover {
  background: rgba(255,255,255,0.06);
  color: var(--text);
}
.navTab.active {
  background: rgba(255,255,255,0.1);
  color: var(--text);
}

.navBadge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  font-size: 11px;
  font-weight: 600;
  background: #ef4444;
  color: white;
  border-radius: 9px;
  margin-left: 6px;
}

/* Wiki layout */
.wikiLayout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 16px;
  min-height: calc(100vh - 140px);
}
@media (max-width: 800px) {
  .wikiLayout {
    grid-template-columns: 1fr;
  }
  .wikiSidebar {
    max-height: 300px;
    overflow-y: auto;
  }
}

.wikiSidebar {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
}
.sidebarHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.sidebarHeader h3 {
  margin: 0;
  font-size: 14px;
}

.btn.small {
  padding: 6px 8px;
  font-size: 12px;
}

/* Folder tree */
.folderTree {
  font-size: 14px;
}
.folderItem, .docItem {
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.15s;
}
.folderItem:hover, .docItem:hover {
  background: rgba(255,255,255,0.06);
}
.docItem.active {
  background: rgba(255,255,255,0.1);
}
.folderItem {
  font-weight: 600;
}
.folderItem .folderName {
  flex: 1;
}
.folderItem .addDocToFolder {
  opacity: 0;
  padding: 2px 8px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.08);
  color: var(--text);
  cursor: pointer;
  transition: opacity 0.15s, background 0.15s;
}
.folderItem:hover .addDocToFolder {
  opacity: 1;
}
.folderItem .addDocToFolder:hover {
  background: rgba(255,255,255,0.15);
}
.folderItem .folderIcon {
  transition: transform 0.15s;
}
.folderItem.open .folderIcon {
  transform: rotate(90deg);
}
.folderChildren {
  margin-left: 16px;
  display: none;
}
.folderItem.open + .folderChildren {
  display: block;
}
.rootDocs {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

/* Wiki main area */
.wikiMain {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  min-height: 400px;
}

.wikiEmpty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 300px;
  text-align: center;
}
.emptyIcon {
  font-size: 48px;
  margin-bottom: 12px;
}

/* Doc viewer */
.docHeader {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.docHeader h2 {
  margin: 0 0 4px;
}
.docMeta {
  font-size: 13px;
}

.docContent {
  line-height: 1.7;
  min-height: 200px;
  padding: 0 24px;
}

.btn.danger {
  color: #f87171;
}
.btn.danger:hover {
  background: rgba(248, 113, 113, 0.15);
}

/* Markdown rendered content */
.markdown-body h1, .markdown-body h2, .markdown-body h3, .markdown-body h4 {
  margin-top: 1.2em;
  margin-bottom: 0.5em;
  font-weight: 600;
}
.markdown-body h1 { font-size: 1.8em; }
.markdown-body h2 { font-size: 1.5em; }
.markdown-body h3 { font-size: 1.25em; }
.markdown-body p { margin: 0.8em 0; }
.markdown-body ul, .markdown-body ol {
  margin: 0.8em 0;
  padding-left: 1.5em;
}
.markdown-body li { margin: 0.3em 0; }
.markdown-body code {
  background: rgba(255,255,255,0.08);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: ui-monospace, monospace;
  font-size: 0.9em;
}
.markdown-body pre {
  background: rgba(0,0,0,0.3);
  padding: 12px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 1em 0;
}
.markdown-body pre code {
  background: none;
  padding: 0;
}
.markdown-body blockquote {
  border-left: 3px solid var(--border);
  margin: 1em 0;
  padding-left: 16px;
  color: var(--muted);
}
.markdown-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.5em 0;
}
.markdown-body a {
  color: #60a5fa;
}
.markdown-body strong { font-weight: 600; }
.markdown-body em { font-style: italic; }

/* Comments */
.commentsSection {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.commentsSection h4 {
  margin: 0 0 12px;
  font-size: 14px;
  color: var(--muted);
}
.commentsList {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}
.commentItem {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
}
.commentHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.commentAuthor {
  font-weight: 600;
  font-size: 13px;
}
.commentDate {
  font-size: 12px;
  color: var(--muted);
}
.commentBody {
  font-size: 14px;
  line-height: 1.5;
}
.commentDelete {
  font-size: 11px;
  color: var(--muted);
  cursor: pointer;
  margin-left: 8px;
}
.commentDelete:hover {
  color: #f87171;
}

/* Mobile navigation + PWA layout */
.mobileTabs {
  display: none;
}

.mobileTab {
  flex: 1 1 20%;
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 8px 6px;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.mobileTab.active {
  color: var(--text);
  transform: translateY(-1px) scale(1.03);
}

.mobileTab:active {
  transform: scale(0.97);
}

.tabBadge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  font-size: 10px;
  font-weight: 700;
  background: #ef4444;
  color: white;
  border-radius: 999px;
}

.mobileScrim {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 12, 0.6);
  backdrop-filter: blur(4px);
  z-index: 210;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
  will-change: opacity;
}

.mobileScrim.is-open {
  opacity: 1;
  pointer-events: auto;
}

.mobileSheet {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: auto;
  top: 50%;
  max-width: 400px;
  margin: 0 auto;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 16px;
  z-index: 220;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  opacity: 0;
  transform: translateY(-40%) scale(0.95);
  pointer-events: none;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease;
  will-change: transform, opacity;
  max-height: 70vh;
  overflow-y: auto;
}

.mobileSheet.is-open {
  opacity: 1;
  transform: translateY(-50%) scale(1);
  pointer-events: auto;
}

.mobileSheetHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.mobileSheetTitle {
  font-size: 14px;
  font-weight: 700;
}

.mobileSheetBody {
  display: grid;
  gap: 8px;
}

.mobileSheetItem {
  width: 100%;
  text-align: left;
  padding: 12px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  cursor: pointer;
  transition: background 0.18s ease, transform 0.18s ease, border-color 0.18s ease;
}

.mobileSheetItem:hover {
  background: rgba(255,255,255,0.08);
}

.mobileSheetItem:active {
  transform: scale(0.98);
  border-color: var(--border-hover);
}

@media (prefers-reduced-motion: reduce) {
  .mobileTab,
  .mobileScrim,
  .mobileSheet,
  .mobileSheetItem {
    transition: none;
  }

  .mobileSheet {
    transform: none;
  }
}

.mobileBoardPager {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 8px 0 12px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255,255,255,0.03);
}

.mobileBoardLabel {
  font-weight: 600;
  font-size: 13px;
}

.fab {
  position: fixed;
  right: 16px;
  bottom: 84px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--accent);
  color: white;
  font-size: 26px;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 16px 28px rgba(0,0,0,0.4);
  z-index: 180;
}

.fab:hover {
  background: var(--accent-hover);
}

.pushOnboarding {
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  border-radius: 14px;
  padding: 12px;
  margin: 12px 0 18px;
}

.pushOnboardingTitle {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 6px;
}

.pushOnboardingBody {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 10px;
}

.quickActionsList {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.quickActionMove {
  display: grid;
  gap: 8px;
}

@media (max-width: 768px) {
  body {
    padding-bottom: calc(88px + env(safe-area-inset-bottom));
    background: var(--bg);
  }

  body.mobile-sheet-open {
    overflow: hidden;
  }

  .topbar {
    padding: 10px 12px;
    gap: 12px;
    border-bottom: none;
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
  }

  .brand {
    font-size: 15px;
    gap: 7px;
    letter-spacing: -0.01em;
  }

  body:not(.atlas-core-embedded) .brand::before {
    width: 9px;
    height: 9px;
    border-radius: 3px;
    box-shadow: 0 0 0 2px rgba(59,130,246,0.15);
  }

  .topbar .right {
    gap: 8px;
  }

  #presence {
    display: none;
  }

  .projectSelectorBtn {
    padding: 7px 11px;
    font-size: 12px;
    border-radius: 10px;
    max-width: 180px;
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.1);
  }

  #currentProjectName {
    max-width: 120px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .projectSelectorBtn .dropdownArrow {
    font-size: 9px;
  }

  .headerBtn {
    width: 34px;
    height: 34px;
    font-size: 16px;
    border-radius: 11px;
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.08);
  }

  .headerAvatar {
    width: 34px;
    height: 34px;
    border-radius: 11px;
  }

  .badge {
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    font-size: 10px;
  }

  .mainNav {
    display: none;
  }

  #logoutBtn {
    display: none;
  }

  .wrap {
    padding: 0;
    max-width: 100vw;
  }

  main.wrap > section {
    padding: 12px;
    margin-bottom: 0;
  }

  .row {
    gap: 8px;
    margin-top: 8px;
  }

  /* Hide desktop board header on mobile - context moved to mobile pager */
  .boardHeader {
    display: none;
  }

  .mobileTabs {
    display: flex;
    justify-content: space-around;
    align-items: center;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 14, 20, 0.98);
    border-top: 1px solid rgba(255,255,255,0.06);
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    box-shadow: 0 -8px 24px rgba(0,0,0,0.4);
    backdrop-filter: blur(20px);
    z-index: 200;
  }

  .mobileTab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 56px;
    padding: 6px 2px;
    border-radius: 12px;
    transition: all 0.2s ease;
    gap: 4px;
    position: relative;
    border: none;
    background: transparent;
    color: rgba(255,255,255,0.5);
    cursor: pointer;
  }

  .tabIcon {
    transition: all 0.2s ease;
    stroke: currentColor;
  }

  .tabLabel {
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.02em;
  }

  .mobileTab.active {
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent);
  }

  .mobileTab.active .tabIcon {
    transform: translateY(-2px);
    stroke-width: 2.5px;
  }

  .mobileTab.active .tabLabel {
    font-weight: 600;
  }

  .tabBadge {
    position: absolute;
    top: 4px;
    left: 50%;
    margin-left: 6px;
    min-width: 16px;
    height: 16px;
    background: #ef4444;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid rgba(10, 14, 20, 0.98);
    z-index: 10;
  }

  #board {
    display: flex;
    gap: 0;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding: 0;
    margin: 0 -12px;
    scroll-padding: 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  #board::-webkit-scrollbar {
    display: none;
  }

  #board .column {
    flex: 0 0 100%;
    min-width: 100vw;
    scroll-snap-align: start;
    border: none;
    border-radius: 0;
    background: transparent;
    padding: 8px 12px 24px;
    min-height: calc(100vh - 200px);
  }

  .mobileBoardPager {
    display: flex;
    position: sticky;
    top: 56px;
    z-index: 120;
    margin: 0 0 8px;
    background: transparent;
    backdrop-filter: none;
    border-radius: 0;
    padding: 12px 0;
    border: none;
    justify-content: center;
    align-items: center;
  }

  .mobileBoardLabel {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--text);
    flex: 1;
    text-align: center;
  }

  #mobileBoardPrev,
  #mobileBoardNext {
    padding: 6px 10px;
    font-size: 12px;
    border-radius: 10px;
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.08);
  }

  .fab {
    display: none;
    bottom: 76px;
    right: 16px;
    width: 54px;
    height: 54px;
    border-radius: 16px;
    font-size: 26px;
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.4),
                0 4px 12px rgba(0, 0, 0, 0.5);
    border: none;
  }

  body.view-board .fab {
    display: inline-flex;
  }

  .fab:active {
    transform: scale(0.95);
  }

  .modal {
    align-items: stretch;
    padding: 0;
  }

  .modalCard.cardModalCard {
    width: 100%;
    height: 100%;
    border-radius: 0;
    border: none;
  }

  .columnHeader {
    display: none;
  }

  .cardItem {
    padding: 14px;
    border-radius: 14px;
    background: rgba(18, 24, 31, 0.8);
    border: 1px solid rgba(255,255,255,0.06);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  }

  .cardItem:active {
    transform: scale(0.98);
    background: rgba(18, 24, 31, 0.9);
  }

  .cardTitle {
    font-size: 14px;
    margin-bottom: 6px;
    font-weight: 500;
    line-height: 1.4;
  }

  .cardMeta {
    font-size: 11px;
    color: rgba(255,255,255,0.45);
  }

  .dropzone {
    gap: 12px;
    min-height: 0;
  }

  .btn,
  .btn.small,
  .btn.subtle {
    padding: 7px 12px;
    font-size: 12px;
    border-radius: 10px;
  }

  .select,
  input,
  textarea {
    border-radius: 12px;
    font-size: 14px;
  }

  h1 { font-size: 22px; font-weight: 700; }
  h2 { font-size: 18px; font-weight: 600; }
  h3 { font-size: 15px; font-weight: 600; }
  .muted { font-size: 12px; }

  .chatLayout {
    grid-template-columns: 1fr;
  }

  .chatSidebar {
    max-height: 220px;
    overflow-y: auto;
    background: transparent;
    border: none;
    padding: 0 0 16px;
  }

  .chatMain {
    background: transparent;
    border: none;
    padding: 0;
  }

  .chatEmpty {
    min-height: 240px;
  }

  .wikiLayout {
    grid-template-columns: 1fr;
  }

  .wikiMain {
    padding: 0;
    background: transparent;
    border: none;
  }

  .wikiSidebar,
  .filesSidebar {
    padding: 0 0 16px;
    background: transparent;
    border: none;
  }

  .wikiEmpty {
    min-height: 240px;
  }

  .filesLayout {
    grid-template-columns: 1fr;
  }

  .filesMain {
    background: transparent;
    border: none;
    padding: 0;
  }

  .authCard {
    margin: 40px 16px;
    padding: 24px;
  }

  /* Unified card/panel styling for mobile */
  .card,
  .wikiSidebar,
  .filesSidebar,
  .chatSidebar,
  .announcementCard,
  .teamMemberCard {
    background: rgba(18, 24, 31, 0.7) !important;
    border: 1px solid rgba(255,255,255,0.08) !important;
    border-radius: 14px !important;
    backdrop-filter: blur(10px);
  }

  /* Announcement and team cards should have consistent touch feedback */
  .announcementCard:active,
  .teamMemberCard:active {
    transform: scale(0.98);
    background: rgba(18, 24, 31, 0.8) !important;
  }

  /* Section headers */
  .sidebarHeader {
    padding: 0 0 12px;
    margin-bottom: 12px;
  }

  .sidebarHeader h3 {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(147, 197, 253, 0.8);
  }

  /* Table containers on mobile */
  .usersTableContainer {
    border-radius: 14px;
    overflow: hidden;
  }

  /* List items should feel touch-friendly */
  .folderItem,
  .docItem,
  .filesNavItem {
    padding: 10px 12px;
    border-radius: 12px;
    min-height: 44px;
  }

  /* Notification dropdown on mobile */
  .notificationDropdown {
    position: fixed;
    top: auto;
    bottom: 70px;
    left: 12px;
    right: 12px;
    max-width: none;
    border-radius: 16px;
  }

  /* Modal sheets should be full-height */
  .mobileSheet {
    max-height: 75vh;
    overflow-y: auto;
  }

  /* Empty states should blend smoothly */
  .emptyState,
  .announcementsEmpty,
  .wikiEmpty,
  .chatEmpty {
    background: transparent !important;
    border: none !important;
  }

  .emptyIcon {
    opacity: 0.6;
  }

  /* Remove any harsh box shadows on mobile */
  .topbar {
    box-shadow: 0 2px 12px rgba(0,0,0,0.2);
  }

  .card,
  .cardItem {
    box-shadow: 0 1px 4px rgba(0,0,0,0.15) !important;
  }
}

.addComment {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}
.addComment textarea {
  flex: 1;
  resize: vertical;
}

/* Doc editor */
.editorHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.docTitleInput {
  flex: 1;
  font-size: 18px;
  font-weight: 600;
  padding: 10px 12px;
}
.folderBadge {
  font-size: 13px;
  color: var(--muted);
  padding: 6px 10px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.select.small {
  min-width: 140px;
}

.editorTabs {
  display: flex;
  gap: 4px;
  margin-bottom: 8px;
}
.editorTab {
  padding: 8px 14px;
  border-radius: 8px 8px 0 0;
  border: 1px solid var(--border);
  border-bottom: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.editorTab.active {
  background: var(--panel2);
  color: var(--text);
}

.markdownToolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 8px 10px;
  background: var(--panel2);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  align-items: center;
}
.mdBtn {
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  transition: background 0.15s, border-color 0.15s;
}
.mdBtn:hover {
  background: rgba(255,255,255,0.1);
  border-color: var(--border);
}
.mdBtn:active {
  background: rgba(255,255,255,0.15);
}
.toolbarDivider {
  width: 1px;
  height: 20px;
  background: var(--border);
  margin: 0 4px;
}

.editorTextarea {
  width: 100%;
  min-height: 400px;
  padding: 14px;
  font-family: ui-monospace, monospace;
  font-size: 14px;
  line-height: 1.6;
  resize: vertical;
  border-radius: 0 0 0 8px;
}

/* Side-by-side split editor */
.splitEditor {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 0 0 8px 8px;
  overflow: hidden;
  min-height: 400px;
}

.splitEditor .editorTextarea {
  border: none;
  border-right: 1px solid var(--border);
  border-radius: 0;
  min-height: 400px;
  resize: none;
}

.splitEditor .editorPreview {
  border: none;
  border-radius: 0;
  min-height: 400px;
  overflow-y: auto;
}

.markdown-body .mdBlankLine {
  height: 1.6em;
}

.editorPreview {
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: 0 0 8px 8px;
  padding: 14px;
  min-height: 400px;
}

/* ============ TEAM VIEW ============ */
.teamHeader {
  margin-bottom: 20px;
}

.teamHeader h2 {
  margin-bottom: 4px;
}

.teamGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.teamMemberCard {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  gap: 14px;
  align-items: center;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.memberActions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-shrink: 0;
}

.teamMemberCard:hover {
  background: var(--panel2);
  border-color: rgba(255,255,255,0.15);
}

.memberAvatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  overflow: hidden;
}

.memberAvatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.memberInfo {
  flex: 1;
  min-width: 0;
}

.memberName {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.memberEmail {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.memberTitle {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.memberRoles {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.memberRoleBadge {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--text);
  white-space: nowrap;
}

/* Role Section Divider */
.roleSectionDivider {
  grid-column: 1 / -1;
  margin: 16px 0;
  padding: 12px 16px;
  background: rgba(59, 130, 246, 0.08);
  border-top: 2px solid var(--accent);
  border-bottom: 1px solid var(--border);
  border-radius: 8px;
  font-weight: 600;
  color: var(--accent);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.roleSectionDivider .roleDot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

/* ============ CHAT VIEW ============ */
.chatLayout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 16px;
  min-height: calc(100vh - 140px);
}

@media (max-width: 900px) {
  .chatLayout {
    grid-template-columns: 1fr;
  }
}

.chatSidebar {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.chatSidebar .sidebarHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.chatSidebar .sidebarHeader h3 {
  margin: 0;
  font-size: 15px;
}

.chatThreadList {
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: auto;
  min-height: 0;
}

.chatThreadItem {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s;
}

.chatThreadItem:hover {
  background: rgba(255,255,255,0.05);
}

.chatThreadItem.active {
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.chatThreadText {
  flex: 1;
  min-width: 0;
}

.chatThreadName {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chatThreadPreview {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chatUnseenDot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.chatMain {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.chatEmpty {
  padding: 18px;
  text-align: center;
}

.chatThread {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.chatHeader {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.chatMessages {
  background: var(--bg);
  border: none;
  border-radius: 0;
  padding: 16px;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}

.chatMessageGroup {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  margin-bottom: 4px;
  justify-content: flex-start;
}

.chatMessageGroup.mine {
  justify-content: flex-end;
}

.chatAvatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(59, 130, 246, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  flex-shrink: 0;
  order: 0;
}

.chatMessageGroup.mine .chatAvatar {
  order: 2;
}

.chatBubble {
  max-width: 60%;
  background: rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  order: 1;
}

.chatMessageGroup.mine .chatBubble {
  background: var(--accent);
}

.chatMessageGroup.mine .chatBody {
  color: #fff;
}

.chatMessageGroup.mine .chatTimestamp {
  color: rgba(255,255,255,0.85);
}

.chatContent {
  flex: 1;
  min-width: 0;
}

.chatAuthor {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 4px;
  display: none;
}

.chatMessageGroup.mine .chatAuthor {
  display: none;
}

.chatTimestamp {
  font-size: 12px;
  color: var(--muted);
}

.chatBody {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 14px;
  color: var(--text);
  line-height: 1.45;
}

.chatComposer {
  flex-shrink: 0;
  padding: 12px 16px 16px;
  border-top: 1px solid var(--border);
  background: var(--panel);
}

.chatTyping {
  margin-bottom: 6px;
  line-height: 1.2;
}

.chatTyping .typingDots {
  display: inline-flex;
  gap: 2px;
  margin-left: 6px;
}

.chatTyping .typingDots span {
  opacity: 0.25;
  animation: chatTypingDot 1.1s infinite;
}

.chatTyping .typingDots span:nth-child(2) {
  animation-delay: 0.15s;
}

.chatTyping .typingDots span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes chatTypingDot {
  0%, 80%, 100% { opacity: 0.25; }
  40% { opacity: 1; }
}


/* ============ PROFILE / PORTFOLIO VIEW ============ */
.portfolioContainer {
  max-width: 1100px;
  margin: 0 auto;
}

/* Hero Section */
.portfolioHero {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: visible;
  margin-bottom: 20px;
}

.heroBanner {
  height: 180px;
  background: linear-gradient(135deg, #1a1f2e 0%, #0d1117 50%, #1e293b 100%);
  background-size: cover;
  background-position: center;
}

.heroContent {
  display: flex;
  align-items: flex-end;
  gap: 20px;
  padding: 0 24px 24px;
  margin-top: -50px;
  position: relative;
}

.portfolioHero .profileAvatarLarge {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: var(--panel);
  border: 4px solid var(--panel);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.portfolioHero .profileAvatarLarge img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.heroInfo {
  flex: 1;
  padding-bottom: 8px;
}

.heroInfo h1 {
  margin: 0 0 4px;
  font-size: 28px;
  font-weight: 700;
}

.heroInfo .profileTitle {
  font-size: 16px;
  color: var(--accent);
  margin-bottom: 4px;
  font-weight: 500;
}

.heroInfo .profileEmail {
  font-size: 14px;
}

.profileActions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.profileMenuWrapper {
  position: relative;
  z-index: 150;
}

/* Stats Bar */
.portfolioStats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.statItem {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  transition: border-color 0.15s;
}

.statItem:hover {
  border-color: var(--border-hover);
}

.statNumber {
  display: block;
  font-size: 24px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 4px;
}

.statLabel {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Portfolio Grid */
.portfolioGrid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 20px;
}

@media (max-width: 900px) {
  .portfolioGrid {
    grid-template-columns: 1fr;
  }
  .portfolioStats {
    grid-template-columns: repeat(2, 1fr);
  }
  .heroContent {
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-top: -60px;
  }
  .portfolioHero #editProfileBtn {
    margin-top: 12px;
  }
}

.portfolioMain {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.portfolioSidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Portfolio Cards */
.portfolioCard {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
}

.portfolioCard .cardHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.portfolioCard .cardHeader h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

/* Bio Text */
.bioText {
  line-height: 1.7;
  white-space: pre-wrap;
  color: var(--text);
}

/* Skills Grid */
.skillsGrid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.skillTag {
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.skillTag.muted {
  background: rgba(255,255,255,0.05);
  color: var(--muted);
  border-color: var(--border);
}

/* Activity List */
.activityList {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.activityItem {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px;
  background: rgba(255,255,255,0.02);
  border-radius: 10px;
  border: 1px solid var(--border);
}

.activityIcon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(59, 130, 246, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.activityIcon.doc { background: rgba(34, 197, 94, 0.15); }
.activityIcon.card { background: rgba(168, 85, 247, 0.15); }
.activityIcon.comment { background: rgba(251, 191, 36, 0.15); }

.activityContent {
  flex: 1;
  min-width: 0;
}

.activityTitle {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.activityMeta {
  font-size: 12px;
  color: var(--muted);
}

/* Links List */
.linksList {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.linkItem {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  text-decoration: none;
  transition: all 0.15s;
}

.linkItem:hover {
  background: rgba(255,255,255,0.05);
  border-color: var(--border-hover);
}

.linkIcon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.linkText {
  font-size: 14px;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Projects List */
.projectsList {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.projectItem {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.projectIcon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: white;
}

.projectName {
  font-size: 14px;
  font-weight: 500;
}

.projectRole {
  font-size: 11px;
  color: var(--muted);
  background: rgba(255,255,255,0.08);
  padding: 2px 8px;
  border-radius: 4px;
  margin-left: auto;
}

/* Current Time Info */
.currentTimeInfo {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.timeDisplay {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.timeValue {
  font-size: 28px;
  font-weight: 700;
  color: var(--accent);
  font-family: 'Courier New', monospace;
}

.timeZone {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Empty State */
.emptyState {
  text-align: center;
  padding: 16px;
  font-size: 13px;
}

/* Profile Modal Enhancements */
.profileModalCard {
  max-width: 500px;
  width: 100%;
}

.modalTabs {
  display: flex;
  gap: 4px;
  margin: 16px 0;
  padding: 4px;
  background: rgba(255,255,255,0.05);
  border-radius: 10px;
}

.modalTab {
  flex: 1;
  padding: 10px 16px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.15s;
}

.modalTab:hover {
  color: var(--text);
  background: rgba(255,255,255,0.05);
}

.modalTab.active {
  background: var(--accent);
  color: white;
}

.modalTabContent {
  min-height: 200px;
}

.modalTabContent.hidden {
  display: none;
}

/* Header Avatar (keep existing) */
.headerAvatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  border: 2px solid var(--border);
  cursor: pointer;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: border-color 0.15s;
}

.headerAvatar:hover {
  border-color: rgba(255,255,255,0.3);
}

.headerAvatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.headerAvatar .avatarPlaceholder {
  font-size: 18px;
}

#editProfileBtn {
  margin-left: auto;
}

/* ============ ROLES MANAGEMENT ============ */

.rolesLayout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
  min-height: calc(100vh - 200px);
}

@media (max-width: 900px) {
  .rolesLayout {
    grid-template-columns: 1fr;
  }
}

.rolesSidebar {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  height: fit-content;
}

.rolesSidebar .sidebarHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.rolesSidebar .sidebarHeader h3 {
  margin: 0;
  font-size: 15px;
}

.rolesList {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.roleItem {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
}

.roleItem:hover {
  background: rgba(255,255,255,0.05);
}

.roleItem.active {
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.roleItemContent {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  cursor: pointer;
}

.roleBadge {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.roleItemName {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
}

.roleItemCount {
  font-size: 12px;
  color: var(--muted);
  background: rgba(255,255,255,0.05);
  padding: 2px 8px;
  border-radius: 10px;
}

.roleItemButtons {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.15s;
}

.roleItem:hover .roleItemButtons {
  opacity: 1;
}

.roleBtn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
  min-width: 28px;
}

.roleBtn:hover:not(:disabled) {
  background: rgba(59, 130, 246, 0.1);
  border-color: rgb(59, 130, 246);
  color: rgb(59, 130, 246);
}

.roleBtn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.rolesMain {
  min-height: 400px;
}

.rolesEmpty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 20px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  height: 100%;
}

.rolesEmpty .emptyIcon {
  font-size: 48px;
  margin-bottom: 16px;
}

.rolesEmpty h3 {
  margin: 0 0 8px;
}

.roleDetails {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
}

.roleHeader {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}

.roleHeaderInfo {
  display: flex;
  align-items: center;
  gap: 16px;
}

.roleHeaderInfo .roleBadge {
  width: 40px;
  height: 40px;
  border-radius: 10px;
}

.roleHeaderInfo h2 {
  margin: 0;
  font-size: 20px;
}

.roleHeaderInfo .muted {
  margin: 0;
  font-size: 13px;
}

.roleSection {
  margin-bottom: 28px;
}

.roleSection:last-child {
  margin-bottom: 0;
}

.sectionHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.sectionHeader h3 {
  margin: 0;
  font-size: 15px;
}

.roleMembersList {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.roleMember {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  padding: 8px 12px;
  border-radius: 8px;
}

.roleMember .memberAvatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  overflow: hidden;
}

.roleMember .memberAvatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.roleMember .memberName {
  font-size: 13px;
  font-weight: 500;
}

.roleMember .removeMember {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: none;
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.6;
  transition: opacity 0.15s;
}

.roleMember .removeMember:hover {
  opacity: 1;
}

.folderPermList {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.folderPermItem {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  padding: 12px 16px;
  border-radius: 10px;
}

.folderPermItem .folderIcon {
  font-size: 18px;
}

.folderPermItem .folderName {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
}

.folderPermItem .permBadges {
  display: flex;
  gap: 6px;
}

.permBadge {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 500;
}

.permBadge.view {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}

.permBadge.edit {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
}

.folderPermItem .removePerm {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: none;
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  cursor: pointer;
  font-size: 14px;
  opacity: 0.6;
  transition: opacity 0.15s;
}

.folderPermItem .removePerm:hover {
  opacity: 1;
}

/* Color Picker */
.colorPicker {
  display: flex;
  align-items: center;
  gap: 12px;
}

.colorPicker input[type="color"] {
  width: 50px;
  height: 38px;
  padding: 2px;
  border-radius: 8px;
  cursor: pointer;
}

.colorPreview {
  width: 24px;
  height: 24px;
  border-radius: 6px;
}

/* Permission Options */
.permOptions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 16px 0;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 14px;
}

.checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

/* Admin Only Nav Tab */
.navTab.adminOnly {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.navTab.adminOnly.active {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.4);
}

/* Empty members/permissions state */
.roleMembersList:empty::after,
.folderPermList:empty::after {
  content: "None yet";
  color: var(--muted);
  font-size: 13px;
  padding: 16px;
  display: block;
}

.rolePermissionList {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.rolePermissionBadge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.12);
  color: #93c5fd;
  font-size: 12px;
  font-weight: 600;
}

.rolePermissionList:empty::after {
  content: "No special permissions";
  color: var(--muted);
  font-size: 13px;
  padding: 12px 0;
  display: block;
}

/* Announcements */
.announcementsList {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.announcementCard {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.announcementCard:hover {
  border-color: var(--border-hover);
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}

.announcementCard.unread::before {
  content: "";
  position: absolute;
  top: 18px;
  left: 18px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #38bdf8;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}

.announcementHeader {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.announcementTitle {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

.announcementMeta {
  font-size: 12px;
  color: var(--muted);
}

.announcementBody {
  color: var(--text);
}

.announcementBody p {
  margin: 0 0 8px;
}

.announcementHighlight {
  animation: pulseGlow 1.6s ease;
}

@keyframes pulseGlow {
  0% { box-shadow: 0 0 0 rgba(59,130,246,0.0); }
  40% { box-shadow: 0 0 0 8px rgba(59,130,246,0.2); }
  100% { box-shadow: 0 0 0 rgba(59,130,246,0.0); }
}

.small {
  font-size: 12px;
}

/* Profile Roles */
.profileRoles {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.profileRoleBadge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
}

.profileRoleBadge .roleDot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

/* Role Options in Modal */
.roleOptions {
  margin: 16px 0;
  padding: 12px;
  background: rgba(255,255,255,0.03);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.roleOptions .checkbox {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.checkboxHint {
  width: 100%;
  font-size: 11px;
  color: var(--muted);
  margin-left: 28px;
  margin-top: 2px;
}

/* View All Badge */
.viewAllBadge {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
  font-weight: 600;
  margin-left: 6px;
}

/* ============ USERS MANAGEMENT ============ */
.usersHeader {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
}

.usersHeader h2 {
  margin-bottom: 4px;
}

.usersTableContainer {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.usersTable {
  width: 100%;
  border-collapse: collapse;
}

.usersTable th,
.usersTable td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.usersTable th {
  background: rgba(255,255,255,0.03);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
}

.usersTable tbody tr:hover {
  background: rgba(255,255,255,0.02);
}

.usersTable tbody tr:last-child td {
  border-bottom: none;
}

.userCell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.userCellAvatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  overflow: hidden;
}

.userCellAvatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.userCellName {
  font-weight: 500;
}

.userActions {
  display: flex;
  gap: 8px;
}

.userActions .btn {
  padding: 6px 12px;
  font-size: 12px;
}

.adminBadge {
  display: inline-block;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
  font-weight: 600;
  margin-left: 8px;
}

.usersEmpty {
  padding: 60px 20px;
  text-align: center;
}

.usersEmpty .emptyIcon {
  font-size: 48px;
  margin-bottom: 16px;
}

/* ============ PROJECT SELECTOR ============ */
.projectSelector {
  position: relative;
}

.projectSelectorBtn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 14px;
  font-weight: 500;
}

.projectSelectorBtn:hover {
  background: rgba(255,255,255,0.06);
  border-color: var(--border-hover);
}

.projectSelectorBtn .dropdownArrow {
  font-size: 10px;
  color: var(--muted);
  transition: transform 0.2s ease;
}

.projectSelector.open .projectSelectorBtn .dropdownArrow {
  transform: rotate(180deg);
}

.projectDropdown {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 6px;
  min-width: 280px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  z-index: 200;
  overflow: hidden;
}

.projectList {
  max-height: 320px;
  overflow-y: auto;
  padding: 8px;
}

.projectItem {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.projectItem:hover {
  background: rgba(255,255,255,0.06);
}

.projectItem.active {
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.projectItem .projectIcon {
  font-size: 20px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--panel2);
  border-radius: 8px;
}

.projectItem .projectInfo {
  flex: 1;
  min-width: 0;
}

.projectItem .projectName {
  font-weight: 500;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.projectItem .projectDesc {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.projectItem .studioBadge {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(139, 92, 246, 0.15);
  color: #a78bfa;
  font-weight: 600;
}

.projectDropdownFooter {
  padding: 8px;
  border-top: 1px solid var(--border);
}

/* ============ PROJECT MANAGEMENT MODAL ============ */
.projectManageLayout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 20px;
  min-height: 400px;
  margin-top: 16px;
}

#projectModal .modalCard {
  max-width: 800px;
  width: 90%;
}

.projectManageList {
  border-right: 1px solid var(--border);
  padding-right: 20px;
}

.projectManageHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.projectManageHeader h4 {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.projectManageItems {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.projectManageItem {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
}

.projectManageItem:hover {
  background: rgba(255,255,255,0.04);
}

.projectManageItem.selected {
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.3);
}

.projectManageItem .projectIcon {
  font-size: 18px;
}

.projectManageItem .projectName {
  flex: 1;
  font-weight: 500;
  font-size: 14px;
}

.projectManageDetails {
  padding-left: 20px;
}

.projectManageDetails .emptyState {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--muted);
  font-size: 14px;
}

.projectDetailHeader {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.projectDetailIcon {
  font-size: 40px;
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--panel2);
  border-radius: 12px;
}

.projectDetailInfo {
  flex: 1;
}

.projectDetailInfo h2 {
  margin: 0 0 4px;
  font-size: 20px;
}

.projectDetailInfo .projectDesc {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 12px;
}

.projectDetailActions {
  display: flex;
  gap: 8px;
}

.projectSection {
  margin-bottom: 24px;
}

.projectSection h4 {
  margin: 0 0 12px;
  font-size: 14px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.projectMemberList {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.projectMemberItem {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--panel2);
  border-radius: 8px;
}

.projectMemberItem .memberAvatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  overflow: hidden;
}

.projectMemberItem .memberAvatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.projectMemberItem .memberInfo {
  flex: 1;
}

.projectMemberItem .memberName {
  font-weight: 500;
  font-size: 14px;
}

.projectMemberItem .memberEmail {
  font-size: 12px;
  color: var(--muted);
}

.projectMemberItem .memberRole {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(255,255,255,0.06);
  color: var(--muted);
  text-transform: capitalize;
}

.projectMemberItem .removeBtn {
  opacity: 0;
  transition: opacity 0.15s ease;
}

.projectMemberItem:hover .removeBtn {
  opacity: 1;
}

.projectBoardList {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.projectBoardItem {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--panel2);
  border-radius: 8px;
}

.projectBoardItem .boardName {
  font-weight: 500;
  font-size: 14px;
}

/* Icon Picker */
.iconPicker {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.iconInput {
  width: 60px !important;
  text-align: center;
  font-size: 24px;
  padding: 8px !important;
}

.iconSuggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.iconOption {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  background: var(--panel2);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.iconOption:hover {
  background: rgba(255,255,255,0.1);
  transform: scale(1.1);
}
/* ============ NOTIFICATIONS ============ */

.notificationContainer {
  position: relative;
}

.headerBtn {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: all 0.15s ease;
}

.headerBtn:hover {
  background: rgba(255,255,255,0.1);
  border-color: var(--border-hover);
}

.badge {
  position: absolute;
  top: -6px;
  right: -6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  font-size: 11px;
  font-weight: 600;
  background: #ef4444;
  color: white;
  border-radius: 10px;
  border: 2px solid var(--bg);
}

.notificationDropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 380px;
  max-width: 500px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 12px 48px rgba(0,0,0,0.5);
  z-index: 300;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 500px;
}

.notificationHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  gap: 10px;
}

.notificationHeader h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: rgba(219, 234, 254, 0.95);
}

#markAllReadBtn {
  padding: 4px 8px;
  font-size: 12px;
}

.notificationList {
  flex: 1;
  overflow-y: auto;
  max-height: 400px;
}

.notificationItem {
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s ease;
  align-items: flex-start;
}

.notificationItem:hover {
  background: rgba(255,255,255,0.04);
}

.notificationItem.unread {
  background: rgba(59, 130, 246, 0.08);
}

.notificationItem:last-child {
  border-bottom: none;
}

.notificationAvatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.notificationContent {
  flex: 1;
  min-width: 0;
}

.notificationSender {
  font-weight: 500;
  font-size: 13px;
  color: var(--text);
  margin-bottom: 4px;
}

.notificationMessage {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.notificationTime {
  font-size: 11px;
  color: var(--muted);
}

.notificationEmpty {
  padding: 24px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

/* Profile Menu Dropdown */
.profileMenuWrapper {
  position: relative;
}

.profileMenu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  z-index: 999;
  overflow: hidden;
  padding: 6px;
}

.profileMenuItem {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  background: none;
  border: none;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  border-radius: 6px;
  text-align: left;
  transition: background 0.15s ease;
}

.profileMenuItem:hover {
  background: var(--hover);
}

.profileMenuDivider {
  height: 1px;
  background: var(--border);
  margin: 6px 0;
}

/* MAIL */
.mailLayout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 16px;
  height: calc(100vh - 100px);
}
.mailTri {
  display: grid;
  grid-template-columns: minmax(520px, 680px) 1fr;
  gap: 16px;
  min-width: 0;
}

@media (min-width: 1400px) {
  .mailTri {
    grid-template-columns: minmax(600px, 760px) 1fr;
  }
}
.mailPane {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  overflow: hidden;
  min-width: 0;
}
.mailPaneList {
  display: flex;
  flex-direction: column;
}
.mailPaneRead {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

/* Give pane headers breathing room (prevents titles from looking squished) */
.mailPane .mailHeader {
  padding: 12px 14px;
  margin: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.12);
}

.mailPane .mailHeader h2 {
  margin: 0;
}

.mailPane .mailHeader .row {
  margin-top: 8px;
}
.mailReadHeader {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
}
.mailBackBtn {
  display: none;
}
.mailActions {
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.mailReadTitle h2 {
  margin: 0;
  font-size: 18px;
}
.mailList {
  padding: 10px;
}
.mailItem {
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.15);
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
}
.mailItem:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.25);
}
.mailItem.active {
  border-color: rgba(99, 102, 241, 0.45);
  background: rgba(99, 102, 241, 0.10);
}
.mailItemTop {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.mailFromRow {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.unreadDot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #6366f1;
  flex: 0 0 auto;
}
.mailFrom {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mailSubjectLine {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}
.threadCount {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.65);
}
.attachIcon {
  font-size: 12px;
  opacity: 0.85;
}
.mailSnippet {
  margin-top: 6px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.65);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.threadMessages {
  padding: 12px;
  overflow: auto;
  flex: 1;
  min-height: 0;
}
.threadMsg {
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.15);
  border-radius: 12px;
  margin-bottom: 10px;
  overflow: hidden;
}
.threadMsg.unread {
  border-color: rgba(99, 102, 241, 0.45);
}
.threadMsgHeader {
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
}
.threadMsgHeaderLeft {
  min-width: 0;
}
.threadMsgFrom {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.threadMsgMeta {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.65);
}
.threadMsgBody {
  padding: 0 12px 12px;
}
.threadMsgBody.collapsed {
  display: none;
}

.mailMessageFrame {
  width: 100%;
  border: 0;
  border-radius: 10px;
  background: #ffffff;
  min-height: 400px;
}

.mailPlainText {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--text);
}
@media (max-width: 1050px) {
  .mailTri {
    grid-template-columns: 1fr;
  }
  .mailBackBtn {
    display: inline-flex;
  }
  #mailReadPane {
    display: none;
  }
  .mailLayout.mailMobileRead #mailListPane {
    display: none;
  }
  .mailLayout.mailMobileRead #mailReadPane {
    display: flex;
  }
}
@media(max-width: 700px) {
  .mailLayout { grid-template-columns: 1fr; }
  .mailSidebar { display: none; } /* Mobile sidebar hidden or toggleable? For now just hide */
}

.mailSidebar {
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.mailFolderList {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mailFolderItem {
  text-align: left;
  padding: 8px 12px;
  border-radius: 6px;
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s;
}
.mailFolderItem:hover {
  background: rgba(255,255,255,0.05);
  color: var(--text);
}
.mailFolderItem.active {
  background: var(--accent);
  color: white;
}

.mailMain {
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  overflow-y: auto;
  position: relative;
}

.mailHeader {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.mailList {
  display: flex;
  flex-direction: column;
}

.mailItem {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
}
.mailItem:last-child { border-bottom: none; }
.mailItem:hover {
  background: rgba(255,255,255,0.03);
}
.mailItem.unread {
  background: rgba(59, 130, 246, 0.1);
  border-left: 2px solid var(--accent);
}

.mailItemHeader {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
  font-size: 13px;
  color: var(--muted);
}

.mailFrom { font-weight: 500; color: var(--text); }
.mailSubject { font-size: 14px; font-weight: 600; }

.mailMessageView {
  animation: fadeIn 0.2s ease;
}

.msgMeta {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.msgBody {
  font-size: 15px;
  line-height: 1.6;
  max-width: 800px;
}

/* Gmail-like Compose Modal */
.composeCard {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  max-width: 800px;
  width: 90vw;
  max-height: 90vh;
  box-shadow: 0 4px 32px rgba(0, 0, 0, 0.4);
}

.composeHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
}

.composeHeader h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.composeActions {
  display: flex;
  gap: 6px;
}

.composeBtn {
  background: transparent;
  border: none;
  color: var(--text);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 18px;
  transition: background 0.15s ease;
}

.composeBtn:hover {
  background: rgba(255, 255, 255, 0.08);
}

.composeFields {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.12);
}

.composeRow {
  display: grid;
  grid-template-columns: 50px 1fr;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
}

.composeRow:last-child {
  margin-bottom: 0;
}

.composeLabel {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
  text-align: right;
}

.composeInputGroup {
  display: flex;
  gap: 8px;
  align-items: center;
}

.composeInput {
  margin: 0 !important;
  padding: 8px 12px;
  border: 1px solid var(--border);
  background: var(--panel2);
  border-radius: 8px;
  font-size: 13px;
}

.composeInput:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(59, 130, 246, 0.05);
}

.composeToggleBtn {
  background: transparent;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  padding: 0;
  transition: color 0.15s ease;
}

.composeToggleBtn:hover {
  color: var(--accent-hover);
}

.composeBody {
  flex: 1;
  padding: 12px 16px;
  min-height: 300px;
  overflow: auto;
}

.composeTextarea {
  width: 100% !important;
  min-height: 280px;
  padding: 12px;
  border: 1px solid var(--border);
  background: var(--panel2);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  line-height: 1.5;
  margin: 0 !important;
  outline: none;
  overflow-y: auto;
  word-wrap: break-word;
  white-space: pre-wrap;
}

.composeTextarea:focus {
  border-color: var(--accent);
}

/* Allow contenteditable to be a proper text editor */
.composeTextarea[contenteditable] {
  cursor: text;
}

.composeToolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.12);
  gap: 12px;
  flex-wrap: wrap;
}

.toolbarLeft {
  display: flex;
  gap: 2px;
  align-items: center;
}

.toolbarBtn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.toolbarBtn:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border);
}

.toolbarSeparator {
  width: 1px;
  height: 18px;
  background: var(--border);
  margin: 0 4px;
}

.toolbarRight {
  display: flex;
  align-items: center;
  gap: 8px;
}

.toolbarRight .msg {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  min-height: auto;
}

.composeFooter {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.12);
  display: flex;
  justify-content: flex-start;
  gap: 8px;
}

.composeFooter .btn {
  padding: 8px 24px;
  font-size: 14px;
}

/* Make compose modal dialog work without changing outer modal backdrop */
.modal#mailComposeModal {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 24px;
}

.mailComposer {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mailEmpty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 300px;
  color: var(--muted);
}
.mailEmpty .emptyIcon { font-size: 48px; margin-bottom: 16px; opacity: 0.5; }