/* Base legada do app (antigo styles.css), parte 17 (#533) · Cliente 360: barra do módulo e ficha lateral. Ordem de carga: scripts/helpers/styles-source.js. */

/* Cliente 360 — toolbar do módulo e ficha lateral compacta */
html[data-mix-theme="mix-fiscal-default"] .mix-module-page-header__tools .crm-360-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  width: auto;
  max-width: min(920px, calc(100vw - 420px));
  gap: 6px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

html[data-mix-theme="mix-fiscal-default"] .mix-module-page-header__tools .crm-360-mode-toggle {
  flex: 0 0 auto;
  gap: 2px;
  padding: 2px;
  border-radius: 9px;
}

html[data-mix-theme="mix-fiscal-default"] .mix-module-page-header__tools .crm-360-mode-toggle button {
  min-height: 32px;
  padding: 0 10px;
  border-radius: 7px;
  font-size: 11px;
}

html[data-mix-theme="mix-fiscal-default"] .mix-module-page-header__tools .crm-360-search-field {
  display: grid;
  flex: 1 1 280px;
  grid-template-columns: 18px minmax(150px, 1fr);
  min-width: 190px;
  max-width: 390px;
  min-height: 34px;
  padding: 0 8px;
  border-radius: 9px;
}

html[data-mix-theme="mix-fiscal-default"] .mix-module-page-header__tools .crm-360-search-field > span {
  font-size: 15px;
}

html[data-mix-theme="mix-fiscal-default"] .mix-module-page-header__tools .crm-360-search-field input {
  height: 32px;
  font-size: 12px;
}

html[data-mix-theme="mix-fiscal-default"] .mix-module-page-header__tools .crm-360-view-toggle {
  flex: 0 0 auto;
  padding: 2px;
  border-radius: 9px;
}

html[data-mix-theme="mix-fiscal-default"] .mix-module-page-header__tools .crm-360-view-toggle button {
  width: 32px;
  height: 30px;
  border-radius: 7px;
  font-size: 14px;
}

html[data-mix-theme="mix-fiscal-default"] .mix-module-page-header__tools .crm-360-columns-menu > summary,
html[data-mix-theme="mix-fiscal-default"] .mix-module-page-header__tools .crm-360-toolbar > .mix-icon-button {
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  border-radius: 9px;
}

html[data-mix-theme="mix-fiscal-default"] .mix-module-page-header__tools .crm-360-toolbar svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

html[data-mix-theme="mix-fiscal-default"] .mix-module-page-header__tools .crm-360-columns-menu > summary {
  display: grid;
  place-items: center;
  list-style: none;
}

html[data-mix-theme="mix-fiscal-default"] .mix-module-page-header__tools .crm-360-add-button {
  color: #fff;
  background: #0877c9;
}

.crm-360-page {
  gap: 10px;
}

.crm-360-page > .mix-page-title {
  display: none;
}

.crm-360-create-panels {
  display: contents;
}

.crm-360-create-panels > details:not([open]) {
  display: none !important;
}

.crm-360-create-panels > details[open] {
  position: fixed;
  top: 104px;
  left: 50%;
  z-index: 22020;
  width: min(680px, calc(100vw - 32px));
  max-height: calc(100dvh - 136px);
  overflow: auto;
  padding: 4px 16px 16px;
  transform: translateX(-50%);
  border-radius: 14px;
  box-shadow: 0 26px 80px rgb(10 34 55 / 28%);
}

.crm-360-results {
  padding: 14px;
  border-radius: 13px;
}

.crm-360-results > header {
  margin-bottom: 11px;
}

.crm-360-results > header h2 {
  font-size: 16px;
}

.crm-360-result-card strong {
  font-size: 13px;
}

.crm-360-drawer-layer {
  z-index: 22000;
}

.crm-360-drawer-layer .crm-360-detail {
  width: min(820px, calc(100vw - 48px));
  animation: none;
  font-size: 12px;
}

.crm-360-drawer-layer .crm-360-detail-head {
  min-height: 72px;
  padding: 12px 16px;
}

.crm-360-drawer-layer .crm-360-result-avatar {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  font-size: 12px;
}

.crm-360-drawer-layer .crm-360-detail-head h2 {
  margin-top: 2px;
  font-size: 19px;
  line-height: 1.15;
}

.crm-360-drawer-layer .crm-360-detail-head p,
.crm-360-drawer-layer .crm-360-detail-head > div:first-child > span {
  margin-top: 3px;
  font-size: 10px;
}

.crm-360-drawer-layer .crm-360-detail-actions {
  flex-wrap: nowrap;
  gap: 6px;
}

.crm-360-drawer-layer .crm-360-detail-actions .mix-button {
  min-height: 32px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 11px;
}

.crm-360-drawer-layer .crm-360-drawer-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 20px;
}

.crm-360-drawer-layer .crm-360-context-strip > div {
  min-width: 118px;
  padding: 7px 12px;
}

.crm-360-drawer-layer .crm-360-context-strip span {
  font-size: 9px;
}

.crm-360-drawer-layer .crm-360-context-strip strong {
  margin-top: 2px;
  font-size: 11px;
}

.crm-360-drawer-layer .crm-360-tabs {
  padding: 5px 12px;
}

.crm-360-drawer-layer .crm-360-tabs button {
  min-height: 30px;
  padding: 0 9px;
  border-radius: 7px;
  font-size: 10px;
}

.crm-360-drawer-layer .crm-360-panels {
  overflow-x: hidden;
  padding: 12px 14px 20px;
}

.crm-360-drawer-layer .crm-360-panel-grid {
  gap: 10px;
}

.crm-360-drawer-layer .crm-360-panel-grid > *,
.crm-360-drawer-layer .crm-360-section {
  min-width: 0;
}

.crm-360-drawer-layer .crm-360-section {
  padding: 12px;
  border-radius: 10px;
}

.crm-360-drawer-layer .crm-360-section > header {
  margin-bottom: 9px;
}

.crm-360-drawer-layer .crm-360-section > header h3 {
  font-size: 13px;
}

.crm-360-drawer-layer .crm-360-data-list {
  border-radius: 9px;
}

.crm-360-drawer-layer .crm-360-data-list div {
  padding: 9px;
}

.crm-360-drawer-layer .crm-360-data-list dt {
  font-size: 9px;
}

.crm-360-drawer-layer .crm-360-data-list dd {
  margin-top: 3px;
  font-size: 11px;
}

.crm-360-drawer-layer .crm-360-empty {
  padding: 16px 10px;
  border-radius: 9px;
  font-size: 11px;
}

.crm-360-drawer-layer .crm-360-inline-form,
.crm-360-drawer-layer .crm-360-inline-form.stacked {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 9px;
}

.crm-360-drawer-layer .crm-360-inline-form > *,
.crm-360-drawer-layer .crm-360-inline-form.stacked > * {
  min-width: 0;
}

.crm-360-drawer-layer .crm-360-inline-form input,
.crm-360-drawer-layer .crm-360-inline-form select,
.crm-360-drawer-layer .crm-360-inline-form textarea {
  min-height: 34px;
  padding: 6px 8px;
  font-size: 11px;
}

@media (max-width: 1100px) {
  html[data-mix-theme="mix-fiscal-default"] .mix-module-page-header__tools .crm-360-toolbar {
    max-width: calc(100vw - 160px);
  }

  html[data-mix-theme="mix-fiscal-default"] .mix-module-page-header__tools .crm-360-search-field {
    max-width: none;
  }
}

@media (max-width: 760px) {
  html[data-mix-theme="mix-fiscal-default"] .mix-module-page-header__tools .crm-360-toolbar {
    width: 100%;
    max-width: none;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  html[data-mix-theme="mix-fiscal-default"] .mix-module-page-header__tools .crm-360-search-field {
    order: 5;
    flex-basis: 100%;
    max-width: none;
  }

  .crm-360-drawer-layer .crm-360-detail {
    width: 100vw;
  }

  .crm-360-drawer-layer .crm-360-panel-grid,
  .crm-360-drawer-layer .crm-360-inline-form,
  .crm-360-drawer-layer .crm-360-inline-form.stacked {
    grid-template-columns: 1fr;
  }
}

.crm-360-drawer-layer {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: grid;
  justify-items: end;
}

.crm-360-drawer-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgb(11 30 49 / 36%);
  backdrop-filter: blur(2px);
  cursor: default;
}

.crm-360-drawer-layer .crm-360-detail {
  position: relative;
  z-index: 1;
  display: flex;
  width: min(920px, calc(100vw - 72px));
  height: 100%;
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: 18px 0 0 18px;
  flex-direction: column;
  box-shadow: -18px 0 55px rgb(15 37 59 / 24%);
  animation: crm360DrawerIn .2s ease-out;
}

@keyframes crm360DrawerIn {
  from { transform: translateX(40px); opacity: .6; }
  to { transform: translateX(0); opacity: 1; }
}

.crm-360-drawer-layer .crm-360-detail-head {
  flex: 0 0 auto;
  padding: 17px 20px;
  border-bottom: 1px solid rgb(var(--mix-fx-line, 225 233 241));
  background: rgb(var(--mix-fx-paper, 255 255 255));
}

.crm-360-detail-identity {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 12px;
}

.crm-360-detail-identity > div:last-child {
  min-width: 0;
}

.crm-360-detail-identity h2 {
  overflow: hidden;
  margin-top: 1px;
  font-size: 21px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crm-360-drawer-close {
  display: grid;
  width: 38px;
  height: 38px;
  padding: 0;
  place-items: center;
  border: 1px solid rgb(var(--mix-fx-line, 213 225 235));
  border-radius: 10px;
  color: rgb(var(--mix-fx-ink-blue, 82 106 130));
  background: rgb(var(--mix-fx-paper, 255 255 255));
  font-size: 24px;
  cursor: pointer;
}

.crm-360-context-strip {
  display: flex;
  flex: 0 0 auto;
  align-items: stretch;
  gap: 1px;
  overflow-x: auto;
  border-bottom: 1px solid rgb(var(--mix-fx-line, 226 234 242));
  background: rgb(var(--mix-fx-paper, 226 234 242));
}

.crm-360-context-strip > div {
  min-width: 145px;
  padding: 10px 16px;
  background: rgb(var(--mix-fx-paper, 248 251 253));
}

.crm-360-context-strip span,
.crm-360-context-strip strong {
  display: block;
}

.crm-360-context-strip span {
  color: rgb(var(--mix-fx-ink-blue, 113 132 153));
  font-size: 10px;
}

.crm-360-context-strip strong {
  margin-top: 3px;
  color: rgb(var(--mix-fx-ink, 25 59 89));
  font-size: 14px;
}

.crm-360-context-strip > button {
  margin-left: auto;
  padding: 0 16px;
  border: 0;
  color: rgb(var(--mix-fx-ink-blue, 8 119 201));
  background: rgb(var(--mix-fx-paper, 248 251 253));
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.crm-360-drawer-layer .crm-360-config-panel {
  flex: 0 0 auto;
  max-height: 55vh;
  overflow-y: auto;
  margin: 0;
  border-width: 0 0 1px;
  border-radius: 0;
}

.crm-360-drawer-layer .crm-360-tabs {
  flex: 0 0 auto;
  margin: 0;
  padding: 7px 16px;
  border-radius: 0;
  border-bottom: 1px solid rgb(var(--mix-fx-line, 223 232 240));
  background: rgb(var(--mix-fx-paper, 244 247 250));
}

.crm-360-drawer-layer .crm-360-panels {
  flex: 1 1 auto;
  overflow-y: auto;
  margin: 0;
  padding: 16px 20px 28px;
  background: rgb(var(--mix-fx-paper, 247 250 252));
}

.crm-360-drawer-layer .crm-360-section {
  border-radius: 12px;
}

.crm-360-complementary {
  margin-top: 13px;
}

.crm-360-edit-form {
  display: grid;
  gap: 13px;
}

.crm-360-edit-form[hidden],
.crm-360-principal-view[hidden] {
  display: none;
}

.crm-360-edit-form > section {
  padding: 17px;
  border: 1px solid rgb(var(--mix-fx-line, 219 229 240));
  border-radius: 12px;
  background: rgb(var(--mix-fx-paper, 255 255 255));
}

.crm-360-edit-form h3 {
  margin: 0 0 13px;
  color: rgb(var(--mix-fx-ink, 23 55 84));
  font-size: 15px;
}

.crm-360-edit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
}

.crm-360-edit-grid label {
  display: grid;
  gap: 5px;
  color: rgb(var(--mix-fx-ink-blue, 82 106 130));
  font-size: 11px;
  font-weight: 700;
}

.crm-360-edit-grid input,
.crm-360-edit-grid select {
  width: 100%;
  min-height: 40px;
  padding: 7px 10px;
  border: 1px solid rgb(var(--mix-fx-line, 205 219 232));
  border-radius: 9px;
  color: rgb(var(--mix-fx-ink, 23 55 84));
  background: rgb(var(--mix-fx-paper, 255 255 255));
}

.crm-360-edit-actions {
  position: sticky;
  bottom: -28px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 0 0;
}

@media (max-width: 1080px) {
  .crm-360-toolbar {
    grid-template-columns: auto minmax(220px, 1fr) auto auto;
  }

  .crm-360-columns-menu,
  .crm-360-create-menu {
    justify-self: stretch;
  }
}

@media (max-width: 760px) {
  .crm-360-toolbar {
    grid-template-columns: 1fr 1fr;
  }

  .crm-360-toolbar .crm-360-mode-toggle,
  .crm-360-toolbar .crm-360-search-field {
    grid-column: 1 / -1;
  }

  .crm-360-drawer-layer .crm-360-detail {
    width: 100vw;
    border-radius: 0;
  }

  .crm-360-detail-head {
    align-items: center;
    flex-direction: row;
  }

  .crm-360-detail-actions .mix-button {
    display: none;
  }

  .crm-360-panel-grid,
  .crm-360-edit-grid {
    grid-template-columns: 1fr;
  }
}
