@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&display=swap");

:root {
  --m-bg: #0a0e14;
  --m-bg-2: #060a0f;
  --m-ink: rgba(255,255,255,0.95);
  --m-muted: rgba(255,255,255,0.55);
  --m-card: #12181f;
  --m-card-hover: #1a2128;
  --m-border: rgba(255,255,255,0.08);
  --m-border-hover: rgba(255,255,255,0.15);
  --m-accent: #3b82f6;
  --m-accent-hover: #60a5fa;
  --m-accent-glow: rgba(59,130,246,0.15);
  --m-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  --m-radius: 14px;
}

body.mobile-shell {
  color-scheme: dark;
  font-family: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
  background: var(--m-bg);
  color: var(--m-ink);
  min-height: 100vh;
}



body.mobile-shell .mobileHeader {
  margin: 12px 12px 0;
  padding: 12px 16px 10px;
  border-radius: 16px;
  border: 1px solid var(--m-border);
  background: rgba(18, 24, 31, 0.95);
  backdrop-filter: blur(16px);
  box-shadow: var(--m-shadow);
  position: sticky;
  top: 12px;
  z-index: 10;
  display: grid;
  gap: 10px;
}

body.mobile-shell .mobileHeaderRow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

body.mobile-shell .mobileBrand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

body.mobile-shell .brandMark {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: linear-gradient(135deg, var(--m-accent), var(--m-accent-hover));
  box-shadow: 0 0 0 3px var(--m-accent-glow);
  flex: 0 0 auto;
}

body.mobile-shell .brandText {
  display: grid;
}

body.mobile-shell .brandTitle {
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.02em;
}

body.mobile-shell .brandSub {
  font-size: 11px;
  color: var(--m-muted);
  font-weight: 400;
}

body.mobile-shell .mobileActions {
  display: flex;
  align-items: center;
  gap: 8px;
}

body.mobile-shell .mobileProjectRow {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

body.mobile-shell .mainNav,
body.mobile-shell .navMenu,
body.mobile-shell .topbar {
  display: none !important;
}

body.mobile-shell .right {
  gap: 8px;
}

body.mobile-shell .mobileLogout {
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
}

body.mobile-shell .projectSelector {
  display: block;
  width: 100%;
}

body.mobile-shell .projectSelectorBtn {
  width: 100%;
  justify-content: space-between;
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--m-border);
  transition: all 0.15s ease;
}

body.mobile-shell .projectSelectorBtn:hover {
  background: rgba(255,255,255,0.06);
  border-color: var(--m-border-hover);
}

body.mobile-shell .projectDropdown {
  border-radius: 14px;
}

body.mobile-shell .wrap {
  padding: 14px 14px calc(120px + env(safe-area-inset-bottom));
  max-width: 680px;
}

body.mobile-shell .wrap > section {
  position: relative;
  z-index: 1;
}

body.mobile-shell .card,
body.mobile-shell .authCard,
body.mobile-shell .filesSidebar,
body.mobile-shell .wikiSidebar,
body.mobile-shell .chatSidebar,
body.mobile-shell .usersTableContainer,
body.mobile-shell .rolesSidebar,
body.mobile-shell .rolesMain,
body.mobile-shell .portfolioCard,
body.mobile-shell .modalCard,
body.mobile-shell .notificationDropdown,
body.mobile-shell .mobileSheet,
body.mobile-shell .projectDropdown,
body.mobile-shell .projectManageList,
body.mobile-shell .projectManageDetails {
  background: var(--m-card);
  border: 1px solid var(--m-border);
  box-shadow: var(--m-shadow);
  border-radius: var(--m-radius);
}

body.mobile-shell h1,
body.mobile-shell h2,
body.mobile-shell h3,
body.mobile-shell h4 {
  font-weight: 600;
  letter-spacing: -0.02em;
}

body.mobile-shell .muted,
body.mobile-shell label,
body.mobile-shell .msg {
  color: var(--m-muted);
}

body.mobile-shell input,
body.mobile-shell textarea,
body.mobile-shell select {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--m-border);
  color: var(--m-ink);
  border-radius: 10px;
  transition: all 0.15s ease;
}

body.mobile-shell input:focus,
body.mobile-shell textarea:focus,
body.mobile-shell select:focus {
  background: rgba(255,255,255,0.05);
  border-color: var(--m-accent);
  box-shadow: 0 0 0 3px var(--m-accent-glow);
}

body.mobile-shell .btn {
  border-radius: 10px;
  background: rgba(255,255,255,0.06);
  border-color: var(--m-border);
  color: var(--m-ink);
  font-weight: 500;
  transition: all 0.15s ease;
}

body.mobile-shell .btn:hover {
  background: rgba(255,255,255,0.1);
  border-color: var(--m-border-hover);
}

body.mobile-shell .btn.primary {
  background: var(--m-accent);
  border-color: var(--m-accent);
  color: #fff;
}

body.mobile-shell .btn.primary:hover {
  background: var(--m-accent-hover);
  border-color: var(--m-accent-hover);
}

body.mobile-shell .btn.subtle {
  background: transparent;
  border-color: transparent;
  color: var(--m-muted);
}

body.mobile-shell .btn.subtle:hover {
  background: rgba(255,255,255,0.06);
  color: var(--m-ink);
}

body.mobile-shell .badge,
body.mobile-shell .navBadge,
body.mobile-shell .tabBadge {
  background: var(--m-accent);
  color: #fff;
}

body.mobile-shell .boardHeader,
body.mobile-shell .usersHeader,
body.mobile-shell .teamHeader,
body.mobile-shell .wikiLayout,
body.mobile-shell .filesLayout,
body.mobile-shell .chatLayout,
body.mobile-shell .rolesLayout,
body.mobile-shell .portfolioContainer {
  background: transparent;
}

body.mobile-shell .boardHeader {
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  margin-bottom: 16px;
}

body.mobile-shell .boardHeaderTitle {
  text-align: center;
}

body.mobile-shell .boardHeaderTitle h2 {
  margin-bottom: 4px;
}

body.mobile-shell .filesLayout,
body.mobile-shell .wikiLayout,
body.mobile-shell .chatLayout,
body.mobile-shell .rolesLayout {
  grid-template-columns: 1fr;
}

body.mobile-shell .filesSidebar,
body.mobile-shell .wikiSidebar,
body.mobile-shell .chatSidebar,
body.mobile-shell .rolesSidebar {
  margin-bottom: 12px;
}

body.mobile-shell .boardHeaderActions {
  flex-direction: column;
  align-items: stretch;
  width: 100%;
}

body.mobile-shell .boardHeaderActions .btn,
body.mobile-shell .boardHeaderActions .select {
  width: 100%;
}

body.mobile-shell #boardSelect {
  width: 100%;
  font-size: 14px;
  padding: 10px 12px;
}

body.mobile-shell .mobileBoardPager {
  position: sticky;
  top: 84px;
  background: rgba(18, 24, 31, 0.95);
  border: 1px solid var(--m-border);
  box-shadow: var(--m-shadow);
  border-radius: 14px;
  padding: 8px 10px;
  z-index: 8;
  backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 12px 0;
}

body.mobile-shell .mobileBoardPager .btn {
  min-width: 40px;
  padding: 8px 12px;
}

body.mobile-shell .mobileBoardLabel {
  flex: 1;
  text-align: center;
  font-weight: 600;
  font-size: 14px;
  color: var(--m-ink);
}

/* Board display on mobile */
body.mobile-shell .board {
  display: flex;
  gap: 12px;
  margin-top: 12px;
  padding-bottom: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  scrollbar-width: none; /* Firefox */
}

body.mobile-shell .board::-webkit-scrollbar {
  display: none; /* Chrome, Safari */
}

body.mobile-shell .column {
  flex: 0 0 auto;
  width: calc(100vw - 56px); /* Viewport width minus wrap padding (28px) and margins for centering (28px) */
  max-width: 600px;
  scroll-snap-align: center;
  scroll-snap-stop: always;
  background: var(--m-card);
  border: 1px solid var(--m-border);
  border-radius: var(--m-radius);
  padding: 14px;
  min-height: 400px;
}

body.mobile-shell .column:first-child {
  margin-left: 14px;
}

body.mobile-shell .column:last-child {
  margin-right: 14px;
}

body.mobile-shell .columnHeader {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--m-border);
}

body.mobile-shell .columnTitle {
  font-weight: 600;
  font-size: 15px;
  color: var(--m-ink);
}

body.mobile-shell .dropzone {
  min-height: 300px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

body.mobile-shell .cardItem {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--m-border);
  border-radius: 10px;
  padding: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

body.mobile-shell .cardItem:hover {
  border-color: var(--m-border-hover);
  background: rgba(255,255,255,0.06);
  transform: translateY(-1px);
}

body.mobile-shell .cardTitle {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 6px;
  color: var(--m-ink);
}

body.mobile-shell .cardMeta {
  font-size: 12px;
  color: var(--m-muted);
}

body.mobile-shell .cardLabels {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}

body.mobile-shell .cardLabel {
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
}

body.mobile-shell .fab,
body.mobile-shell #mobileNewCardBtn {
  background: var(--m-accent);
  color: #fff;
  border: none;
  box-shadow: 0 8px 24px rgba(59,130,246,0.4), var(--m-shadow);
  transition: all 0.2s ease;
  position: fixed;
  right: 16px;
  bottom: 90px; /* Above bottom navigation */
  width: 54px;
  height: 54px;
  border-radius: 16px;
  font-size: 26px;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

body.mobile-shell.view-board .fab,
body.mobile-shell.view-board #mobileNewCardBtn {
  display: inline-flex;
}

body.mobile-shell .fab:hover,
body.mobile-shell #mobileNewCardBtn:hover {
  background: var(--m-accent-hover);
  transform: scale(1.05);
}

body.mobile-shell .fab:active,
body.mobile-shell #mobileNewCardBtn:active {
  transform: scale(0.95);
}

body.mobile-shell #mobileTabs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  padding: 10px 12px calc(12px + env(safe-area-inset-bottom));
  background: rgba(18, 24, 31, 0.98);
  border-top: 1px solid var(--m-border);
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(16px);
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
}

body.mobile-shell .mobileTab {
  border-radius: 12px;
  padding: 8px 6px;
  gap: 4px;
  color: var(--m-muted);
  transition: all 0.15s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 11px;
  font-weight: 500;
  border: 1px solid transparent;
  background: transparent;
}

body.mobile-shell .mobileTab:hover {
  background: rgba(255,255,255,0.03);
  color: var(--m-ink);
}

body.mobile-shell .mobileTab.active {
  background: rgba(59,130,246,0.12);
  border-color: var(--m-border);
  color: var(--m-accent-hover);
  font-weight: 600;
}

/* Mobile tab icons */
body.mobile-shell .tabIcon {
  width: 20px;
  height: 20px;
  stroke-width: 2.5;
}

body.mobile-shell .mobileTab.active .tabIcon {
  stroke: var(--m-accent-hover);
}

body.mobile-shell .tabLabel {
  font-size: 11px;
}

/* Mail Layout Mobile Optimizations */
body.mobile-shell .mailLayout {
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: auto;
}

body.mobile-shell .mailSidebar {
  width: 100%;
  padding: 16px;
  background: var(--m-card);
  border: 1px solid var(--m-border);
  border-radius: var(--m-radius);
  box-shadow: var(--m-shadow);
}

body.mobile-shell .mailNav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 12px;
}

body.mobile-shell .mailList {
  width: 100%;
  min-height: 400px;
  background: var(--m-card);
  border: 1px solid var(--m-border);
  border-radius: var(--m-radius);
  box-shadow: var(--m-shadow);
  padding: 16px;
}

body.mobile-shell .mailReadingPane {
  width: 100%;
  min-height: 400px;
  background: var(--m-card);
  border: 1px solid var(--m-border);
  border-radius: var(--m-radius);
  box-shadow: var(--m-shadow);
  padding: 16px;
}

body.mobile-shell .mailListHeader {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

body.mobile-shell .mailListHeader .searchInput {
  flex: 1;
}

body.mobile-shell .messageListItems {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

body.mobile-shell .mailNavItem {
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--m-ink);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 14px;
  position: relative;
}

body.mobile-shell .mailNavItem:hover {
  background: rgba(255,255,255,0.06);
  border-color: var(--m-border);
}

body.mobile-shell .mailNavItem.active {
  background: rgba(59,130,246,0.12);
  border-color: var(--m-border);
  color: var(--m-accent-hover);
  font-weight: 600;
}

body.mobile-shell .mailNavItem .icon {
  font-size: 16px;
  flex: 0 0 auto;
}

body.mobile-shell .mailNavItem .badge {
  margin-left: auto;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: var(--m-accent);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

body.mobile-shell .emptyReadingPane,
body.mobile-shell .emptyState {
  text-align: center;
  padding: 40px 20px;
  color: var(--m-muted);
}

body.mobile-shell .emptyIcon {
  font-size: 48px;
  margin-bottom: 12px;
}

body.mobile-shell .composeCard {
  max-width: 600px;
}

body.mobile-shell #messageContent .messageHeader {
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--m-border);
}

body.mobile-shell .senderInfo {
  display: flex;
  gap: 10px;
  align-items: center;
}

body.mobile-shell .senderInfo .avatar {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex: 0 0 auto;
}

body.mobile-shell .senderName {
  font-weight: 600;
  font-size: 14px;
}

body.mobile-shell .senderEmail {
  font-size: 12px;
}

body.mobile-shell .messageActions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--m-border);
}

body.mobile-shell .messageBody {
  line-height: 1.6;
}

body.mobile-shell .messageBody img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

/* Message items in list */
body.mobile-shell .messageItem {
  padding: 12px;
  border: 1px solid var(--m-border);
  border-radius: 10px;
  background: rgba(255,255,255,0.03);
  cursor: pointer;
  transition: all 0.15s ease;
}

body.mobile-shell .messageItem:hover {
  background: rgba(255,255,255,0.06);
  border-color: var(--m-border-hover);
}

body.mobile-shell .messageItem.unread {
  background: rgba(59,130,246,0.08);
  border-color: var(--m-accent);
}

/* Hide mail sidebar on very small screens initially */
@media (max-width: 600px) {
  body.mobile-shell .mailSidebar {
    position: sticky;
    top: 84px;
    z-index: 7;
    margin-bottom: 12px;
  }
  
  body.mobile-shell .mailLayout {
    gap: 8px;
  }
  
  body.mobile-shell .mailList,
  body.mobile-shell .mailReadingPane,
  body.mobile-shell .mailSidebar {
    padding: 12px;
  }
}

body.mobile-shell .mobileSheet {
  border-radius: 24px;
  border: 1px solid var(--m-border);
  background: var(--m-card);
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1001;
  padding: 20px;
  box-shadow: 0 -16px 48px rgba(0, 0, 0, 0.6);
  max-height: 80vh;
  overflow-y: auto;
}

body.mobile-shell .mobileSheetHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

body.mobile-shell .mobileSheetTitle {
  font-size: 20px;
  font-weight: 600;
}

body.mobile-shell .mobileSheetBody {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

body.mobile-shell .mobileSheetItem {
  border-radius: 12px;
  border: 1px solid var(--m-border);
  background: rgba(255,255,255,0.03);
  transition: all 0.15s ease;
  padding: 14px 16px;
  text-align: left;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
}

body.mobile-shell .mobileSheetItem:hover {
  background: rgba(255,255,255,0.06);
  border-color: var(--m-border-hover);
  transform: translateY(-1px);
}

body.mobile-shell .mobileScrim {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
}

body.mobile-shell .notificationDropdown {
  right: 0;
}

body.mobile-shell .usersTableContainer,
body.mobile-shell .filesTableContainer {
  overflow-x: auto;
}

body.mobile-shell .usersTable,
body.mobile-shell .filesTable {
  min-width: 640px;
}

/* Card hover effects */
body.mobile-shell .card:hover {
  background: var(--m-card-hover);
  border-color: var(--m-border-hover);
}

/* Better scrollbars for dark theme */
body.mobile-shell ::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

body.mobile-shell ::-webkit-scrollbar-track {
  background: transparent;
}

body.mobile-shell ::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.1);
  border-radius: 4px;
}

body.mobile-shell ::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.15);
}

/* Presence indicator */
body.mobile-shell .presence {
  display: flex;
  gap: 4px;
  align-items: center;
}

body.mobile-shell .presenceDot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--m-accent);
  box-shadow: 0 0 8px var(--m-accent-glow);
}

/* Auth card improvements */
body.mobile-shell .authCard {
  margin-top: 40px;
}

body.mobile-shell .authLogo {
  font-size: 48px;
  margin-bottom: 16px;
}

body.mobile-shell .authForm .input {
  padding: 12px 14px;
  font-size: 14px;
}

/* Header buttons */
body.mobile-shell .headerBtn,
body.mobile-shell .headerAvatar {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--m-border);
  background: rgba(255,255,255,0.03);
  color: var(--m-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 18px;
  position: relative;
}

body.mobile-shell .headerBtn:hover,
body.mobile-shell .headerAvatar:hover {
  background: rgba(255,255,255,0.06);
  border-color: var(--m-border-hover);
}

/* Notification badge */
body.mobile-shell .badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--m-accent);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Modal improvements */
body.mobile-shell .modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  padding: 20px;
}

body.mobile-shell .modalCard {
  max-height: 90vh;
  overflow-y: auto;
}

/* Board cards */
body.mobile-shell .card {
  cursor: pointer;
  position: relative;
}

body.mobile-shell .card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0;
  background: linear-gradient(135deg, rgba(59,130,246,0.1), rgba(96,165,250,0.05));
  transition: opacity 0.2s ease;
  pointer-events: none;
}

body.mobile-shell .card:hover::after {
  opacity: 1;
}

/* Small phone screens */
@media (max-width: 480px) {
  body.mobile-shell .column {
    width: calc(100vw - 48px);
  }
  
  body.mobile-shell .column:first-child,
  body.mobile-shell .column:last-child {
    margin-left: 12px;
    margin-right: 12px;
  }
  
  body.mobile-shell .mobileBoardPager {
    top: 72px;
  }
  
  body.mobile-shell .boardHeaderActions {
    gap: 8px;
  }
  
  body.mobile-shell .cardItem {
    padding: 10px;
  }
}

/* Extra small screens (iPhone SE, etc) */
@media (max-width: 375px) {
  body.mobile-shell .column {
    width: calc(100vw - 40px);
    padding: 12px;
  }
  
  body.mobile-shell .column:first-child,
  body.mobile-shell .column:last-child {
    margin-left: 10px;
    margin-right: 10px;
  }
  
  body.mobile-shell .board {
    gap: 10px;
  }
  
  body.mobile-shell .wrap {
    padding: 12px 12px calc(120px + env(safe-area-inset-bottom));
  }
  
  body.mobile-shell .mobileHeader {
    margin: 10px 10px 0;
  }
}

@media (min-width: 900px) {
  body.mobile-shell {
    max-width: 520px;
    margin: 0 auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.mobile-shell * {
    animation: none !important;
    transition: none !important;
  }
}
