/* Custom Styles - Moved from inline styles */

/* Log Entries */
.log-entries-container {
  max-height: none;
  overflow: visible;
}

.log-entry {
  border-left: 4px solid #dee2e6;
  background-color: #f8f9fa;
  word-wrap: break-word;
  overflow-wrap: break-word;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 12px;
  line-height: 1.6;
  color: #212529;
}

.log-entry[data-level*="ERROR"],
.log-entry[data-level*="CRITICAL"] {
  border-left-color: #dc3545;
}

.log-entry[data-level*="WARNING"] {
  border-left-color: #ffc107;
}

.log-entry[data-level*="INFO"] {
  border-left-color: #0dcaf0;
}

.log-entry-header {
  font-weight: bold;
  color: #495057;
  border-bottom: 1px solid #dee2e6;
  padding-bottom: 5px;
}

.log-entry-body {
  color: #212529;
}

.log-entry .badge {
  margin-right: 8px;
}

.log-entry .badge-danger {
  background-color: #dc3545;
  color: #fff;
}

.log-entry .badge-warning {
  background-color: #ffc107;
  color: #fff;
}

.log-entry .badge-info {
  background-color: #0dcaf0;
  color: #fff;
}

.log-entry .badge-secondary {
  background-color: #6c757d;
  color: #fff;
}

/* Filter Forms */
.filter-field-sm {
  max-width: 200px;
}

.filter-field-xs {
  max-width: 150px;
}

.filter-form-sm {
  max-width: 400px;
}

.filter-form-xs {
  max-width: 200px;
}

/* Projects list: Filters row — default .filter-form-sm (400px) and narrow fields clip select text */
.filter-form-sm.projects-filters-form {
  max-width: none;
  width: 100%;
}

.filter-form-sm.projects-filters-form .filter-field-search {
  flex: 1 1 200px;
  min-width: 180px;
  max-width: 360px;
}

.filter-form-sm.projects-filters-form .filter-field-sm {
  flex: 1 1 200px;
  max-width: min(320px, 100%);
  min-width: 200px;
}

.filter-form-sm.projects-filters-form .filter-field-xs {
  flex: 0 1 auto;
  max-width: 220px;
  min-width: 170px;
}

/* Projects list — phase colors (no extra column) */
.proj-phase-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  font-size: 0.78rem;
  color: #697a8d;
}

.proj-phase-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.proj-phase-legend-item::before {
  content: '';
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex-shrink: 0;
}

.proj-phase-legend-item--in-progress::before {
  background: #ff9f43;
}

.proj-phase-legend-item--completed::before {
  background: #28c76f;
}

.projects-table tbody tr.proj-row--in-progress {
  box-shadow: inset 4px 0 0 #ff9f43;
  background: rgba(255, 159, 67, 0.05);
}

.projects-table tbody tr.proj-row--completed {
  box-shadow: inset 4px 0 0 #28c76f;
}

.projects-table .proj-name--in-progress {
  color: #cc7a16;
}

.projects-table .proj-name--completed {
  color: #1f7a4f;
}

[data-bs-theme="dark"] .projects-table tbody tr.proj-row--in-progress {
  background: rgba(255, 159, 67, 0.08);
}

[data-bs-theme="dark"] .projects-table .proj-name--in-progress {
  color: #ffb976;
}

[data-bs-theme="dark"] .projects-table .proj-name--completed {
  color: #5fd39a;
}

/* User Agent Text */
.user-agent-text {
  max-width: 200px;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Dashboard 2FA Icon */
.dashboard-2fa-icon {
  font-size: 24px;
}

/* Error Pages */
.error-footer-text {
  margin-top: 10px;
  font-size: 12px;
  color: #666;
}

/* Role Description */
.role-description {
  min-height: 1.5em;
}

/* Auth Page Logo Sizing - 3x larger */
.auth-cover-brand .app-brand-logo.demo {
  max-width: 102px;
  max-height: 72px;
  width: auto;
  height: auto;
  object-fit: contain;
}


/* Navbar Logo */
.navbar-logo {
  max-height: 32px;
}

/* Live chat text - prevent line break and keep fixed position */
.menu .app-brand-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 0;
  line-height: 1.5;
  height: auto;
}

/* Table Actions column - always align to right */
.table th.table-actions,
.table td.table-actions {
  text-align: right;
  white-space: nowrap;
  width: 1%;
}

/* Finance matrix table */
.finance-matrix-table tbody tr:hover td {
  background-color: rgba(105, 108, 255, 0.06);
}
.finance-matrix-table td.is-col-hover,
.finance-matrix-table th.is-col-hover {
  background-color: rgba(105, 108, 255, 0.12);
}
.finance-matrix-table td.finance-name-col {
  background-color: rgba(105, 108, 255, 0.04);
}
.finance-matrix-table td.finance-total-col {
  background-color: rgba(105, 108, 255, 0.04);
  border-right: 2px solid rgba(105, 108, 255, 0.6);
}
.finance-name-col { min-width: 220px; }
.finance-total-col { min-width: 140px; }
.finance-th-end { min-width: 120px; }

/* Table column widths - payments, allocation */
.table th.payments-date-col { min-width: 130px; }
.table th.payments-partner-col { min-width: 200px; }
.table th.payments-amount-col { min-width: 120px; }
.table th.payments-comment-col { min-width: 200px; }
.table th.payments-actions-col { width: 120px; }
.table th.allocation-invoice-col { width: 90px; }
.table th.allocation-project-col { min-width: 180px; }
.table th.allocation-period-col { width: 120px; }
.table th.allocation-amount-col { width: 140px; }
.table th.allocation-actions-col { width: 80px; }
.payer-payment-th-check { width: 40px; white-space: nowrap; }
.payer-payment-th-invoice { white-space: nowrap; }
.payer-payment-th-debt { width: 110px; white-space: nowrap; }
.payer-payment-th-allocate { width: 140px; white-space: nowrap; }

/* Offcanvas widths */
.offcanvas-invoice-detail { --bs-offcanvas-width: 800px; }
.offcanvas-payments-wide { --bs-offcanvas-width: 700px; max-height: 100vh; }

/* Sections hidden until JS */
.js-paid-at-wrap.is-hidden { display: none !important; }
#divisions-section.hide-until-js { display: none !important; }
#one-time-section.hide-until-js { display: none !important; }
.invoice-division-max-width { max-width: 180px; }

/* Partner logo in list */
.partner-logo-thumb { width: 32px; height: 32px; object-fit: cover; }
.partner-form-logo { max-height: 100px; }

/* Autocomplete / search span */
.autocomplete-min-width { min-width: 200px; white-space: nowrap; }

/* Badge with dynamic color from variable (set --badge-bg and optionally --badge-fg in inline style) */
.badge-type-color {
  background-color: var(--badge-bg, #696cff) !important;
  color: var(--badge-fg, #ffffff) !important;
}

/* Partner chat - message image */
.chat-message-img-preview { max-width: 300px; max-height: 300px; border-radius: 8px; object-fit: contain; cursor: pointer; }
.read-receipts-avatars-spacer { margin-left: 8px; }
.read-receipt-avatar-stack { margin-left: -8px; }
.read-receipt-avatar-inner { font-size: 0.6rem; width: 16px; height: 16px; line-height: 16px; }
.read-receipt-avatar-inner-sm { font-size: 0.5rem; width: 16px; height: 16px; line-height: 16px; }
#message-context-menu.fixed-context-menu { display: none; position: fixed; z-index: 10000; }
.message-input-resize { resize: none; min-height: 40px; max-height: 120px; overflow-y: hidden; line-height: 1.35; }

/* Partner dashboard stats */
.partner-dashboard-stats {
  gap: 1.25rem !important;
}
.partner-dashboard-stat {
  padding: 1rem 1.25rem;
  border-radius: 0.5rem;
}
.partner-dashboard-stat .content-right {
  padding-left: 0.25rem;
}
.partner-projects-table th {
  white-space: nowrap;
}
.partner-project-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  border-radius: 0.375rem;
  background: rgba(var(--bs-body-color-rgb), 0.06);
  font-weight: 500;
  font-size: 0.875rem;
}
.partner-project-indicator i {
  font-size: 1rem;
}

/* Partner dashboard chart placeholder */
.leads-report-chart { min-height: 157px; }
.progress-thin { height: 8px; }
.progress-bar-initial { width: 0%; }

/* Partner board report — active timer row */
.partner-report-row-running {
  background-color: rgba(54, 179, 126, 0.14) !important;
}
.partner-report-row-running > td {
  border-color: rgba(54, 179, 126, 0.25);
}
[data-bs-theme="dark"] .partner-report-row-running {
  background-color: rgba(54, 179, 126, 0.22) !important;
}
