/*csslint important:false, box-model:false, known-properties:false*/
/* =============================================================================
   TeamSpace Adaptive Responsive Tiers
   Tier 1: Phone (< 600px)
   Tier 2: Tablet / Medium (600px - 1199px)
   Tier 3: Desktop / Large Laptop (>= 1200px)
   ============================================================================= */

/* -----------------------------------------------------------------------------
   Tier 1: PHONE (< 600px)
   ----------------------------------------------------------------------------- */
/* -----------------------------------------------------------------------------
   Tier 1: PHONE (< 600px)
   ----------------------------------------------------------------------------- */

@media (max-width: 599px) {

  html,
  body {
    width: 100%;
    min-width: 100%;
    overflow-x: hidden;
  }

  body {
    flex-direction: column !important;
    background: #f1f5f9;
  }


  /* =========================================================
     HIDE DESKTOP ELEMENTS
     ========================================================= */

  aside.desktop-sidebar {
    display: none !important;
  }

  header.desktop-topbar {
    display: none !important;
  }


  /* =========================================================
     MOBILE TOP HEADER
     ========================================================= */

  header.mobile-topbar {
    display: flex !important;

    width: 100% !important;
    height: 58px !important;

    min-height: 58px;

    padding:
      0
      12px
      0
      12px !important;

    box-sizing: border-box;

    color: white;

    align-items: center;
    justify-content: space-between;

    flex-shrink: 0;

    position: sticky;
    top: 0;

    z-index: 95;

    box-shadow:
      0 2px 10px
      rgba(15, 23, 42, 0.15);
  }


  header.mobile-topbar > div:first-child {
    flex: 1;
    min-width: 0;
    max-width: calc(100% - 125px);
  }


  #mobileHeaderTitle {
    display: block;

    max-width: 170px;

    font-size: 0.9rem !important;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }


  header.mobile-topbar button {
    min-width: 34px !important;
    width: 34px;

    height: 34px;
    min-height: 34px !important;

    padding: 0 !important;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border-radius: 9px;

    font-size: 0.78rem !important;
  }


  /* Logout button text compact on phone */
  header.mobile-topbar button:last-child {
    width: auto;
    min-width: 44px !important;

    padding:
      0 8px !important;
  }


  /* =========================================================
     MAIN CONTENT
     ========================================================= */

  .desktop-main-wrapper {
    width: 100% !important;
    min-width: 100% !important;

    flex: 1 !important;

    height: auto !important;
    min-height: 0;

    overflow: visible;
  }


  main.main-viewport {
    width: 100% !important;

    padding:
      12px
      10px
      92px
      10px !important;

    box-sizing: border-box;

    overflow-x: hidden !important;
  }


  .view-panel {
    width: 100% !important;
    max-width: 100% !important;

    margin: 0 !important;
  }


  /* =========================================================
     CARDS
     ========================================================= */

  .card {
    width: 100%;

    padding: 13px !important;

    margin-bottom: 10px !important;

    border-radius: 12px !important;

    box-sizing: border-box;

    box-shadow:
      0 1px 4px
      rgba(15, 23, 42, 0.06);
  }


  .card-header {
    gap: 8px;

    margin-bottom: 8px;
  }


  .card-title {
    font-size: 1rem !important;

    line-height: 1.3;

    word-break: break-word;
  }


  .desktop-grid-2,
  .desktop-grid-3 {
    display: grid !important;

    grid-template-columns:
      minmax(0, 1fr) !important;

    gap: 10px !important;
  }


  /* =========================================================
     TASK FILTERS
     ========================================================= */

  .task-scope-bar,
  .task-buckets-bar {
    width: calc(100% + 20px);

    margin-left: -10px;
    margin-right: -10px;

    padding-left: 10px;
    padding-right: 10px;

    overflow-x: auto;

    display: flex;

    flex-wrap: nowrap;


    -webkit-overflow-scrolling: touch;
  }


  .task-scope-bar {
    gap: 7px;

    margin-bottom: 9px;
  }


  .task-buckets-bar {
    gap: 6px;

    margin-bottom: 13px;

    padding-bottom: 4px;
  }


  .task-scope-bar::-webkit-scrollbar,
  .task-buckets-bar::-webkit-scrollbar {
    display: none;
  }


  .scope-pill {
    flex: 0 0 auto;

    min-height: 36px;

    padding:
      7px
      12px !important;

    font-size: 0.78rem !important;

    border-radius: 18px;
  }


  .bucket-pill {
    flex: 0 0 auto;

    min-height: 33px;

    padding:
      6px
      10px !important;

    font-size: 0.75rem !important;

    border-radius: 16px;
  }


  /* =========================================================
     TASK CARD STATUS AREA
     ========================================================= */

  .status-badge {
    font-size: 0.68rem !important;
  }


  .three-dots-btn {
    width: 36px !important;
    height: 36px !important;

    min-width: 36px;

    flex-shrink: 0;
  }


  .dropdown-menu {
    position: fixed !important;

    top: auto !important;

    left: 10px !important;
    right: 10px !important;

    bottom: 74px !important;

    width: auto !important;
    min-width: 0 !important;

    border-radius: 14px !important;

    box-shadow:
      0 12px 35px
      rgba(15,23,42,.22);
  }


  .dropdown-item {
    min-height: 46px;

    font-size: 0.9rem !important;

    padding:
      11px
      14px !important;
  }


  /* =========================================================
     ATTACHMENTS INSIDE TASK
     ========================================================= */

  .attachment-pill {
    width: 100% !important;

    box-sizing: border-box;

    padding: 10px !important;

    gap: 8px !important;

    border-radius: 10px !important;

    overflow: hidden;
  }


  .attachment-pill > div {
    min-width: 0;
  }


  .attachment-pill b {
    word-break: break-word;
  }


  .attachment-pill button {
    min-height: 38px !important;

    padding:
      6px
      10px !important;

    font-size: 0.76rem !important;
  }


  /* =========================================================
     MOBILE TASK CREATE FAB
     ========================================================= */

  .mobile-task-fab {
    display: flex !important;

    position: fixed;

    right: 16px;

    bottom: 76px;

    width: 54px;
    height: 54px;

    min-width: 54px;
    min-height: 54px;

    padding: 0 !important;

    border: none;

    border-radius: 50%;

    background:
      var(
        --project-accent,
        #0284c7
      );

    color: white;

    align-items: center;
    justify-content: center;

    z-index: 89;

    box-shadow:
      0 7px 22px
      rgba(15, 23, 42, 0.28);

    font-size: 1.15rem;

    cursor: pointer;
  }


  .mobile-task-fab b {
    display: none;
  }


  .mobile-task-fab span {
    font-size: 1.3rem;
    line-height: 1;
  }


  .mobile-task-fab:active {
    transform: scale(0.94);
  }


  /* =========================================================
     MOBILE BOTTOM NAVIGATION
     ========================================================= */

  nav.mobile-bottom-nav {
    display: flex !important;

    position: fixed;

    bottom: 0;
    left: 0;
    right: 0;

    height: 66px;

    padding:
      4px
      6px
      0
      6px;

    box-sizing: border-box;

    background:
      rgba(
        255,
        255,
        255,
        0.98
      );

    border-top:
      1px solid
      #e2e8f0;

    box-shadow:
      0 -4px 15px
      rgba(15,23,42,.06);

    z-index: 90;

    overflow-x: auto;
    overflow-y: hidden;

    white-space: nowrap;

    justify-content: flex-start;
    align-items: stretch;

    gap: 2px;


    -webkit-overflow-scrolling: touch;
  }


  nav.mobile-bottom-nav::-webkit-scrollbar {
    display: none;
  }


  .mobile-nav-item {
    flex:
      1
      0
      64px;

    min-width: 64px;

    height: 58px;

    padding:
      5px
      7px !important;

    box-sizing: border-box;

    display: inline-flex;

    flex-direction: column;

    align-items: center;
    justify-content: center;

    gap: 2px;

    position: relative;

    border-radius: 10px;

    font-size: 0.67rem !important;
    font-weight: 600;

    color:
      #64748b;

    cursor: pointer;
  }


  .mobile-nav-item > span:first-child {
    font-size: 1.18rem !important;

    line-height: 1.05;
  }


  .mobile-nav-item.active {
    color:
      var(--project-accent);

    background:
      color-mix(
        in srgb,
        var(--project-accent) 9%,
        white
      );

    font-weight: 800;
  }


  /* =========================================================
     MODALS
     ========================================================= */

  .modal-backdrop {
    padding: 10px !important;

    box-sizing: border-box;
  }


  .modal-box {
    width:
      calc(
        100vw - 20px
      ) !important;

    max-width:
      calc(
        100vw - 20px
      ) !important;

    max-height:
      calc(
        100vh - 24px
      ) !important;

    border-radius: 16px !important;

    overflow: hidden;
  }


  .modal-body {
    overflow-y: auto;

    -webkit-overflow-scrolling: touch;
  }


  .modal-footer {
    gap: 8px;
  }


  .modal-footer button {
    min-height: 42px;
  }


  /* =========================================================
     INPUTS
     ========================================================= */

  input,
  select,
  textarea {
    font-size: 16px !important;
  }


  /* =========================================================
     CHAT
     ========================================================= */

  .laptop-chat-container {
    flex-direction: column !important;

    height:
      calc(
        100vh - 190px
      ) !important;

    min-height: 430px;
  }


  .laptop-chat-list {
    width: 100% !important;

    max-height: 150px !important;

    border-right: none !important;

    border-bottom:
      1px solid
      #e2e8f0 !important;
  }


  .laptop-chat-active-box {
    min-height: 0;
  }


  /* =========================================================
     TABLES
     ========================================================= */

  .table-wrap,
  .responsive-table-wrap {
    width: 100%;

    overflow-x: auto;

    -webkit-overflow-scrolling: touch;
  }


  table {
    min-width: 620px;
  }

}

/* -----------------------------------------------------------------------------
   Tier 2: TABLET / MEDIUM (600px - 1199px)
   ----------------------------------------------------------------------------- */
@media (min-width: 600px) and (max-width: 1199px) {
  body {
    flex-direction: row !important;
  }
  nav.mobile-bottom-nav {
    display: none !important;
  }
  header.mobile-topbar {
    display: none !important;
  }
  .mobile-task-fab {
    display: none !important;
  }
  aside.desktop-sidebar {
    width: 210px !important;
    display: flex !important;
  }
  .sidebar-brand {
    padding: 14px 12px !important;
  }
  .sidebar-item {
    font-size: 0.84rem !important;
    padding: 8px 10px !important;
    gap: 8px !important;
  }
  header.desktop-topbar {
    display: flex !important;
    padding: 0 16px !important;
    height: 58px !important;
  }
  main.main-viewport {
    padding: 18px !important;
  }
  .desktop-grid-2 {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
  }
  .desktop-grid-3 {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
  }
  .laptop-chat-container {
    height: calc(100vh - 170px) !important;
  }
  .laptop-chat-list {
    width: 250px !important;
  }
}

/* -----------------------------------------------------------------------------
   Tier 3: DESKTOP / LARGE LAPTOP (>= 1200px)
   ----------------------------------------------------------------------------- */
@media (min-width: 1200px) {
  body {
    flex-direction: row !important;
  }
  nav.mobile-bottom-nav {
    display: none !important;
  }
  header.mobile-topbar {
    display: none !important;
  }
  .mobile-task-fab {
    display: none !important;
  }
  aside.desktop-sidebar {
    width: 260px !important;
    display: flex !important;
  }
  header.desktop-topbar {
    display: flex !important;
  }
  .desktop-grid-2 {
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)) !important;
  }
  .desktop-grid-3 {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
  }
  .laptop-chat-list {
    width: 320px !important;
  }
}
