/**
 * Loaded after module stylesheets. Compile: tools/build-crm-theme.ps1
 */
/**
 * Shared CRM tables and buttons.
 * Wide tables keep readable columns and scroll inside their wrapper.
 * Buttons share one shape; color and label stay per action.
 */
.page-content,
.main-content,
.main-content > .container-fluid,
.main-content .container-fluid,
.main-content .card,
.main-content .card-body {
  min-width: 0;
  max-width: 100%;
}

.main-content .table-responsive,
.main-content .crm-clients-table-wrap,
.main-content .employees-index-table-scroll,
.main-content .documents-index-table-scroll,
.main-content .tasks-index-table-wrap,
.main-content .closed-deals-table-wrap,
.main-content .my-team-table-scroll,
.main-content .crm-fot-table-wrap,
.main-content .documents-inv-lines-scroll {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(var(--crm-color-primary-rgb), 0.4) transparent;
}

.main-content .table-responsive > .table:not(.crm-profile-general-kv),
.main-content .crm-clients-table-wrap > .table,
.main-content .employees-index-table-scroll > .table,
.main-content .documents-index-table-scroll > .table,
.main-content .tasks-index-table-wrap > .table,
.main-content .closed-deals-table-wrap > .table,
.main-content .my-team-table-scroll > .table,
.main-content .crm-fot-table-wrap > .table {
  width: max-content;
  min-width: 100%;
  max-width: none;
  table-layout: auto;
}

.main-content .documents-index-table {
  --crm-table-floor: 72rem;
}

.main-content .employees-index-table,
.main-content .closed-deals-data-table,
.main-content #clientsTable,
.main-content #crmCompaniesTable {
  --crm-table-floor: 56rem;
}

.main-content .tasks-index-table,
.main-content .funnel-report-table,
.main-content .documents-reports-table {
  --crm-table-floor: 48rem;
}

.main-content .teams-index-table,
.main-content .crm-my-team-table,
.main-content .crm-work-points-table {
  --crm-table-floor: 40rem;
}

.main-content .table-responsive > .table:not(.crm-profile-general-kv),
.main-content .crm-clients-data-table,
.main-content .tasks-index-table,
.main-content .closed-deals-data-table,
.main-content .funnel-report-table,
.main-content .teams-index-table,
.main-content .crm-my-team-table {
  min-width: max(100%, var(--crm-table-floor, 0px));
}

.main-content .table-responsive > .table:not(.crm-profile-general-kv):not(.table-borderless) > :is(thead, tbody, tfoot) > tr > :is(th, td) {
  white-space: nowrap;
  word-break: normal;
  overflow-wrap: normal;
  hyphens: manual;
  vertical-align: middle;
}

#clientsTable th,
#crmCompaniesTable th {
  background-color: var(--bs-tertiary-bg)!important;
}

.main-content .table-responsive > .table thead th {
  white-space: nowrap;
}

.main-content .table td.crm-cell-clip,
.main-content .table th.crm-cell-clip,
.main-content .crm-clients-data-table td.crm-clients-cell-company,
.main-content .crm-clients-data-table td.crm-clients-cell-phone,
.main-content .crm-clients-data-table td.crm-clients-cell-email,
.main-content .crm-clients-data-table td.crm-clients-assignee-cell {
  max-width: 16rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

.main-content .table td:has(textarea),
.main-content .table td:has(.form-control),
.main-content .table td:has(.form-select),
.main-content .table td:has(.progress),
.main-content .table.crm-profile-general-kv :is(th, td),
.main-content .documents-inv-lines-scroll .table :is(th, td) {
  white-space: normal;
}

.main-content .table .btn,
.main-content .table .btn-group,
.main-content .table .dropdown {
  white-space: nowrap;
}

.main-content .btn:not(.btn-close):not(.btn-link):not(.dropdown-item):not(.crm-hint-popover-btn):not(.cd-actions-menu__btn) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  white-space: nowrap;
  line-height: 1.2;
  font-weight: 600;
  border-radius: 0.5rem;
  min-height: auto;
  padding: .6rem 1rem;
}

.card-header .btn:not(.btn-close):not(.btn-link):not(.dropdown-item):not(.crm-hint-popover-btn):not(.cd-actions-menu__btn) {
  min-height: 2rem;
}

.main-content .btn-sm:not(.btn-close):not(.btn-link):not(.crm-hint-popover-btn),
.main-content .btn-group-sm > .btn:not(.btn-close):not(.btn-link) {
  min-height: 2rem;
  padding: 0.28rem 0.65rem;
  font-size: 0.8125rem;
  border-radius: 0.45rem;
}

.main-content .btn-lg:not(.btn-close):not(.btn-link) {
  min-height: 2.75rem;
  padding: 0.55rem 1.15rem;
  font-size: 1rem;
  border-radius: 0.55rem;
}

.main-content .table .btn-group {
  flex-wrap: nowrap;
}

.main-content .table .btn-group > .btn {
  flex: 0 0 auto;
  min-width: 2.25rem;
}

.main-content .crm-dir-btn,
.main-content .crm-dir-icon-btn {
  white-space: nowrap;
}

.main-content .crm-unified-filters .d-flex,
.main-content .crm-dir-toolbar,
.main-content .crm-dir-toolbar__actions {
  min-width: 0;
  max-width: 100%;
}

@media (max-width: 991.98px) {
  .main-content .crm-unified-filters .card-body > .row > [class*=col-] {
    min-width: 0;
  }
  .main-content .crm-dir-toolbar__actions,
  .main-content .crm-unified-filters .btn {
    white-space: nowrap;
  }
}
@media (max-width: 767.98px) {
  .main-content .crm-dir-toolbar__top,
  .main-content .crm-unified-filters .card-footer,
  .main-content .crm-unified-filters form .d-flex {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .main-content .crm-dir-search,
  .main-content .crm-unified-filters .form-control,
  .main-content .crm-unified-filters .form-select {
    max-width: 100%;
  }
  .closed-deals-table-modern thead th,
  .main-content .table-responsive > .table thead th {
    font-size: 0.8125rem;
  }
}
[data-bs-theme=dark] .main-content .table-responsive > .table:not(.crm-profile-general-kv) {
  --bs-table-bg: transparent;
  --bs-table-color: #e2e8f0;
  --bs-table-border-color: rgba(148, 163, 184, 0.18);
  color: #e2e8f0;
}

[data-bs-theme=dark] .main-content .table-responsive > .table thead th {
  color: #e2e8f0;
  background-color: #1a1d21;
  border-bottom-color: rgba(148, 163, 184, 0.22);
}

[data-bs-theme=dark] .main-content .table-responsive > .table tbody td,
[data-bs-theme=dark] .main-content .table-responsive > .table tbody th[scope=row] {
  color: #e2e8f0;
  background-color: transparent;
  border-bottom-color: rgba(148, 163, 184, 0.14);
}

[data-bs-theme=dark] .main-content .table .btn-outline-secondary,
[data-bs-theme=dark] .main-content .table .btn-outline-primary,
[data-bs-theme=dark] .main-content .table .btn-outline-dark {
  color: #e2e8f0;
  border-color: rgba(148, 163, 184, 0.4);
  background: rgba(30, 34, 40, 0.55);
}

[data-bs-theme=dark] .main-content .table .btn-outline-danger {
  color: #fecaca;
  border-color: rgba(248, 113, 113, 0.45);
  background: rgba(30, 34, 40, 0.55);
}

[data-bs-theme=dark] .main-content .crm-dir-icon-btn {
  color: #e2e8f0;
}

/* Groovo-style lists: airy rows, quiet header, soft status pills. */
.main-content .table-responsive > .table:not(.crm-profile-general-kv),
.main-content .crm-clients-data-table,
.main-content .employees-index-table,
.main-content .tasks-index-table,
.main-content .closed-deals-data-table,
.main-content .funnel-report-table,
.main-content .teams-index-table,
.main-content .crm-my-team-table {
  border-collapse: separate;
  border-spacing: 0;
  background: transparent;
  color: #1e293b;
  font-size: 0.875rem;
}

.main-content .table-responsive > .table:not(.crm-profile-general-kv) thead th,
.main-content .crm-dir-chrome .crm-clients-data-table thead th,
.main-content .crm-dir-chrome table thead th {
  padding: 0.85rem 1rem !important;
  font-size: 0.8125rem !important;
  font-weight: 500 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  color: #94a3b8 !important;
  background: transparent !important;
  background-image: none !important;
  border-bottom: 1px solid #eef2f6 !important;
  box-shadow: none !important;
  white-space: nowrap;
}

.main-content .table-responsive > .table:not(.crm-profile-general-kv) tbody td,
.main-content .table-responsive > .table:not(.crm-profile-general-kv) tbody th[scope=row],
.main-content .crm-dir-chrome .crm-clients-data-table tbody td,
.main-content .crm-dir-chrome .crm-clients-data-table tbody th[scope=row],
.main-content .crm-dir-chrome table tbody td,
.main-content .crm-dir-chrome table tbody th[scope=row] {
  padding: 0.95rem 1rem !important;
  background: transparent !important;
  border-bottom: 1px solid #f1f5f9 !important;
  box-shadow: none !important;
  color: #1e293b;
  vertical-align: middle;
}

.main-content .table-responsive > .table tbody tr:hover td,
.main-content .table-responsive > .table tbody tr:hover th[scope=row],
.main-content .crm-dir-chrome .crm-clients-data-table tbody tr:hover td,
.main-content .crm-dir-chrome .crm-clients-data-table tbody tr:hover th[scope=row] {
  background: #f8fafc !important;
  box-shadow: none !important;
}

.main-content .table .badge,
.main-content .crm-dir-status,
.main-content .crm-dir-chrome .badge,
.main-content .crm-dir-chrome .crm-dir-status {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: auto;
  max-width: none;
  min-height: 1.85rem;
  padding: 0.35rem 0.85rem !important;
  border-radius: 6px !important;
  border: 0 !important;
  font-size: 0.8125rem !important;
  font-weight: 600 !important;
  line-height: 1.2 !important;
  letter-spacing: 0;
  white-space: nowrap;
  box-shadow: none !important;
}

.main-content .badge.bg-success,
.main-content .crm-dir-status--active {
  background: #e8f8ef !important;
  color: #178a45 !important;
}

.main-content .badge.bg-warning,
.main-content .crm-dir-status--on_leave,
.main-content .crm-dir-status--vip {
  background: #fff4d6 !important;
  color: #a16207 !important;
}

.main-content .badge.bg-danger,
.main-content .crm-dir-status--fired {
  background: #fde8ea !important;
  color: #be123c !important;
}

.main-content .badge.bg-primary,
.main-content .badge.bg-info {
  background: #e7f0ff !important;
  color: #1d4ed8 !important;
}

.main-content .badge.bg-secondary,
.main-content .crm-dir-status--test,
.main-content .crm-dir-status--new {
  background: #f1f5f9 !important;
  color: #475569 !important;
}

.main-content .badge.bg-dark,
.main-content .crm-dir-status--archived {
  background: #eef2f6 !important;
  color: #64748b !important;
}

.crm-shift-kind-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.main-content .crm-shift-kind-pills a.btn {
  min-height: 2.25rem;
  padding: 0.4rem 1rem;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.2;
  box-shadow: none;
}

.main-content .crm-shift-kind-pills a.btn-outline-secondary {
  background: #fff;
  border-color: #e2e8f0;
  color: #334155;
}

.main-content .crm-shift-kind-pills a.btn-outline-secondary:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #0f172a;
}

.main-content .crm-shift-kind-pills a.btn-primary {
  background: #fff7ed;
  border: 1px solid #fdba74;
  color: #c2410c;
  box-shadow: none;
}

.main-content .crm-shift-kind-pills a.btn-primary:hover,
.main-content .crm-shift-kind-pills a.btn-primary:focus {
  background: #ffedd5;
  border-color: #fb923c;
  color: #9a3412;
  box-shadow: none;
}

[data-bs-theme=dark] .main-content .table-responsive > .table:not(.crm-profile-general-kv) thead th,
[data-bs-theme=dark] .main-content .crm-dir-chrome .crm-clients-data-table thead th,
[data-bs-theme=dark] .main-content .crm-dir-chrome table thead th {
  color: #94a3b8 !important;
  background: transparent !important;
  border-bottom-color: rgba(148, 163, 184, 0.18) !important;
}

[data-bs-theme=dark] .main-content .table-responsive > .table:not(.crm-profile-general-kv) tbody td,
[data-bs-theme=dark] .main-content .table-responsive > .table:not(.crm-profile-general-kv) tbody th[scope=row],
[data-bs-theme=dark] .main-content .crm-dir-chrome table tbody td,
[data-bs-theme=dark] .main-content .crm-dir-chrome table tbody th[scope=row] {
  color: #e2e8f0 !important;
  background: transparent !important;
  border-bottom-color: rgba(148, 163, 184, 0.14) !important;
}

[data-bs-theme=dark] .main-content .table tbody tr:hover td,
[data-bs-theme=dark] .main-content .table tbody tr:hover th[scope=row] {
  background: rgba(255, 255, 255, 0.04) !important;
}

[data-bs-theme=dark] .main-content .badge.bg-success,
[data-bs-theme=dark] .main-content .crm-dir-status--active {
  background: rgba(34, 197, 94, 0.16) !important;
  color: #86efac !important;
}

[data-bs-theme=dark] .main-content .badge.bg-warning,
[data-bs-theme=dark] .main-content .crm-dir-status--on_leave,
[data-bs-theme=dark] .main-content .crm-dir-status--vip {
  background: rgba(245, 158, 11, 0.16) !important;
  color: #fcd34d !important;
}

[data-bs-theme=dark] .main-content .badge.bg-danger,
[data-bs-theme=dark] .main-content .crm-dir-status--fired {
  background: rgba(244, 63, 94, 0.16) !important;
  color: #fda4af !important;
}

[data-bs-theme=dark] .main-content .badge.bg-primary,
[data-bs-theme=dark] .main-content .badge.bg-info {
  background: rgba(59, 130, 246, 0.16) !important;
  color: #93c5fd !important;
}

[data-bs-theme=dark] .main-content .badge.bg-secondary,
[data-bs-theme=dark] .main-content .badge.bg-dark,
[data-bs-theme=dark] .main-content .crm-dir-status--test,
[data-bs-theme=dark] .main-content .crm-dir-status--new,
[data-bs-theme=dark] .main-content .crm-dir-status--archived {
  background: rgba(148, 163, 184, 0.16) !important;
  color: #cbd5e1 !important;
}

[data-bs-theme=dark] .main-content .crm-shift-kind-pills a.btn-outline-secondary {
  background: transparent;
  border-color: rgba(148, 163, 184, 0.35);
  color: #e2e8f0;
}

[data-bs-theme=dark] .main-content .crm-shift-kind-pills a.btn-primary {
  background: rgba(251, 146, 60, 0.16);
  border-color: rgba(251, 146, 60, 0.45);
  color: #fdba74;
}

.main-content .crm-shift-log-table-scroll .crm-shift-log-status {
  text-align: left;
}

.main-content .crm-shift-log-table-scroll .crm-shift-log-status .badge {
  justify-content: flex-start;
  align-items: flex-start;
  text-align: left;
  max-width: 290px;
  height: auto;
  white-space: normal;
}

/* Drag the header edge to set a column width. Widths are applied in px by crm-table-col-resize.js. */
.main-content table.crm-col-resize > thead > tr > th {
  position: relative;
}

.main-content table.crm-col-resize > thead > tr > th::before {
  content: "";
  position: absolute;
  top: 18%;
  right: 0;
  bottom: 18%;
  z-index: 2;
  width: 1px;
  background: rgba(100, 116, 139, 0.55);
  pointer-events: none;
}

.main-content table.crm-col-resize > tbody > tr > :is(td, th):not(:last-child) {
  border-right: 1px solid rgba(148, 163, 184, 0.28);
}

.main-content table.crm-col-resize > thead > tr > th.is-col-edge,
.main-content table.crm-col-resize > thead > tr > th.is-col-active {
  cursor: col-resize !important;
}

.main-content table.crm-col-resize > thead > tr > th.is-col-edge::before,
.main-content table.crm-col-resize > thead > tr > th.is-col-active::before {
  top: 8%;
  bottom: 8%;
  width: 3px;
  background: rgba(var(--crm-color-primary-rgb, 37, 99, 235), 0.95);
}

html[dir="rtl"] .main-content table.crm-col-resize > thead > tr > th::before {
  right: auto;
  left: 0;
}

body.crm-col-resizing,
body.crm-col-resizing * {
  cursor: col-resize !important;
  user-select: none !important;
}

.main-content table.crm-col-resize.is-col-sized,
.crm-hub-list table.crm-col-resize.is-col-sized {
  table-layout: fixed !important;
  width: var(--crm-col-table-w) !important;
  min-width: var(--crm-col-table-w) !important;
  max-width: none !important;
}

.main-content table.crm-col-resize.is-col-sized > :is(thead, tbody, tfoot) > tr > :is(th, td) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap !important;
  max-width: none;
}

.main-content table.crm-col-resize.is-col-sized > :is(thead, tbody, tfoot) > tr > :is(th, td) :is(a, span, div, p, button, label) {
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap !important;
}

.main-content table.crm-col-resize.is-col-sized .crm-dir-row-actions,
.main-content table.crm-col-resize.is-col-sized .cd-actions-menu,
.main-content table.crm-col-resize.is-col-sized .btn-group,
.main-content table.crm-col-resize.is-col-sized .dropdown,
.main-content table.crm-col-resize.is-col-sized .dropdown-menu,
.main-content table.crm-col-resize.is-col-sized .crm-dir-icon-btn {
  overflow: visible;
  text-overflow: clip;
  max-width: none;
}

.main-content table.crm-col-resize.is-col-sized .crm-dir-row-actions,
.main-content table.crm-col-resize.is-col-sized .btn-group {
  display: inline-flex;
  flex-wrap: nowrap;
  white-space: nowrap !important;
}

.main-content table.crm-col-resize.is-col-sized > :is(thead, tbody, tfoot) > tr > :is(th, td):has(.dropdown, .cd-actions-menu) {
  overflow: visible;
  text-overflow: clip;
}

.main-content table.crm-col-resize.is-col-sized col.is-collapsed {
  width: 0 !important;
  visibility: collapse;
}

.main-content table.crm-col-resize.is-col-sized .crm-clients-name-link,
.main-content table.crm-col-resize.is-col-sized .crm-cl-name-cell,
.main-content table.crm-col-resize.is-col-sized .employees-index-person {
  max-width: 100%;
  min-width: 0;
}

.main-content table.crm-col-resize.is-col-sized .crm-clients-name-link__text,
.main-content table.crm-col-resize.is-col-sized .employees-index-person__name,
.main-content table.crm-col-resize.is-col-sized .employees-index-person__text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

/* Name column only: wrap inside the resized width. Other columns stay on one line. */
.main-content table.crm-col-resize.is-col-sized > tbody > tr > td.crm-hub-list__title-cell,
.crm-hub-list table.crm-col-resize.is-col-sized > tbody > tr > td.crm-hub-list__title-cell {
  overflow: hidden;
  text-overflow: clip;
  white-space: normal !important;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.main-content table.crm-col-resize.is-col-sized > tbody > tr > td.crm-hub-list__title-cell :is(.crm-hub-doc-title, .crm-hub-doc-title__text, .crm-hub-doc-title__link),
.crm-hub-list table.crm-col-resize.is-col-sized > tbody > tr > td.crm-hub-list__title-cell :is(.crm-hub-doc-title, .crm-hub-doc-title__text, .crm-hub-doc-title__link) {
  max-width: 100%;
  min-width: 0;
  overflow: visible;
  text-overflow: clip;
  white-space: normal !important;
  overflow-wrap: anywhere;
  word-break: break-word;
}
