/* TheaCRM v2.8.622 – unified mobile workspace and attachments */

/* Upload centre --------------------------------------------------------- */
.thea-mobile-upload-centre {
  position: fixed;
  right: 1rem;
  bottom: calc(5.4rem + env(safe-area-inset-bottom, 0px));
  z-index: 2147482500;
  width: min(28rem, calc(100vw - 2rem));
  overflow: hidden;
  border: 1px solid rgba(31, 122, 58, .2);
  border-radius: 1rem;
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 16px 42px rgba(14, 45, 25, .24);
  backdrop-filter: blur(14px);
}

.thea-mobile-upload-centre[hidden] {
  display: none !important;
}

.thea-mobile-upload-centre__head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: .65rem;
  padding: .78rem .8rem .7rem;
}

.thea-mobile-upload-centre__icon {
  display: grid;
  place-items: center;
  width: 2.45rem;
  height: 2.45rem;
  border-radius: .78rem;
  color: #fff;
  background: #237840;
  font-size: 1.05rem;
}

.thea-mobile-upload-centre__copy {
  min-width: 0;
}

.thea-mobile-upload-centre__copy small,
.thea-mobile-upload-centre__copy strong,
.thea-mobile-upload-centre__copy em {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.thea-mobile-upload-centre__copy small {
  color: #6b766e;
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
}

.thea-mobile-upload-centre__copy strong {
  margin-top: .06rem;
  color: #173d24;
  font-size: .88rem;
}

.thea-mobile-upload-centre__copy em {
  margin-top: .08rem;
  color: #78817a;
  font-size: .68rem;
  font-style: normal;
}

.thea-mobile-upload-centre__percent {
  color: #275f39;
  font-size: .78rem;
  font-weight: 800;
}

.thea-mobile-upload-centre__cancel {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #6a746d;
  background: #f0f3f1;
}

.thea-mobile-upload-centre__track {
  height: .32rem;
  background: #e3eae5;
}

.thea-mobile-upload-centre__track span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #1f7a3a, #58ad6d);
  transition: width .16s ease;
}

.thea-mobile-upload-centre[data-status="success"] {
  border-color: rgba(25, 135, 84, .35);
}

.thea-mobile-upload-centre[data-status="success"] .thea-mobile-upload-centre__icon {
  background: #198754;
}

.thea-mobile-upload-centre[data-status="error"] {
  border-color: rgba(176, 42, 55, .35);
}

.thea-mobile-upload-centre[data-status="error"] .thea-mobile-upload-centre__icon {
  background: #b02a37;
}

.thea-mobile-upload-centre[data-status="error"] .thea-mobile-upload-centre__track span {
  background: #b02a37;
}

.thea-mobile-upload-centre[data-status="cancelled"] .thea-mobile-upload-centre__icon {
  background: #6c757d;
}

/* Mobile menu ----------------------------------------------------------- */
.thea-mobile-menu-search {
  position: relative;
  display: flex;
  align-items: center;
  gap: .55rem;
  margin: .2rem .9rem .85rem;
  padding: .65rem .75rem;
  border: 1px solid rgba(31, 122, 58, .15);
  border-radius: .9rem;
  background: #f7faf8;
}

.thea-mobile-menu-search > i {
  flex: 0 0 auto;
  color: #4d7458;
}

.thea-mobile-menu-search input {
  min-width: 0;
  flex: 1;
  padding: 0;
  border: 0;
  outline: 0;
  color: #173d24;
  background: transparent;
  font-size: .88rem;
}

.thea-mobile-menu-search button {
  display: grid;
  place-items: center;
  width: 1.7rem;
  height: 1.7rem;
  padding: 0;
  border: 0;
  color: #7b847d;
  background: transparent;
}

.thea-mobile-main-menu__grid.thea-mobile-main-menu__sections {
  display: block;
  padding-top: 0;
}

.thea-mobile-menu-section {
  margin: 0 0 1rem;
}

.thea-mobile-menu-section[hidden] {
  display: none !important;
}

.thea-mobile-menu-section h3 {
  margin: 0 0 .45rem;
  padding: 0 .95rem;
  color: #718078;
  font-size: .66rem;
  font-weight: 800;
  letter-spacing: .045em;
  text-transform: uppercase;
}

.thea-mobile-menu-section__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .55rem;
  padding: 0 .85rem;
}

.thea-mobile-menu-section__grid .thea-mobile-main-menu__card {
  min-width: 0;
  margin: 0;
}

.thea-mobile-menu-section__grid .thea-mobile-main-menu__card[hidden] {
  display: none !important;
}

/* Dashboard ------------------------------------------------------------- */
.thea-mobile-dashboard {
  margin-top: 1.15rem;
}

.thea-mobile-dashboard__head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: .65rem;
  padding: 0 .1rem;
}

.thea-mobile-dashboard__head p,
.thea-mobile-dashboard__head h2 {
  margin: 0;
}

.thea-mobile-dashboard__head p {
  color: #667169;
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.thea-mobile-dashboard__head h2 {
  margin-top: .08rem;
  color: #173d24;
  font-size: 1.15rem;
}

.thea-mobile-dashboard__refresh {
  display: grid;
  place-items: center;
  width: 2.45rem;
  height: 2.45rem;
  border: 1px solid rgba(31, 122, 58, .15);
  border-radius: .8rem;
  color: #2d6b40;
  background: #fff;
}

.thea-mobile-dashboard__refresh.is-loading i {
  animation: thea-mobile-spin .8s linear infinite;
}

@keyframes thea-mobile-spin {
  to { transform: rotate(360deg); }
}

.thea-mobile-dashboard__widgets {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .65rem;
}

.thea-mobile-dashboard-widget {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: .65rem;
  min-width: 0;
  padding: .8rem;
  border: 1px solid rgba(31, 122, 58, .14);
  border-radius: 1rem;
  color: inherit;
  background: #fff;
  box-shadow: 0 7px 20px rgba(18, 48, 27, .055);
  text-decoration: none;
}

.thea-mobile-dashboard-widget:nth-child(5) {
  grid-column: 1 / -1;
}

.thea-mobile-dashboard-widget__icon {
  display: grid;
  place-items: center;
  width: 2.45rem;
  height: 2.45rem;
  border-radius: .75rem;
  color: #fff;
  background: #267a42;
}

.thea-mobile-dashboard-widget__icon.is-warning {
  background: #c17818;
}

.thea-mobile-dashboard-widget__copy {
  min-width: 0;
}

.thea-mobile-dashboard-widget__copy small,
.thea-mobile-dashboard-widget__copy strong,
.thea-mobile-dashboard-widget__copy em {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.thea-mobile-dashboard-widget__copy small {
  color: #6d776f;
  font-size: .66rem;
}

.thea-mobile-dashboard-widget__copy strong {
  margin-top: .05rem;
  color: #173d24;
  font-size: 1.45rem;
  line-height: 1;
}

.thea-mobile-dashboard-widget__copy em {
  margin-top: .18rem;
  color: #7a837c;
  font-size: .62rem;
  font-style: normal;
}

.thea-mobile-dashboard-widget[data-state="error"] {
  opacity: .62;
}

.thea-mobile-dashboard__agenda {
  margin-top: .75rem;
  overflow: hidden;
  border: 1px solid rgba(31, 122, 58, .14);
  border-radius: 1rem;
  background: #fff;
  box-shadow: 0 7px 20px rgba(18, 48, 27, .055);
}

.thea-mobile-dashboard__agenda-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  padding: .78rem .85rem;
  border-bottom: 1px solid #edf1ee;
}

.thea-mobile-dashboard__agenda-head strong,
.thea-mobile-dashboard__agenda-head small {
  display: block;
}

.thea-mobile-dashboard__agenda-head strong {
  color: #173d24;
  font-size: .86rem;
}

.thea-mobile-dashboard__agenda-head small {
  margin-top: .08rem;
  color: #7a837c;
  font-size: .64rem;
}

.thea-mobile-dashboard__agenda-head > a {
  flex: 0 0 auto;
  color: #277540;
  font-size: .72rem;
  font-weight: 750;
  text-decoration: none;
}

.thea-mobile-dashboard__agenda-list {
  display: grid;
}

.thea-mobile-dashboard-task {
  display: grid;
  grid-template-columns: 3.8rem minmax(0, 1fr) auto;
  align-items: center;
  gap: .65rem;
  padding: .72rem .85rem;
  border-bottom: 1px solid #edf1ee;
  color: inherit;
  text-decoration: none;
}

.thea-mobile-dashboard-task:last-child {
  border-bottom: 0;
}

.thea-mobile-dashboard-task__time {
  color: #2d6d40;
  font-size: .74rem;
  font-weight: 800;
}

.thea-mobile-dashboard-task__copy {
  min-width: 0;
}

.thea-mobile-dashboard-task__copy strong,
.thea-mobile-dashboard-task__copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.thea-mobile-dashboard-task__copy strong {
  color: #173d24;
  font-size: .82rem;
}

.thea-mobile-dashboard-task__copy small {
  margin-top: .12rem;
  color: #78817a;
  font-size: .64rem;
}

.thea-mobile-dashboard-task > i {
  color: #8a948d;
  font-size: .75rem;
}

.thea-mobile-dashboard__loading,
.thea-mobile-dashboard__empty {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: 1rem;
  color: #737e76;
  font-size: .76rem;
}

.thea-mobile-dashboard__empty > i {
  color: #258047;
  font-size: 1.4rem;
}

.thea-mobile-dashboard__empty strong,
.thea-mobile-dashboard__empty small {
  display: block;
}

.thea-mobile-dashboard__empty strong {
  color: #365d42;
}

.thea-mobile-dashboard__empty small {
  margin-top: .12rem;
  color: #78817a;
}

/* Responsive ------------------------------------------------------------ */
@media (max-width: 767.98px) {
  .thea-mobile-upload-centre {
    right: .65rem;
    bottom: calc(5.15rem + env(safe-area-inset-bottom, 0px));
    width: calc(100vw - 1.3rem);
  }
}

@media (min-width: 640px) {
  .thea-mobile-dashboard__widgets {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .thea-mobile-dashboard-widget:nth-child(5) {
    grid-column: auto;
  }
}

@media (max-width: 390px) {
  .thea-mobile-menu-section__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .thea-mobile-upload-centre__head {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .thea-mobile-upload-centre__percent {
    grid-column: 2;
    justify-self: start;
  }

  .thea-mobile-upload-centre__cancel {
    grid-column: 3;
    grid-row: 1 / span 2;
  }
}

@media (prefers-reduced-motion: reduce) {
  .thea-mobile-upload-centre__track span {
    transition: none;
  }

  .thea-mobile-dashboard__refresh.is-loading i {
    animation: none;
  }
}


/* Indeterminate native upload ------------------------------------------- */
.thea-mobile-upload-centre[data-indeterminate="1"] .thea-mobile-upload-centre__track {
  position: relative;
  overflow: hidden;
}

.thea-mobile-upload-centre[data-indeterminate="1"] .thea-mobile-upload-centre__track span {
  position: absolute;
  left: -38%;
  width: 38% !important;
  animation: thea-mobile-upload-indeterminate 1.15s ease-in-out infinite;
}

@keyframes thea-mobile-upload-indeterminate {
  0% { left: -38%; }
  100% { left: 100%; }
}

/* Unified attachment hub ------------------------------------------------ */
.thea-attachment-hub {
  display: none;
  margin: .55rem 0;
  padding: .72rem;
  border: 1px solid rgba(31, 122, 58, .16);
  border-radius: .95rem;
  background: linear-gradient(145deg, #f4faf6, #fff);
}

.thea-attachment-hub__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .7rem;
  margin-bottom: .6rem;
}

.thea-attachment-hub__head > span:first-child small,
.thea-attachment-hub__head > span:first-child strong,
.thea-attachment-hub__summary b,
.thea-attachment-hub__summary em {
  display: block;
}

.thea-attachment-hub__head > span:first-child small {
  color: #748078;
  font-size: .61rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.thea-attachment-hub__head > span:first-child strong {
  color: #244c31;
  font-size: .82rem;
}

.thea-attachment-hub__summary {
  min-width: 0;
  text-align: right;
}

.thea-attachment-hub__summary b {
  color: #2d653e;
  font-size: .7rem;
}

.thea-attachment-hub__summary em {
  margin-top: .06rem;
  color: #7b847d;
  font-size: .62rem;
  font-style: normal;
}

.thea-attachment-hub__pickers {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .42rem;
}

.thea-attachment-hub__picker {
  display: flex;
  align-items: center;
  gap: .42rem;
  min-width: 0;
  padding: .55rem .48rem;
  border: 1px solid #d7e5da;
  border-radius: .78rem;
  color: #27623a;
  background: #fff;
  cursor: pointer;
}

.thea-attachment-hub__picker:first-child {
  border-color: #b9ddc3;
  background: #edf9f0;
}

.thea-attachment-hub__picker > i {
  flex: 0 0 auto;
  font-size: .95rem;
}

.thea-attachment-hub__picker span,
.thea-attachment-hub__picker strong,
.thea-attachment-hub__picker small {
  display: block;
  min-width: 0;
}

.thea-attachment-hub__picker strong {
  font-size: .69rem;
}

.thea-attachment-hub__picker small {
  margin-top: .05rem;
  overflow: hidden;
  color: #78817a;
  font-size: .56rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.thea-attachment-hub__files {
  display: grid;
  gap: .32rem;
  margin-top: .55rem;
}

.thea-attachment-hub__files[hidden] {
  display: none !important;
}

.thea-attachment-hub__file {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: .48rem;
  min-width: 0;
  padding: .42rem .48rem;
  border-radius: .68rem;
  background: #fff;
}

.thea-attachment-hub__file > i {
  color: #347348;
}

.thea-attachment-hub__file > span {
  min-width: 0;
}

.thea-attachment-hub__file strong,
.thea-attachment-hub__file small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.thea-attachment-hub__file strong {
  color: #294936;
  font-size: .66rem;
}

.thea-attachment-hub__file small {
  color: #7b847d;
  font-size: .57rem;
}

.thea-attachment-hub__file button {
  display: grid;
  place-items: center;
  width: 1.55rem;
  height: 1.55rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: #8b4b52;
}

@media (max-width: 767.98px) {
  .thea-attachment-hub {
    display: block;
  }

  .thea-attachment-hub__source {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
  }
}

@media (max-width: 360px) {
  .thea-attachment-hub__pickers {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .thea-mobile-upload-centre[data-indeterminate="1"] .thea-mobile-upload-centre__track span {
    animation: none;
    left: 31%;
  }
}
