/* AllSet Space mobile shell. Activated by html.allset-mobile. */

html.allset-mobile {
  zoom: 1 !important;
  width: 100vw !important;
  height: 100dvh !important;
  min-height: 100dvh !important;
  overflow: hidden !important;
}

html.allset-mobile body {
  width: 100vw !important;
  height: 100dvh !important;
  min-height: 100dvh !important;
  overflow: hidden !important;
  -webkit-text-size-adjust: 100%;
  touch-action: manipulation;
}

html.allset-mobile .app-container {
  width: 100vw !important;
  height: 100dvh !important;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

html.allset-mobile .main-wrapper {
  width: 100%;
  min-width: 0;
  height: 100%;
  padding: max(12px, env(safe-area-inset-top)) 12px calc(84px + env(safe-area-inset-bottom));
  overflow: hidden;
}

html.allset-mobile .app-header {
  height: auto;
  min-height: 56px;
  padding: 0 0 12px;
  margin-bottom: 10px;
  align-items: flex-start;
  gap: 10px;
  border-bottom: 1px solid var(--border-color);
}

html.allset-mobile .header-title-container {
  min-width: 0;
}

html.allset-mobile .view-title {
  font-size: 22px;
  line-height: 1.12;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

html.allset-mobile .sync-badge {
  display: none;
}

html.allset-mobile .header-actions {
  flex: 1 1 100%;
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px 38px;
  gap: 8px;
}

html.allset-mobile .search-bar {
  width: 100%;
  min-width: 0;
}

html.allset-mobile .search-bar input {
  width: 100%;
  min-width: 0;
  font-size: 14px;
}

html.allset-mobile .btn-icon-header {
  width: 38px;
  height: 38px;
}

html.allset-mobile .view-panel {
  min-height: 0;
  height: 100%;
  overflow: auto;
}

html.allset-mobile .sidebar,
html.allset-mobile .app-container.sidebar-collapsed .sidebar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 150;
  width: 100vw !important;
  height: calc(68px + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  border-right: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(4, 20, 14, 0.96);
  backdrop-filter: blur(16px);
  transition: none;
}

html.allset-mobile .sidebar-brand,
html.allset-mobile .sidebar-footer,
html.allset-mobile .app-container.sidebar-collapsed .sidebar-brand,
html.allset-mobile .app-container.sidebar-collapsed .sidebar-footer {
  display: none;
}

html.allset-mobile .sidebar-menu,
html.allset-mobile .app-container.sidebar-collapsed .sidebar-menu {
  height: 68px;
  padding: 8px 8px 10px;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(72px, 1fr);
  gap: 4px;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}

html.allset-mobile .sidebar-menu::-webkit-scrollbar {
  display: none;
}

html.allset-mobile .menu-item,
html.allset-mobile .app-container.sidebar-collapsed .menu-item {
  min-width: 72px;
  height: 52px;
  padding: 6px 8px;
  border-radius: 14px;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  font-size: 10px;
  line-height: 1.1;
  white-space: nowrap;
}

html.allset-mobile .menu-item i,
html.allset-mobile .app-container.sidebar-collapsed .menu-item i {
  width: auto;
  font-size: 17px;
}

html.allset-mobile .menu-item span,
html.allset-mobile .app-container.sidebar-collapsed .menu-item span {
  display: block;
  max-width: 68px;
  overflow: hidden;
  text-overflow: ellipsis;
}

html.allset-mobile .board-toolbar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  padding-bottom: 10px;
  margin-bottom: 10px;
}

html.allset-mobile .toolbar-left,
html.allset-mobile .toolbar-right {
  width: 100%;
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 8px;
  padding-bottom: 2px;
  scrollbar-width: none;
}

html.allset-mobile .toolbar-right .btn-primary,
html.allset-mobile .toolbar-right .btn-secondary {
  min-height: 42px;
  padding: 8px 14px;
  font-size: 12px;
  line-height: 1.15;
  white-space: nowrap;
  flex: 0 0 auto;
}

html.allset-mobile .toolbar-left::-webkit-scrollbar,
html.allset-mobile .toolbar-right::-webkit-scrollbar {
  display: none;
}

html.allset-mobile .width-slider-container:first-child {
  display: none;
}

html.allset-mobile .manager-filter-control,
html.allset-mobile .manager-filter-toggle {
  min-width: max-content;
}

html.allset-mobile .manager-filter-popover {
  position: fixed;
  left: 12px;
  right: 12px;
  top: 92px;
  width: auto;
  max-height: min(420px, calc(100dvh - 180px));
}

html.allset-mobile .task-status-dashboard {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scroll-snap-type: x proximity;
}

html.allset-mobile .task-status-summary-card {
  min-width: 148px;
  scroll-snap-align: start;
}

html.allset-mobile .board-content-area {
  min-height: 0;
  height: calc(100% - 132px);
  display: block;
  overflow: hidden;
}

html.allset-mobile .columns-container {
  height: 100%;
  gap: 12px;
  padding: 0 2px 12px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  align-items: stretch;
}

html.allset-mobile .board-column {
  width: calc(100vw - 52px);
  min-width: calc(100vw - 52px);
  max-width: calc(100vw - 52px);
  max-height: 100%;
  border-radius: 18px;
  scroll-snap-align: center;
  cursor: default;
}

html.allset-mobile .column-header {
  padding: 14px 14px;
}

html.allset-mobile .column-title {
  font-size: 13px;
}

html.allset-mobile .column-actions {
  gap: 2px;
}

html.allset-mobile .btn-column-tool {
  width: 32px;
  height: 32px;
  border-radius: 10px;
}

html.allset-mobile .task-list {
  min-height: 0;
  overflow-y: auto;
}

html.allset-mobile .task-card {
  border-radius: 16px;
}

html.allset-mobile .task-detail-panel {
  position: fixed;
  inset: 0 0 calc(68px + env(safe-area-inset-bottom));
  z-index: 140;
  width: 100vw !important;
  min-width: 0 !important;
  height: auto;
  border-left: 0;
  border-top: 1px solid var(--border-color);
  transform: translateY(100%);
  transition: transform 0.24s ease, opacity 0.2s ease;
}

html.allset-mobile .task-detail-panel.open {
  width: 100vw !important;
  min-width: 0 !important;
  opacity: 1;
  transform: translateY(0);
}

html.allset-mobile .tdp-header {
  padding: max(12px, env(safe-area-inset-top)) 12px 12px;
}

html.allset-mobile .tdp-title-wrap h3 {
  font-size: 14px;
}

html.allset-mobile .tdp-header-actions .btn-column-tool {
  width: 36px;
  height: 36px;
}

html.allset-mobile .tdp-tabs {
  flex-wrap: nowrap;
  overflow-x: auto;
}

html.allset-mobile .tdp-tabs .task-tab-btn {
  flex: 0 0 auto;
  min-width: 92px;
  padding: 12px 10px;
}

html.allset-mobile .tdp-tab-content-container {
  min-height: 0;
}

html.allset-mobile #tdp-content-info-log,
html.allset-mobile #tdp-content-desc,
html.allset-mobile #tdp-content-subtasks,
html.allset-mobile #tdp-content-child-subtasks {
  padding: 14px;
}

html.allset-mobile .tdp-chat-input-area,
html.allset-mobile .chat-input-area {
  padding-bottom: max(10px, env(safe-area-inset-bottom));
}

html.allset-mobile .profile-layout,
html.allset-mobile .kpi-layout,
html.allset-mobile .integration-grid,
html.allset-mobile .dashboard-row,
html.allset-mobile .dashboard-main-grid,
html.allset-mobile .dashboard-hero-grid,
html.allset-mobile .dashboard-expanded-cards,
html.allset-mobile .dashboard-secondary-grid {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 12px !important;
}

html.allset-mobile .profile-card-main,
html.allset-mobile .profile-tasks-widget,
html.allset-mobile .kpi-widget,
html.allset-mobile .integration-card,
html.allset-mobile .dashboard-card,
html.allset-mobile .dashboard-health-card,
html.allset-mobile .dashboard-mix-card,
html.allset-mobile .dashboard-list-card {
  border-radius: 18px;
}

html.allset-mobile .profile-hero {
  align-items: flex-start;
}

html.allset-mobile .profile-stats-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

html.allset-mobile .sales-table-card,
html.allset-mobile .chats-panel-container {
  height: 100%;
  border-radius: 18px;
}

html.allset-mobile .table-toolbar {
  padding: 12px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

html.allset-mobile .table-actions {
  display: flex;
  gap: 8px;
  overflow-x: auto;
}

html.allset-mobile .table-title {
  font-size: 16px;
}

html.allset-mobile .table-container {
  overflow: auto;
}

html.allset-mobile .sales-table {
  min-width: 920px;
  font-size: 12px;
}

html.allset-mobile .sales-table th,
html.allset-mobile .sales-table td {
  padding: 12px 14px;
}

html.allset-mobile .chats-panel-container {
  display: grid;
  grid-template-rows: minmax(210px, 38%) minmax(0, 1fr);
}

html.allset-mobile .chats-list-sidebar {
  width: 100%;
  min-width: 0;
  border-right: 0;
  border-bottom: 1px solid var(--border-color);
}

html.allset-mobile .chats-sidebar-header {
  padding: 12px;
}

html.allset-mobile .chats-filter-tabs {
  overflow-x: auto;
  padding: 8px 10px 0;
}

html.allset-mobile .chat-window-header {
  padding: 12px;
}

html.allset-mobile .chat-messages-feed,
html.allset-mobile .tdp-chat-feed {
  padding: 12px;
}

html.allset-mobile .message-bubble {
  max-width: 92%;
}

html.allset-mobile .modal-content,
html.allset-mobile .modal-content.wide,
html.allset-mobile .sale-modal-content,
html.allset-mobile .onboarding-modal-content {
  width: 100vw;
  height: 100dvh;
  max-height: 100dvh;
  border-radius: 0;
  border-left: 0;
  border-right: 0;
}

html.allset-mobile .modal-header {
  padding-top: max(16px, env(safe-area-inset-top));
}

html.allset-mobile .modal-body,
html.allset-mobile .sale-modal-body {
  min-height: 0;
  overflow-y: auto;
}

html.allset-mobile .sale-form-grid,
html.allset-mobile .supplier-row,
html.allset-mobile .delivery-row,
html.allset-mobile .task-detail-split {
  grid-template-columns: 1fr !important;
}

html.allset-mobile .modal-footer {
  padding-bottom: max(16px, env(safe-area-inset-bottom));
}

html.allset-mobile .login-overlay {
  padding: max(14px, env(safe-area-inset-top)) 14px max(14px, env(safe-area-inset-bottom));
  align-items: center;
}

html.allset-mobile .login-card {
  width: min(100%, 430px);
  max-height: calc(100dvh - 28px);
  overflow-y: auto;
  padding: 24px 18px;
  border-radius: 22px;
}

html.allset-mobile button,
html.allset-mobile input,
html.allset-mobile select,
html.allset-mobile textarea {
  font-size: max(14px, 1rem);
}

html.allset-mobile .btn-primary,
html.allset-mobile .btn-secondary {
  min-height: 38px;
  justify-content: center;
}

@media (hover: none) and (pointer: coarse) {
  html.allset-mobile .btn-primary:hover,
  html.allset-mobile .dashboard-stat-card:hover,
  html.allset-mobile .leaderboard-item:hover {
    transform: none;
  }
}
