/*
  ServiceHub mobile refinement layer.
  Desktop layout is intentionally untouched: every visual rule below is scoped to
  small screens only.
*/
@media (max-width: 767.98px){
  html{scroll-padding-top:72px;}
  body{font-size:.95rem;}

  .container,
  .app-container-wide{
    width:100% !important;
    max-width:100% !important;
    padding-left:.75rem !important;
    padding-right:.75rem !important;
  }

  body > .container.py-4,
  body > .app-container-wide.py-4{
    padding-top:1rem !important;
    padding-bottom:1rem !important;
  }

  .navbar .container,
  .navbar .app-container-wide{
    padding-left:.75rem !important;
    padding-right:.75rem !important;
  }

  .navbar-brand{
    max-width:calc(100vw - 5.25rem);
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
    font-size:1rem;
  }

  .navbar-collapse{padding-top:.75rem;}
  .navbar-nav .nav-link{padding:.65rem 0;}
  .navbar .d-flex.gap-2.align-items-center{
    width:100%;
    flex-direction:column;
    align-items:stretch !important;
    gap:.5rem !important;
    padding-top:.5rem;
  }
  .navbar .btn,
  .navbar select{width:100% !important;}
  .navbar-text{display:block; text-align:center;}

  h1,.h1{font-size:1.65rem;}
  h2,.h2{font-size:1.45rem;}
  h3,.h3{font-size:1.28rem;}
  h4,.h4{font-size:1.12rem;}
  h5,.h5{font-size:1.02rem;}

  .card{border-radius:.85rem;}
  .card-body{padding:1rem !important;}
  .card-header,
  .card-footer{padding:.85rem 1rem !important;}
  .shadow-sm{box-shadow:0 .25rem .9rem rgba(0,0,0,.06) !important;}

  .alert{padding:.85rem; border-radius:.75rem;}
  .form-label{margin-bottom:.3rem; font-size:.92rem;}
  .form-control,
  .form-select{min-height:44px; font-size:16px;}
  textarea.form-control{min-height:96px;}
  .form-text,.small,small{line-height:1.35;}

  .btn{
    min-height:42px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    white-space:normal;
    line-height:1.2;
  }

  .card-body > .d-flex.justify-content-between,
  .card-body > .d-flex.align-items-center,
  .d-flex.justify-content-between.align-items-start,
  .d-flex.justify-content-between.align-items-center,
  form .d-flex.gap-2{
    flex-wrap:wrap !important;
    gap:.5rem !important;
  }

  form .d-flex.gap-2 > .btn,
  form .d-flex.gap-2 > a.btn,
  .card-body > .d-flex.gap-2 > .btn,
  .card-body > .d-flex.gap-2 > a.btn{
    flex:1 1 100%;
  }

  .input-group[data-file-input-wrapper]{
    display:flex;
    flex-direction:column;
    gap:.5rem;
  }
  .input-group[data-file-input-wrapper] .btn,
  .input-group[data-file-input-wrapper] .file-input-display{
    width:100%;
    border-radius:.5rem !important;
  }
  .file-input-display{text-overflow:ellipsis;}

  .company-cards{gap:.75rem !important;}
  .company-card{
    flex-direction:column !important;
    gap:.6rem;
  }
  .company-card .logo{
    max-width:100% !important;
    align-self:flex-start;
    margin-left:0 !important;
  }

  .service-summary-card{padding:.85rem !important;}
  .service-summary-card .summary-value{word-break:break-word;}

  .servicehub-filter-grid{grid-template-columns:1fr !important;}
  .servicehub-filter-grid .filter-search{grid-column:auto !important; min-width:0 !important;}
  .servicehub-filter-grid .filter-actions{
    width:100%;
    min-width:0 !important;
    flex-direction:column;
    align-items:stretch !important;
  }
  .servicehub-filter-grid .filter-actions .btn{width:100%;}

  .servicehub-table-card .card-body{padding:.75rem !important;}
  .mobile-card-table-wrapper{overflow:visible !important;}
  .mobile-card-table,
  .servicehub-ops-table.mobile-card-table{
    min-width:0 !important;
    width:100% !important;
    border-collapse:separate !important;
    border-spacing:0 .75rem !important;
  }
  .mobile-card-table thead{display:none;}
  .mobile-card-table,
  .mobile-card-table tbody,
  .mobile-card-table tr,
  .mobile-card-table td{
    display:block;
    width:100% !important;
  }
  .mobile-card-table tr{
    background:#fff;
    border:1px solid var(--bs-border-color);
    border-radius:.85rem;
    padding:.55rem .75rem;
    box-shadow:0 .2rem .75rem rgba(0,0,0,.045);
  }

  .mobile-card-table tr[data-mobile-card-href]{
    cursor:pointer;
    position:relative;
  }
  .mobile-card-table tr[data-mobile-card-href]:active{
    transform:scale(.997);
  }
  .mobile-card-table .mobile-card-open{
    display:none !important;
  }
  .mobile-card-table .mobile-hide-unavailable-action{
    display:none !important;
  }
  .mobile-card-table td.mobile-card-actions-empty{
    display:none !important;
  }
  .mobile-card-table td{
    border:0 !important;
    padding:.38rem 0 !important;
    min-height:1.85rem;
    white-space:normal !important;
    word-break:break-word;
  }
  .mobile-card-table td:not([data-label=""]){
    display:grid;
    grid-template-columns:minmax(7.5rem, 40%) 1fr;
    gap:.65rem;
    align-items:start;
  }
  .mobile-card-table td:not([data-label=""])::before{
    content:attr(data-label);
    color:var(--bs-secondary-color);
    font-weight:600;
    font-size:.82rem;
    line-height:1.25;
  }
  .mobile-card-table td[data-label=""]{
    display:flex;
    flex-direction:column;
    gap:.45rem;
  }
  .mobile-card-table td.text-end,
  .mobile-card-table td .text-end{text-align:left !important;}
  .mobile-card-table td > .btn,
  .mobile-card-table td > a.btn,
  .mobile-card-table td > form,
  .mobile-card-table td > form .btn,
  .mobile-card-table td .dropdown,
  .mobile-card-table td .dropdown > .btn{
    width:100%;
  }
  .mobile-card-table td > form.d-inline{display:block !important;}
  .mobile-card-table td .btn{margin:.12rem 0;}

  .servicehub-ops-actions{
    width:100%;
    flex-direction:column;
    align-items:stretch !important;
    justify-content:flex-start !important;
    gap:.4rem !important;
  }
  .servicehub-ops-actions .btn,
  .servicehub-ops-actions .dropdown,
  .servicehub-ops-actions .dropdown-toggle{width:100%;}
  .servicehub-ops-actions .dropdown-menu{width:100%;}
  .servicehub-badges{align-items:flex-start;}
  .servicehub-badges .badge{width:fit-content; max-width:100%;}

  .table-responsive:not(.mobile-card-table-wrapper){
    border:1px solid var(--bs-border-color);
    border-radius:.75rem;
  }
  .table-responsive:not(.mobile-card-table-wrapper) > table{margin-bottom:0;}

  .nav-tabs{
    gap:.35rem;
    border-bottom:0;
  }
  .nav-tabs .nav-item{flex:1 1 100%;}
  .nav-tabs .nav-link{
    width:100%;
    border:1px solid var(--bs-border-color);
    border-radius:.65rem;
    text-align:left;
  }

  canvas[id*="Sig"],
  #sigCanvas,
  #techSigCanvas{
    min-height:180px;
  }

  footer{margin-top:1rem !important;}
}

@media (max-width: 575.98px){
  .container,
  .app-container-wide{
    padding-left:.6rem !important;
    padding-right:.6rem !important;
  }
  .card-body{padding:.85rem !important;}
  .mobile-card-table td:not([data-label=""]){
    grid-template-columns:1fr;
    gap:.15rem;
  }
  .mobile-card-table td:not([data-label=""])::before{font-size:.78rem;}
  .badge{white-space:normal; text-align:left;}
}

@media (max-width: 767.98px){
  .servicehub-notification-center .card-body{padding:.95rem !important;}
  .servicehub-notification-center .list-group-item{
    display:block !important;
    padding:.85rem 0 !important;
  }
  .servicehub-notification-center .list-group-item > .badge,
  .servicehub-notification-center .list-group-item .badge{
    width:fit-content;
    margin-top:.35rem;
  }
  .servicehub-notification-center .servicehub-action-list .list-group-item:nth-of-type(n+4){
    display:none !important;
  }
  .servicehub-activity-summary .list-group-item{
    display:flex !important;
  }
}

/* Notification clarity v13.5: make grouped activity rows feel clickable */
.servicehub-activity-link {
  text-decoration: none;
}
.servicehub-activity-link:hover {
  text-decoration: none;
}
