/**
 * SuiteCRM is a customer relationship management program developed by SalesAgility Ltd.
 * Copyright (C) 2021 SalesAgility Ltd.
 *
 * This program is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Affero General Public License version 3 as published by the
 * Free Software Foundation with the addition of the following permission added
 * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
 * IN WHICH THE COPYRIGHT IS OWNED BY SALESAGILITY, SALESAGILITY DISCLAIMS THE
 * WARRANTY OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
 * details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see http://www.gnu.org/licenses.
 *
 * In accordance with Section 7(b) of the GNU Affero General Public License
 * version 3, these Appropriate Legal Notices must retain the display of the
 * "Supercharged by SuiteCRM" logo. If the display of the logos is not reasonably
 * feasible for technical reasons, the Appropriate Legal Notices must display
 * the words "Supercharged by SuiteCRM".
 */
/**** Panels ****/

.panel {
  margin-top: 1.5em;
  margin-bottom: 0px;
}

.panel-body {
  padding: 0;
}

.panel-template {
  visibility: collapse;
}

.panel-default > .panel-heading {
  background: $panel-default-bg;
  color: $panel-expanded-color;
  padding: 0;
  height: 4rem;
}

.panel-default > .panel-heading > div {
  font-size: 14px ;
  font-weight: 500;
  background-color: $panel-expanded-bg;
  color: $panel-expanded-color;
  vertical-align: middle;
}

.panel-default > .panel-body {
  padding: 0;
}

.collapse, .collapsing, .collapse.in {
  transition: none;
  -webkit-transition: none;
}

.panel-default > .panel-heading {
  display: block;
}

.panel-default > .panel-heading > a {
  display: block;
  font-weight: 500;
  color: $panel-expanded-color;
  padding: 0 10px 0 10px;
  border-top-left-radius: 4px;
  border-top-right-radius: 4px;
  text-decoration: none;
  div {
    margin-left: 0.3em;
  }
}

.sub-panel > .panel-heading {
  background: $panel-expanded-bg;
  line-height: $panel-header-height;
  border-bottom-width: 0px;
  padding-top: 0.3em;
}

.subpanel-icon {
  margin: 0 4px 0 4px;
  line-height: $panel-header-height;
}

.panel-default.sub-panel > .panel-heading  > a {
  display: block;
  font-size: $panel-header-font-size;
  font-weight: 500;
  color: $panel-expanded-color;
  padding: 0 10px 0 10px;
  border-top-left-radius: 4px;
  border-top-right-radius: 4px;
  height: $panel-header-height;
  text-decoration: none;
  div {
    margin-left: 0;
  }
}

.panel-default > .panel-heading  > a:not(.panel-heading a div) {
  background-color: $panel-expanded-bg;
}

.sub-panel  div.tab-content {
  padding: 0 ;
  border: none;
}

.panel-default > .panel-heading > a img {
  margin-right: 15px;
}

.panel-default > .panel-body {
  padding: 0 0 0 0;
}

.panel-heading a.collapsed {
  background-color: $panel-collapsed-bg ;
}

div.panel-heading a.collapsed-override {
  background-color: $panel-expanded-bg ;
}

.panel-heading a.collapsed:before {
  border-bottom-left-radius: 2px;
  border-bottom-right-radius: 2px;
  vertical-align: middle;
  margin: 0;
  content: '\002B';
}

.panel-heading a {
  border-bottom-left-radius: 2px;
  border-bottom-right-radius: 2px;
  vertical-align: middle;
  margin: 0;
}

.panel-heading a:before {
  float: left;
  border: 1px solid $outline-border-light;
  @include border-radius (0.2rem);
  font-size: 13px;
  content: "\2212";
  width: 1.5em;
  height: 1.5em;
  position: relative;
  top: 0.5em;
  font-weight: bold;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.panel-heading a.collapsed:hover::before {
  background: $white;
  color: $midnight-blue;
}

.panel-heading a:hover::before {
  background: $white;
  color: $midnight-blue;
}

.panel-heading a div.edit-panel {
  line-height: $panel-header-height + 3px;
  margin-left: 0.3em;
}

.sub-panel > .panel-body > .tab-content > div {
  border: none;
}

.sub-panel > .panel-body > .tab-content > div tr:last-child {
  margin-bottom: 25px ;
  border-bottom: none;
}

.h3Row {
  padding: 0;
  margin: 0;
}

div.action_buttons form {
  float: left;
}

div.action_buttons .button {
  background-color: $danger-btn-bg;
}
div.action_buttons .button:hover {
  background-color: $danger-btn-bg-hover;
}

#subpanel_list .tab-content .list.view.subpanel-table .pagination div.action_buttons .button {
  padding: 5px 13px;
  line-height: initial;
  height: initial;
  text-transform: capitalize;
}

div.sub-panel {
  margin-bottom: 0.8em;
  margin-top: 0;
}

.subpanel-table tr:last-of-type td {
  border-bottom: 0px solid transparent;
}

.subpanel-table {
  border-bottom-left-radius: 4px;
  border-bottom-right-radius: 4px;
}

.table-responsive.list .pagination,
.table-responsive.list .pagination tr,
.table-responsive.list .pagination  td,
.table-responsive.list .pagination  th {
  border: 0;
}

.sub-panel tbody tr td .sugar_action_button > a:link {
  border-bottom: none;
  color: $list-view-button-color;
  padding-top: 0px;
  padding-bottom: 0px;
}

.sub-panel .sugar_action_button > a:hover {
  border-bottom: none;
  color: $list-view-button-color;
}

.sub-panel .table-responsive.list > tbody > tr > td ul.subnav a {
  color: $list-view-button-color;
  width: 100%;
}

.sub-panel .table-responsive.list > tbody > tr > td ul.subnav a:hover {
  color: $list-view-button-color;
  width: 100%;
}

.footable-details.table-responsive.list th {
  font-weight: bold;
  color: $main-font-color;
}

.footable-details.table-responsive.list th a:link {
  font-weight: bold;
  color: $main-font-color;
  border-bottom: none;
}

.subpanel-table .clickMenu > li, .SugarActionMenuIESub li {
  padding: 0;
  line-height: 24px;
  white-space: nowrap;
}

.subpanel-table ul.subpanel {
  background: none;
  background-color: transparent ;
  border: none;
  border-color: transparent ;
}

.sugar_action_button a {
  color: $panel-expanded-color;
}

.subpanel-table .pagination li.sugar_action_button > form > a {
  width: 100%;
}

.subpanel-table ul.subpanel > a {
  background-color: $panel-button-bg;
  padding: 0;
  padding-right: 4px;
  border: 1px solid transparent;
  border-radius: $border-radius-base;
}

.subpanel-table li.sugar_action_button {
  background-color: $panel-button-bg;
  padding: 0;
  padding-right: 4px;
  border: 1px solid transparent;
  border-radius: $border-radius-base;
}

.subpanel-table .pagination .sugar_action_button {
  background-color: $transparent-color;
  padding: 0 ;
  padding-right: 4px ;
  border: 1px solid transparent;
  border-radius: $border-radius-base;
}

.subpanel-table .pagination li.sugar_action_button > form > a {
  background-color: $panel-button-bg;
  padding: 0 ;
  padding-right: 4px ;
  border: 1px solid transparent;
  border-radius: $border-radius-base;
}

.subpanel-table .pagination .sugar_action_button > form > a{
  background-color: $panel-button-bg;
  padding: 0 ;
  padding-right: 4px ;
  border: 1px solid transparent;
  border-radius: $border-radius-base;
}

.subpanel-table .pagination .sugar_action_button > form > a {
  background-color: $panel-button-bg;
  padding: 0 ;
  padding-right: 4px ;
  border: 1px solid transparent;
  border-radius: $border-radius-base;
}

.subpanel-table {
  .pagination {
    td {
      table
      {
        tr:last-child {
          border-bottom-left-radius: 10px;
        }
      }
    }
  }
}

/*calendar popup fix*/
.calcell > a {
  background-color: $panel-bg;
}

/* pagination on list view subpanel-table */

.subpanel-table.list tr.pagination span.pageNumbers {
  position: relative;
}


.subpanel-table.list tr.pagination button.button[name="listViewStartButton"] img,
.subpanel-table.list tr.pagination button.button[name="listViewPrevButton"] img,
.subpanel-table.list tr.pagination button.button[name="listViewNextButton"] img,
.subpanel-table.list tr.pagination button.button[name="listViewEndButton"] img {
  cursor: pointer;
}

.subpanel-table.list tr.pagination button.button[name="listViewStartButton"],
.subpanel-table.list tr.pagination button.button[name="listViewPrevButton"],
.subpanel-table.list tr.pagination button.button[name="listViewNextButton"],
.subpanel-table.list tr.pagination button.button[name="listViewEndButton"] {
  padding: 0;
  margin: 0;
  width: 26px;
  height: auto;
}
.subpanel-table.list tr.pagination button.button[name="listViewStartButton"]:hover,
.subpanel-table.list tr.pagination button.button[name="listViewPrevButton"]:hover,
.subpanel-table.list tr.pagination button.button[name="listViewNextButton"]:hover,
.subpanel-table.list tr.pagination button.button[name="listViewEndButton"]:hover {
  background-color: transparent;
}

.subpanel-table.list tr.pagination button.button[name="listViewStartButton"][disabled],
.subpanel-table.list tr.pagination button.button[name="listViewPrevButton"][disabled],
.subpanel-table.list tr.pagination button.button[name="listViewNextButton"][disabled],
.subpanel-table.list tr.pagination button.button[name="listViewEndButton"][disabled] {
  cursor: default;
  background-color: transparent;
}

.subpanel-table.list tr.pagination button.button[name="listViewStartButton"],
.subpanel-table.list tr.pagination button.button[name="listViewPrevButton"],
.subpanel-table.list tr.pagination button.button[name="listViewNextButton"],
.subpanel-table.list tr.pagination button.button[name="listViewEndButton"],
.subpanel-table.list tr.pagination button.button[name="listViewStartButton"][disabled]:hover,
.subpanel-table.list tr.pagination button.button[name="listViewPrevButton"][disabled]:hover,
.subpanel-table.list tr.pagination button.button[name="listViewNextButton"][disabled]:hover,
.subpanel-table.list tr.pagination button.button[name="listViewEndButton"][disabled]:hover {
  background-color: transparent;
}

.subpanel-table .pagination button .suitepicon {
  line-height: 26px;
}

#actionLinkTop li.sugar_action_button:hover,
#actionLinkBottom li.sugar_action_button:hover,
.action-link-top li.sugar_action_button:hover,
.action-link-bottom li.sugar_action_button:hover,
.subpanel-table li.sugar_action_button:hover,
#selectLinkTop li.sugar_action_button:hover,
#selectLinkBottom li.sugar_action_button:hover,
.subpanel-table .pagination .sugar_action_button:hover,
.subpanel-table .pagination li.sugar_action_button:hover > form > a,
.subpanel-table .pagination .sugar_action_button:hover > form > a,
.subpanel-table .pagination .sugar_action_button:hover > form > a,

.subpanel-table ul.subpanel a:hover,
.subpanel-table li.sugar_action_button:hover,
.subpanel-table .pagination .sugar_action_button:hover,
.subpanel-table .pagination li.sugar_action_button:hover > form > a,
.subpanel-table .pagination .sugar_action_button:hover > form > a,
.subpanel-table .pagination .sugar_action_button:hover > form > a,
.subpanel-table .pagination a,
.subpanel-table .subnav {
  background-color: $panel-button-bg-hover;
}

.subpanel-table .pagination a {
  padding-left: 8px;
  padding-right: 8px;
}

.subpanel-table .pagination .clickMenu li span {
  margin-left: 0;
  margin-right: 5px;
  display: inline-block;
}

.subpanelTablist #addPageItem a, .subpanelTablist #addPageItem a:hover {
  background: transparent;
  border: none;
  text-decoration: none;
}

.tablist li a:link, .tablist li a:visited, .subpanelTablist li a:link, .subpanelTablist li a:visited {
  text-decoration: none;
}

.subpanelTabForm td {
  padding: 15px 0;
}

table.subpanelTabForm td {
  padding-top: 0;
  padding-bottom: 2px;
}

.subpanelTabForm p {
  margin-bottom: 0;
}

.subpanelTabForm h3 {
  padding-left: 3px;
}

.subpanelTabForm .h3Row {
  padding-top: 2px;
  margin-top: 0;
}

.subpanelTabForm {
  margin-bottom: 10px;
}

#groupTabs {
  margin-top: 20px;
}

#groupTabs li, #searchTabs li {
  margin: 0 -3px 0 0;
}

table.subpanelTabForm {
  margin-bottom: 4px;
  border-top: 0 none;
}

.collapsed .panelContainer, .collapsed .collapseLink, .expanded .expandLink {
  display: none;
}

.oddListRowS1:hover td ul.clickMenu.subpanel.records li span,
.evenListRowS1:hover td ul.clickMenu.subpanel.records li span {
  opacity: 1;
}


@media (max-width: 767px) {
  .panel-heading a div {
    line-height: 35px;
    width: 90% !important;
  }
}

@media (min-width: 768px) {
  .panel-heading a div {
    line-height: 35px;
    width: 90% !important;
  }
}


.clickMenu li span.subhover {
  cursor: pointer;
}


.clickMenu li .subnav,
.clickMenu .subnav-sub,
.SugarActionMenuIESub {
  display: none;
  position: absolute;
  top: 20px;
  padding: 8px 0;
  margin: 0;
  border: 1px solid transparent;
  border-bottom-left-radius: 4px;
  border-bottom-right-radius: 4px;
  float: left;
  overflow: hidden;
  width: auto;
  z-index: 10;
  list-style: none;
}

.clickMenu .subnav-sub,
.SugarActionMenuIESub {
  right: 0;
}

.clickMenu li .subnav {
  right: 0;
  margin-top: 4px;
  min-width: 128px;
}

.clickMenu li .subnav li, .clickMenu .subnav-sub li, .SugarActionMenuIESub li {
  padding: 0;
  margin: 0;
  clear: both;
  width: 100%;
  white-space: nowrap;
}


.clickMenu.subpanel.records li .subnav li a span {
  background-image: none;
  width: 0;
  height: 0;
}

.clickMenu.button li span.ab:hover {
  background-position: 50% 0;
}

.clickMenu.button li > span a {
  padding: 0 ;
}

.clickMenu.button span {
  padding-right: 5px;
}

.clickMenu.button li .subnav {
  width: auto;
}

.clickMenu li a.disabled {
  color: $disabled-btn-color;
  cursor: default ;
}
