:root {
  --crm-primary: #003867;
  --crm-text-main: #2b2d31;
  --crm-text-secondary: #6c717a;
  --crm-bg: #ffffff;
  --crm-border: #e5e7eb;
  --crm-radius: 8px;
}

body {
  --sb-track-color: #f4f7f6;
  --sb-thumb-color: #6baf8d;
  --sb-size: 5px;
}

body::-webkit-scrollbar {
  width: var(--sb-size)
}

body::-webkit-scrollbar-track {
  background: var(--sb-track-color);
  border-radius: 3px;
}

body::-webkit-scrollbar-thumb {
  background: var(--sb-thumb-color);
  border-radius: 3px;
  
}

@supports not selector(::-webkit-scrollbar) {
body {
    scrollbar-color: var(--sb-thumb-color)
                     var(--sb-track-color);
  }
}

.navbar.is-primary .navbar-brand .navbar-link.is-active, .navbar.is-primary .navbar-brand .navbar-link:focus, .navbar.is-primary .navbar-brand .navbar-link:hover, .navbar.is-primary .navbar-brand>a.navbar-item.is-active, .navbar.is-primary .navbar-brand>a.navbar-item:focus, .navbar.is-primary .navbar-brand>a.navbar-item:hover {
    background-color: #0059a3;
    color: #fff;
}

html,
body {
  font-family: "Inter", sans-serif;
  color: var(--crm-text-main);
  background: var(--crm-bg);
}

#target-list .menu {
    font-size: 1rem;
    max-height: 90vh;
    overflow-y: auto;
    overflow-x: hidden;
}

#target-list .menu-list a {
    overflow: hidden;
}

#target-list .menu-list a .level-left {
    min-width: 0;
    flex: 1;
    overflow: hidden;
}

#target-list .menu-list a .level-left > span {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#seletorCiclo, #responderForm {
    scroll-margin-top: 80px; /* Substitua 80px pela altura exata da sua navbar */
}

.section {
  padding: 1.75rem 1.5rem;
}

.navbar.is-primary {
  background: var(--crm-primary);
}

.navbar.is-primary .navbar-item,
.navbar.is-primary .navbar-link,
.navbar.is-primary .navbar-brand .navbar-item {
  color: #fff;
  font-weight: 500;
}

.navbar.is-primary .navbar-item:hover,
.navbar.is-primary .navbar-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.box,
.notification,
.card,
.table,
.modal-card {
  border-radius: var(--crm-radius);
}

.box,
.card,
.modal-card,
.table-container {
  box-shadow: none;
  border: 1px solid var(--crm-border);
}

.table-container {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.box {
  padding: 1.25rem;
  background: #fff;
}

.notification.is-light {
  border: 1px solid var(--crm-border);
}

.title,
.label {
  color: var(--crm-text-main);
}

.subtitle,
.help,
.menu-label {
  color: var(--crm-text-secondary);
}

.label {
  font-weight: 600;
}

.input,
.textarea,
.select select {
  border-radius: var(--crm-radius);
  border: 1px solid var(--crm-border);
  box-shadow: none;
}

.input:focus,
.textarea:focus,
.select select:focus {
  border-color: var(--crm-primary);
  box-shadow: 0 0 0 2px rgba(0, 56, 103, 0.12);
}

.button {
  border-radius: var(--crm-radius);
  font-weight: 600;
  transition: all 0.18s ease;
}

.button.is-primary,
.button.is-link,
.button.is-info {
  background: var(--crm-primary);
  border-color: var(--crm-primary);
  color: #fff;
}

.button.is-primary:hover,
.button.is-link:hover,
.button.is-info:hover {
  background: #002b4f;
  border-color: #002b4f;
  color: #fff;
}

.button.is-light {
  background: #fff;
  border-color: var(--crm-border);
  color: var(--crm-text-main);
}

.button.is-danger {
  border-radius: var(--crm-radius);
}

.menu-list a {
  border-radius: var(--crm-radius);
}

.menu-list a.is-active {
  background: rgba(0, 56, 103, 0.1);
  color: var(--crm-primary);
}

.table td,
.table th {
  vertical-align: middle;
}

/* .columns,
.field,
.buttons {
    gap: .5rem;
} */

#tasks-container {
  margin-top: 40px;
}

.crm-userbox {
  border: 1px solid var(--crm-border);
  border-radius: var(--crm-radius);
  background: #fff;
  padding: 0.9rem;
}

.crm-navbar-name {
  color: var(--crm-text-main);
}

.crm-navbar-org {
  color: var(--crm-text-secondary);
}

.crm-footer {
  margin-top: 1.25rem;
  border-top: 1px solid var(--crm-border);
  background: #fff;
}

.crm-footer-inner {
  padding: 1rem 1.5rem;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
  align-items: center;
}

.crm-footer-logo img {
  max-height: 44px;
  width: auto;
  display: block;
}

.crm-footer-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--crm-text-main);
  margin-bottom: 0.35rem;
}

.crm-footer-text {
  font-size: 0.8rem;
  color: var(--crm-text-secondary);
  line-height: 1.35;
}

.crm-footer-session {
  justify-self: end;
  width: 100%;
  max-width: 320px;
  border: 1px solid var(--crm-border);
  border-radius: var(--crm-radius);
  padding: 0.7rem 0.8rem;
}

.crm-footer-session .crm-footer-text + .crm-footer-text {
  margin-top: 0.2rem;
}

.crm-auth-card {
  border: 1px solid var(--crm-border);
  border-radius: var(--crm-radius);
  box-shadow: none;
}

.crm-auth-card .title {
  margin-bottom: 2rem;
}

.card .card-content p {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card .card-content a {
  text-decoration: none !important;
}
.datatable-info {
  color: #7a7a7a !important;
  font-size: 70%;
}
.level-item .subtitle,
.level-item .title {
  margin-bottom: 20px !important;
}

.crm-page-head {
  margin-bottom: 1rem;
}

.crm-panel {
  border: 1px solid var(--crm-border);
  border-radius: var(--crm-radius);
}

.crm-table thead th {
  color: var(--crm-text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  border-bottom-color: var(--crm-border);
}

.crm-table tbody td {
  border-bottom-color: #eef1f5;
}

.crm-files-panel .column .box {
  border: 1px solid var(--crm-border);
  border-radius: var(--crm-radius);
}

#viewKanban .card {
  border: 1px solid var(--crm-border);
  box-shadow: none;
  border-radius: var(--crm-radius);
}

.crm-task-meta-grid .tag {
  white-space: nowrap;
}

.crm-presence-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #cbd5e1;
  margin-right: 0.4rem;
  vertical-align: middle;
}

.crm-presence-dot.is-online {
  background: #22c55e;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.15);
}

.crm-comment-body {
  white-space: pre-wrap;
}

.crm-activity-new {
  border-left: 3px solid #00d1b2;
  padding-left: 0.75rem;
}

.crm-mini-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}

.crm-mini-avatar-fallback {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.image.is-4by3 img {
  object-fit: cover;
}

body.sidebar-collapsed .crm-sidebar-column {
  display: none;
}

@media (max-width: 1023px) {
  body.sidebar-open {
    overflow: hidden;
  }

  .section {
    padding: 1rem 0.75rem;
  }

  .container.is-fluid {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .level-item .subtitle,
  .level-item .title {
    margin-bottom: 0.75rem !important;
  }

  .crm-sidebar-column {
    position: fixed;
    top: 3.25rem;
    left: 0;
    width: 290px;
    max-width: 85vw;
    height: calc(100vh - 3.25rem);
    overflow: auto;
    background: #fff;
    z-index: 40;
    transform: translateX(-105%);
    transition: transform 0.18s ease;
    padding: 0.75rem;
    visibility: hidden;
    pointer-events: none;
  }

  body.sidebar-open .crm-sidebar-column {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
  }

  .crm-sidebar-backdrop {
    display: none;
    position: fixed;
    top: 3.25rem;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 35;
  }

  body.sidebar-open .crm-sidebar-backdrop {
    display: block;
  }

  .box {
    padding: 0.95rem;
  }

  .crm-userbox {
    padding: 0.75rem;
  }

  #notifMenu {
    min-width: 0 !important;
    width: 92vw;
    max-width: 92vw;
  }
}

@media (max-width: 1023px) {
  .crm-footer-inner {
    grid-template-columns: 1fr;
  }
  .crm-footer-session {
    justify-self: start;
    max-width: 100%;
  }
}

@media (max-width: 767px) {
  #viewKanban > .column {
    display: none !important;
  }
  #viewKanban > .column.is-active-mobile-col {
    display: block !important;
  }

  /* Tabelas responsivas genéricas no mobile */
  table.table:not(.no-responsive-table) {
    display: block !important;
    border: none !important;
  }
  table.table:not(.no-responsive-table) thead {
    display: none !important;
  }
  table.table:not(.no-responsive-table) tbody {
    display: block !important;
  }
  table.table:not(.no-responsive-table) tr {
    display: block !important;
    border: 1px solid var(--crm-border) !important;
    border-radius: var(--crm-radius) !important;
    padding: 0.5rem !important;
    margin-bottom: 0.75rem !important;
    background: #fff !important;
  }
  table.table:not(.no-responsive-table) td {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    border: none !important;
    border-bottom: 1px solid #f0f0f0 !important;
    padding: 0.5rem 0.25rem !important;
    text-align: right !important;
  }
  table.table:not(.no-responsive-table) td:last-child {
    border-bottom: none !important;
  }
  table.table:not(.no-responsive-table) td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--crm-text-secondary);
    text-align: left !important;
    margin-right: 1rem;
    font-size: 0.8rem;
  }

  /* Otimização específica para a tabela de direcionamentos (#targetsTable) no mobile */
  #targetsTable.table td {
    display: block !important;
    text-align: left !important;
    border-bottom: 1px solid #f0f0f0 !important;
    padding: 0.75rem 0.25rem !important;
  }
  #targetsTable.table td::before {
    display: block !important;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    color: var(--crm-text-main);
  }
  #targetsTable.table .field.is-grouped {
    flex-direction: column;
    align-items: stretch;
  }
  #targetsTable.table .field.is-grouped .control {
    width: 100%;
    margin-right: 0 !important;
    margin-bottom: 0.5rem;
  }
  #targetsTable.table .field.is-grouped .control:last-child {
    margin-bottom: 0;
  }
  #targetsTable.table .select, 
  #targetsTable.table select {
    width: 100% !important;
  }
  #targetsTable.table td:last-child {
    border-bottom: none !important;
    display: flex !important;
    justify-content: flex-end !important;
    padding-top: 0.5rem !important;
  }
}

/* Otimização para a tabela de direcionamentos (#targetsTable) em telas médias/grandes (desktop) */
@media (min-width: 768px) {
  #targetsTable.table {
    table-layout: fixed;
    width: 100%;
  }
  
  #targetsTable.table th:nth-child(1),
  #targetsTable.table td:nth-child(1) {
    width: 48%;
  }
  
  #targetsTable.table th:nth-child(2),
  #targetsTable.table td:nth-child(2) {
    width: 48%;
  }
  
  #targetsTable.table th:nth-child(3),
  #targetsTable.table td:nth-child(3) {
    width: 4%;
    text-align: center;
  }

  #targetsTable.table .field.is-grouped {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    width: 100%;
  }

  #targetsTable.table .field.is-grouped > .control:first-child {
    flex: 0 0 170px;
    max-width: 170px;
  }

  #targetsTable.table .field.is-grouped > .control:last-child {
    flex: 1 1 auto;
    min-width: 0;
  }

  #targetsTable.table .select, 
  #targetsTable.table select {
    width: 100% !important;
    max-width: 100% !important;
  }
}

/* Bloqueio de campos de formulário */
.is-locked {
  pointer-events: none !important;
  background-color: #f5f5f5 !important;
  color: #7a7a7a !important;
  cursor: not-allowed !important;
  opacity: 0.75 !important;
}
