body {
  background: #f3f4f6;
  color: #1c1f24;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
}

a,
.link {
  color: #17a2b8;
}

a:hover,
.link:hover {
  color: #138496;
}

#main-wrapper > [ng-view] {
  padding: 28px 32px 48px;
}

#main-wrapper h2 {
  margin: 0;
  color: #111827;
  font-size: 1.45rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}

#main-wrapper h2 small {
  margin-left: 6px;
  color: #6b7280;
  font-size: .9rem;
  font-weight: 500;
}

#main-wrapper .container-fluid > .row:first-child {
  align-items: center;
  margin-bottom: 18px;
}

@media (min-width: 992px) {
  body.user-is-superadmin.logged-in,
  body.user-is-admin.logged-in,
  body.user-is-owner.logged-in,
  body.user-is-ticket.logged-in {
    padding-left: 240px;
  }

  body.user-is-superadmin.logged-in.contract-sidebar,
  body.user-is-admin.logged-in.contract-sidebar,
  body.user-is-owner.logged-in.contract-sidebar,
  body.user-is-ticket.logged-in.contract-sidebar {
    padding-left: 72px;
  }
}

#sidebar {
  width: 240px;
  background: #ffffff;
  color: #1c1f24;
  border-right: 1px solid #e5e7eb;
}

#sidebar .app-logo {
  display: flex;
  align-items: center;
  height: 64px;
  padding: 0 48px 0 16px;
  border-bottom: 1px solid #e5e7eb;
  line-height: normal;
  overflow: hidden;
}

#sidebar .app-logo img.logo {
  display: block;
  width: auto;
  max-width: calc(100% - 8px);
  max-height: 40px;
  object-fit: contain;
}

#sidebar .app-name {
  display: block;
  color: #111827;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
}

body.contract-sidebar #sidebar .app-name,
body.contract-sidebar #sidebar .app-logo img.logo {
  display: none;
}

#sidebar ul {
  margin: 12px 0 24px;
}

#sidebar .nav-label {
  margin: 16px 16px 6px;
  color: #969ca8;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: .06em;
  text-transform: uppercase;
}

#sidebar ul li a {
  margin: 2px 10px;
  padding: 9px 12px;
  border-radius: 8px;
  background: transparent;
  color: #374151;
  font-size: 14px;
  font-weight: 500;
}

#sidebar ul li a i {
  width: 18px;
  margin-right: 10px;
  color: #6b7280;
  text-align: center;
}

#sidebar ul li a:hover {
  filter: none;
  background: #f3f4f6;
  color: #111827;
}

#sidebar ul li a.active {
  background: #eef2f6;
  color: #111827;
  font-weight: 650;
}

#sidebar ul li a.active i {
  color: var(--color_primary, #17a2b8);
}

#sidebar .toggle-sidebar-btn {
  top: 16px;
  right: 10px;
  left: auto;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff !important;
  color: #374151 !important;
}

body.contract-sidebar #sidebar {
  width: 72px;
}

body.contract-sidebar #sidebar .nav-label {
  display: none;
}

body.contract-sidebar #sidebar ul li a {
  margin: 2px 8px;
  padding: 10px 0;
  text-align: center;
}

body.contract-sidebar #sidebar ul li a i {
  margin-right: 0;
}

body.contract-sidebar #sidebar ul li a span {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  color: #111827;
}

#topbar {
  z-index: 30;
  height: auto;
  min-height: 64px;
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  padding: 12px 0;
}

.topbar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
  margin-left: auto;
}

.mobile-nav-btn,
.sidebar-backdrop {
  display: none;
}

.mobile-nav-btn {
  flex: none;
  border: 1px solid #d1d5db !important;
  border-radius: 8px;
  background: #fff !important;
  color: #111827 !important;
}

#topbar .truncar-ellip {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#topbar .account-switch {
  color: #374151;
  font-size: 13px;
  font-weight: 600;
}

#topbar .account-switch select {
  height: 34px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  color: #111827;
}

#topbar .dropdown .btn,
#topbar .user-image {
  vertical-align: middle;
}

#topbar .dropdown .btn {
  border: 1px solid #d1d5db !important;
  border-radius: 8px;
  background: #fff !important;
  color: #111827 !important;
}

#topbar .user-image {
  border-color: #e5e7eb;
  background: #f3f4f6;
}

#bottombar {
  height: 40px;
  line-height: 40px;
  background: #ffffff;
  border-top: 1px solid #e5e7eb;
  color: #6b7280;
}

#bottombar a {
  color: #374151;
}

.box {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
  padding: 20px;
}

.box .box-title {
  margin: 0 0 16px;
  padding: 0 0 12px;
  border-bottom: 1px solid #e5e7eb;
  border-radius: 0;
  background: transparent;
  color: #111827;
  font-size: 14px;
  font-weight: 650;
}

.table {
  color: #1c1f24;
}

.table thead th {
  border-top: 0;
  border-bottom: 1px solid #e5e7eb;
  background: #fff;
  color: #6b7280;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.table td {
  border-top: 1px solid #f3f4f6;
  vertical-align: middle;
}

.table tbody tr:hover {
  background: #f9fafb;
}

.image-list {
  width: 56px;
  height: 40px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
}

.form-control,
.custom-select {
  border: 1px solid #d1d5db;
  border-radius: 8px;
  color: #111827;
}

.form-control:focus {
  border-color: #9ca3af;
  box-shadow: none;
}

.btn {
  border-radius: 8px;
  font-weight: 600;
}

.btn:not(:disabled):not(.disabled):hover,
.btn:not(:disabled):not(.disabled):active {
  filter: none;
}

.nav-tabs {
  border-bottom: 1px solid #e5e7eb;
}

.nav-tabs .nav-link {
  margin-bottom: -1px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  color: #6b7280;
  font-weight: 600;
}

.nav-tabs .nav-link.active {
  border-bottom-color: var(--color_primary, #17a2b8);
  background: transparent;
  color: #111827;
}

.breadcrumb {
  background: transparent;
  padding-left: 0;
  font-size: 13px;
}

.modal-content {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
}

.modal-header,
.modal-footer {
  border-color: #e5e7eb;
}

body.login-view {
  padding: 0;
  background: #f3f4f6;
}

.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}

.page-heading h2 {
  min-width: 0;
  overflow-wrap: anywhere;
}

.page-heading > div {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.page-heading .btn {
  flex: none;
  white-space: nowrap;
}

.list-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
  align-items: center;
  margin-bottom: 18px;
}

.list-filters .filter-search,
.list-filters .filter-select,
.list-filters .filter-status,
.list-filters .selectize-control,
.list-filters .selectize-input {
  width: 100%;
  min-width: 0;
}

.list-filters .form-control,
.list-filters .selectize-input,
.list-filters .selectize-control.single .selectize-input,
.list-filters .btn {
  height: 38px;
  min-height: 38px;
}

.list-filters .selectize-input,
.list-filters .selectize-control.single .selectize-input {
  display: flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid #d1d5db !important;
  border-radius: 8px !important;
  background: #fff !important;
  background-image: none !important;
  box-shadow: none !important;
}

.list-filters .selectize-input::after {
  display: none;
}

.list-filters .selectize-input > input {
  height: 20px !important;
  line-height: 20px !important;
}

.list-filters .selectize-control.multi .selectize-input.has-items {
  height: auto;
  min-height: 38px;
  padding: 4px 8px;
}

.list-filters .selectize-control.multi .selectize-input > div,
.list-filters .selectize-control.multi .selectize-input [data-value].active {
  margin: 2px 4px 2px 0;
  border: 0 !important;
  border-radius: 6px;
  background: #17a2b8 !important;
  background-image: none !important;
  color: #fff;
}

.list-filters .selectize-dropdown {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: none;
  z-index: 20;
}

.list-filters .filter-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
}

.chatbot-guide {
  max-width: 760px;
  padding-top: 8px;
}

.chatbot-guide h3 {
  margin: 18px 0 8px;
  color: #111827;
  font-size: 1.2rem;
  font-weight: 650;
}

.chatbot-guide h4 {
  margin: 22px 0 6px;
  color: #111827;
  font-size: 15px;
  font-weight: 650;
}

.chatbot-guide p {
  margin: 0 0 10px;
  color: #374151;
  font-size: 14px;
  line-height: 1.5;
}

.chatbot-guide code {
  color: #0f766e;
  font-size: 13px;
}

.chatbot-guide-code {
  margin: 0 0 12px;
  padding: 14px 16px;
  overflow: auto;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f9fafb;
  color: #111827;
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.chatbot-preview {
  height: 640px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
  background: #f7f1e8;
}

.category-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.category-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #374151;
}

.category-toggle:hover {
  background: #f3f4f6;
}

.tree li ul {
  margin-left: 28px;
}

.btn-geo {
  border: 1px solid #d1d5db;
  background: #fff;
  color: #374151;
}

.btn-geo:hover {
  background: #f3f4f6;
  color: #111827;
}

.permissions-table th,
.permissions-table td {
  text-align: center;
  white-space: nowrap;
}

.permissions-table th:first-child,
.permissions-table td:first-child {
  text-align: left;
}

.permissions-table .btn-link {
  padding: 0;
  font-weight: 650;
  color: #111827;
}

.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  height: auto;
  padding: 32px 16px;
  background: #f3f4f6;
}

.login-box {
  width: 400px;
  max-width: 100%;
  margin: 0;
}

.login-box-body {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
  padding: 32px 28px 28px;
  color: #1c1f24;
  text-align: center;
}

.login-brand {
  margin: 0 0 24px;
}

.login-brand img {
  display: block;
  width: auto;
  max-width: 100%;
  height: 56px;
  margin: 0 auto;
  object-fit: contain;
}

.login-box-body h3 {
  margin: 0;
  color: #111827;
  font-size: 1.35rem;
  font-weight: 650;
}

.login-box-body .login-box-msg {
  margin: 6px 0 22px;
  color: #6b7280;
  font-size: 14px;
}

.login-field {
  display: block;
  margin: 0 0 14px;
  text-align: left;
}

.login-field span {
  display: block;
  margin-bottom: 6px;
  color: #374151;
  font-size: 13px;
  font-weight: 600;
}

.login-box-body .btn-block {
  margin-top: 6px;
  border-radius: 8px;
  padding: 10px 16px;
}

.login-forgot {
  display: inline-block;
  margin-top: 14px;
  color: #6b7280;
  font-size: 13px;
  text-decoration: none;
}

.login-forgot:hover {
  color: #17a2b8;
}

.login-box .legend {
  margin: 16px 0 0;
  color: #9ca3af;
  font-size: 12px;
  text-align: center;
}

#loading-overlay {
  background: #f3f4f6;
}

#loading-overlay .loading-icon,
#loading-in .loading-icon {
  width: 36px;
  height: 36px;
  border: 3px solid #e5e7eb;
  border-top-color: #17a2b8;
  border-radius: 50%;
  font-size: 0;
  animation: gestion-spin .7s linear infinite;
}

#loading-in .loading-icon {
  background: transparent;
}

@keyframes gestion-spin {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

#companies-list-view .box {
  container-type: inline-size;
}

#companies-list-view .list-filters {
  grid-template-columns: 1fr 1fr;
}

@container (min-width: 980px) {
  #companies-list-view .list-filters {
    grid-template-columns: minmax(200px, 1.4fr) minmax(150px, 1fr) minmax(150px, 1fr) 150px;
  }
}

#companies-list-view .companies-list {
  margin: 4px -4px 0;
}

#companies-list-view .company-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1.5fr) minmax(0, .9fr) minmax(0, 1.15fr) 112px 86px 76px;
  column-gap: 14px;
  align-items: center;
  min-height: 64px;
  padding: 8px 4px;
  border-top: 1px solid #f3f4f6;
}

#companies-list-view .company-head {
  min-height: 36px;
  border-top: 0;
  color: #6b7280;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

#companies-list-view .company-row:not(.company-head):hover {
  background: #f9fafb;
}

#companies-list-view .company-thumb {
  display: block;
  width: 48px;
  height: 48px;
  object-fit: cover;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f3f4f6;
}

#companies-list-view .company-thumb-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
  font-size: 16px;
}

#companies-list-view .company-identity {
  min-width: 0;
}

#companies-list-view .company-name {
  display: block;
  overflow: hidden;
  color: #17a2b8;
  font-weight: 650;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#companies-list-view .company-name:hover {
  color: #138496;
}

#companies-list-view .company-sub,
#companies-list-view .company-extra {
  overflow: hidden;
  color: #6b7280;
  font-size: 12px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#companies-list-view .company-sub span + span::before,
#companies-list-view .company-extra span + span::before {
  content: "·";
  margin: 0 6px;
  color: #d1d5db;
}

#companies-list-view .company-extra,
#companies-list-view .extra-phone {
  display: none;
}

#companies-list-view .company-clip {
  overflow: hidden;
  color: #374151;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#companies-list-view .company-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

#companies-list-view .company-actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
}

#companies-list-view .custom-switch {
  min-height: 0;
  margin: 0;
  white-space: nowrap;
}

@container (max-width: 920px) {
  #companies-list-view .company-row {
    grid-template-columns: 48px minmax(0, 1fr) 108px 86px 76px;
  }

  #companies-list-view .col-zone,
  #companies-list-view .col-activity {
    display: none;
  }

  #companies-list-view .company-extra {
    display: block;
  }
}

@container (max-width: 640px) {
  #companies-list-view .company-row {
    grid-template-columns: 48px minmax(0, 1fr) 72px 76px;
  }

  #companies-list-view .col-phone {
    display: none;
  }

  #companies-list-view .extra-phone {
    display: inline;
  }
}

@container (max-width: 560px) {
  #companies-list-view .list-filters {
    grid-template-columns: 1fr;
  }
}

@container (max-width: 420px) {
  #companies-list-view .company-row {
    column-gap: 8px;
    grid-template-columns: 40px minmax(0, 1fr) 56px 68px;
  }

  #companies-list-view .company-thumb {
    width: 40px;
    height: 40px;
  }
}

@media (max-width: 991.98px) {
  body.user-is-superadmin.logged-in,
  body.user-is-admin.logged-in,
  body.user-is-owner.logged-in,
  body.user-is-ticket.logged-in,
  body.user-is-superadmin.logged-in.contract-sidebar,
  body.user-is-admin.logged-in.contract-sidebar,
  body.user-is-owner.logged-in.contract-sidebar,
  body.user-is-ticket.logged-in.contract-sidebar {
    padding-left: 0;
  }

  body {
    overflow-x: hidden;
  }

  #sidebar,
  body.contract-sidebar #sidebar {
    width: min(280px, 88vw);
    transform: translateX(-105%);
    z-index: 40;
    text-align: left;
  }

  body.sidebar-open #sidebar,
  body.sidebar-open.contract-sidebar #sidebar {
    transform: translateX(0);
    box-shadow: 8px 0 24px rgba(17, 24, 39, .12);
  }

  body.sidebar-open {
    overflow: hidden;
  }

  body.contract-sidebar #sidebar .nav-label,
  body.contract-sidebar #sidebar .app-name,
  body.contract-sidebar #sidebar .app-logo img.logo {
    display: block;
  }

  body.contract-sidebar #sidebar .app-logo .icon {
    display: none;
  }

  body.contract-sidebar #sidebar .app-logo {
    padding: 0 16px;
    justify-content: flex-start;
  }

  body.contract-sidebar #sidebar ul li a {
    margin: 2px 10px;
    padding: 9px 12px;
    text-align: left;
  }

  body.contract-sidebar #sidebar ul li a i {
    margin-right: 10px;
  }

  body.contract-sidebar #sidebar ul li a span {
    display: inline;
    position: static;
    width: auto;
    padding: 0;
    background: transparent;
    border: 0;
    color: inherit;
  }

  .mobile-nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  #sidebar .toggle-sidebar-btn {
    display: none;
  }

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 35;
    border: 0;
    padding: 0;
    background: rgba(17, 24, 39, .45);
  }

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

  #main-wrapper > [ng-view] {
    padding: 16px 12px 72px;
  }

  #main-wrapper h2 {
    font-size: 1.2rem;
  }

  .box {
    padding: 14px;
  }

  .nav-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .nav-tabs .nav-link {
    white-space: nowrap;
  }

  .list-filters {
    grid-template-columns: 1fr;
  }

  .list-filters .filter-actions {
    height: auto;
    flex-wrap: wrap;
  }

  #main-wrapper div:has(> table.table),
  #main-wrapper .table-responsive {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  #map,
  .mapboxgl-map {
    width: 100% !important;
    max-width: 100%;
    height: min(600px, 62vh) !important;
    min-height: 240px;
  }

  .chatbot-preview {
    height: min(640px, 70vh);
  }

  .note-toolbar {
    white-space: normal;
  }

  img,
  video,
  iframe {
    max-width: 100%;
  }

  img {
    height: auto;
  }

  #bottombar {
    position: fixed;
    left: 0;
    width: 100%;
    padding: 0 12px;
    font-size: 12px;
    text-align: center;
    z-index: 20;
  }

  #topbar .account-switch {
    display: flex;
    align-items: center;
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
  }

  #topbar .account-switch select {
    width: auto;
    min-width: 0;
    max-width: 220px;
  }
}

@media (max-width: 575.98px) {
  #topbar {
    min-height: 56px;
    padding: 8px 0;
  }

  #topbar .account-switch {
    display: flex;
    flex: 1 1 120px;
    min-width: 0;
    margin: 0;
  }

  #topbar .account-switch span {
    display: none;
  }

  #topbar .account-switch select {
    width: 100%;
    min-width: 0;
    max-width: 160px;
  }

  #topbar .user-image {
    display: none;
  }

  #topbar .truncar-ellip {
    max-width: 88px;
  }

  .modal-dialog,
  .modal-dialog.modal-lg,
  .modal-dialog.modal-xl {
    max-width: calc(100vw - 1rem);
    margin: .5rem auto;
  }

  .modal-body {
    max-height: calc(100vh - 140px);
    overflow-y: auto;
  }

  .login-box-body {
    padding: 24px 16px;
  }
}
