/* TheaCRM v2.8.584 – chat list nav, settings/users, e-mail actions and winter mobile UX. */

.thea-settings-page-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:1rem;
  flex-wrap:wrap;
}
.thea-settings-search-v28584{
  position:relative;
  max-width:620px;
}
.thea-settings-search-v28584 > i{
  position:absolute;
  left:.9rem;
  top:50%;
  transform:translateY(-50%);
  color:#667085;
  pointer-events:none;
}
.thea-settings-search-v28584 .form-control{
  min-height:46px;
  padding-left:2.55rem;
  border-radius:14px;
}
.thea-settings-grid [data-thea-settings-card-v28584][hidden]{display:none !important;}
.thea-settings-grid .card{transition:transform .14s ease, box-shadow .14s ease;}
.thea-settings-grid .card:hover{transform:translateY(-1px);}

/* E-mail: compact sticky toolbar and safe dropdown. */
.email-detail-toolbar-v28584 .dropdown-menu{
  min-width:min(320px, calc(100vw - 24px));
  max-height:min(72vh, 620px);
  overflow:auto;
}
.email-detail-toolbar-v28584 .dropdown-item{
  min-height:42px;
  display:flex;
  align-items:center;
}
.email-detail-toolbar-v28584 .email-action-menu-form{margin:0;}

/* Main mobile menu: active module is visible without changing permissions/order. */
@media (max-width:767.98px){
  .thea-mobile-main-menu__card.is-active,
  .thea-mobile-main-menu__card[aria-current="page"]{
    background:#dff2e4;
    color:var(--thea-mobile-menu-blue, #1f6b3a);
    box-shadow:inset 0 0 0 2px rgba(31,107,58,.18);
  }

  .thea-page,
  .responsive-container,
  .thea-winter-page{
    width:100%;
    max-width:100%;
    padding-left:10px !important;
    padding-right:10px !important;
  }
  .thea-settings-page-head > .btn,
  .thea-winter-header > .btn{width:100%;}
  .thea-settings-grid{--bs-gutter-x:.75rem;--bs-gutter-y:.75rem;}
  .thea-settings-grid .card-body{
    padding:.9rem !important;
    gap:.75rem !important;
  }
  .thea-settings-grid .card-body .fs-3{font-size:1.45rem !important;}
  .thea-settings-grid h2{font-size:1rem !important;}
  .thea-settings-grid p{line-height:1.3;}
  .thea-settings-page-v28584 .card-body,
  .thea-page .card-body{overflow-wrap:anywhere;}
  .thea-page table code{white-space:normal;overflow-wrap:anywhere;}
  .thea-page .table-responsive{border-radius:12px;}

  /* User settings/forms: buttons and cards remain reachable above bottom nav. */
  .responsive-container > .bg-white{
    padding:1rem !important;
    border-radius:14px !important;
  }
  .responsive-container form .form-control,
  .responsive-container form .form-select{
    min-height:46px;
  }
  .thea-user-form-actions-v28584{
    display:grid !important;
    grid-template-columns:1fr 1fr;
    width:100%;
  }
  .thea-user-form-actions-v28584 > *,
  .thea-user-form-actions-v28584 .btn{width:100%;}
  .thea-user-form-actions-v28584 .thea-user-delete-v28584{grid-column:1 / -1;}

  /* Winter maintenance: card list instead of a ten-column horizontal table. */
  .thea-winter-header{align-items:stretch !important;}
  .thea-winter-header h1{font-size:1.25rem;line-height:1.25;}
  .thea-winter-filter-actions-v28584{
    display:grid !important;
    grid-template-columns:1fr 1fr;
    gap:.5rem;
  }
  .thea-winter-filter-actions-v28584 .btn{width:100%;margin:0 !important;}
  .thea-winter-mobile-card-v28584{
    border:1px solid rgba(0,0,0,.09);
    border-radius:16px;
    background:#fff;
    padding:1rem;
    margin-bottom:.75rem;
    box-shadow:0 3px 12px rgba(16,24,40,.05);
  }
  .thea-winter-mobile-card-v28584__head{
    display:flex;
    justify-content:space-between;
    align-items:flex-start;
    gap:.75rem;
    margin-bottom:.7rem;
  }
  .thea-winter-mobile-card-v28584__head strong{font-size:1rem;}
  .thea-winter-mobile-card-v28584__time{font-weight:800;color:#1f6b3a;white-space:nowrap;}
  .thea-winter-mobile-card-v28584__meta{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:.45rem .75rem;
    font-size:.88rem;
  }
  .thea-winter-mobile-card-v28584__meta span{min-width:0;overflow-wrap:anywhere;}
  .thea-winter-mobile-card-v28584__note{
    margin-top:.7rem;
    padding-top:.7rem;
    border-top:1px solid rgba(0,0,0,.07);
    color:#475467;
    white-space:pre-wrap;
    overflow-wrap:anywhere;
  }
  .thea-winter-mobile-card-v28584__actions{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:.5rem;
    margin-top:.8rem;
  }
  .thea-winter-mobile-card-v28584__actions .btn,
  .thea-winter-mobile-card-v28584__actions form{width:100%;}
  .thea-winter-page .card-header{
    flex-wrap:wrap;
    gap:.6rem;
  }
  .thea-winter-page .card-header .form-check{
    display:block !important;
    margin:.55rem 0 0 !important;
  }
  .thea-winter-page .card-header > button{width:100%;}
  .thea-winter-page .d-flex.justify-content-between:last-child{
    gap:.6rem;
    flex-wrap:wrap;
  }
  .thea-winter-page .d-flex.justify-content-between:last-child > *{
    flex:1 1 140px;
  }
}

@media (max-width:380px){
  .thea-user-form-actions-v28584,
  .thea-winter-filter-actions-v28584,
  .thea-winter-mobile-card-v28584__actions{grid-template-columns:1fr;}
  .thea-winter-mobile-card-v28584__meta{grid-template-columns:1fr;}
}

/* After the audit only three secondary e-mail actions remain visible. */
.email-action-secondary{grid-template-columns:repeat(3,minmax(0,1fr)) !important;}
@media (max-width:575.98px){
  .email-action-secondary{grid-template-columns:1fr 1fr !important;}
  .email-action-secondary > .email-action-more:last-child{grid-column:1 / -1;}
  .thea-settings-page-v28584 form > .btn[type="submit"]{width:100%;min-height:46px;}
}
