/* Base Styles */
* {
    box-sizing: border-box;
}

/* Tab styling */
.bm-tabs {
    display: flex;
    border-bottom: 1px solid #ddd;
    margin-bottom: 20px;
}

.bm-tab-link {
    padding: 10px 15px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-bottom: none;
    margin-right: 5px;
    cursor: pointer;
    border-radius: 5px 5px 0 0;
}

.bm-tab-link.active {
    background: #fff;
    border-bottom: 1px solid #fff;
    margin-bottom: -1px;
    font-weight: bold;
}

.bm-tab-content {
    display: none;
}

.bm-tab-content.active {
    display: block;
}

/* Container */
.bm-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Form Header */
.bm-form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.bm-form-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
}

/* Filters */
.bm-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
    padding: 20px;
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
}

.bm-filter-group {
    min-width: 0; /* Prevents overflow in grid items */
}

/* Filter Actions — full-width row with border (projects page default) */
.bm-filter-actions {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 10px;
    padding-top: 15px;
    border-top: 1px solid #ccd0d4;
}

/* Contractor list filter bar: Reset button joins the filter row inline */
.bm-container:has(#bm-contractors) .bm-filter-actions {
    grid-column: auto;
    margin-top: 0;
    padding-top: 0;
    border-top: none;
    align-self: flex-end;
}

/* Actions */
.bm-actions {
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Bulk Actions */
.bm-bulk-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.bm-bulk-actions select {
    min-width: 150px;
    height: 38px;
    padding: 6px 12px;
    border-radius: 4px;
    border: 1px solid #ccd0d4;
    background-color: #fff;
    font-size: 13px;
}

.bm-bulk-actions select:focus {
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
    outline: none;
}

.bm-bulk-actions button {
    height: 38px;
    padding: 0 15px;
    font-size: 13px;
    min-width: 70px;
}

/* Progress Bar */
.bm-progress {
    width: 100%;
    height: 20px;
    background: #f0f0f1;
    border-radius: 10px;
    overflow: hidden;
}

.bm-progress-bar {
    height: 100%;
    background: #2271b1;
    border-radius: 10px;
    color: #fff;
    text-align: center;
    font-size: 12px;
    line-height: 20px;
    transition: width 0.3s ease;
}

/* Links */
.bm-project-link {
    color: #2271b1;
    text-decoration: none;
    font-weight: 500;
}

.bm-project-link:hover {
    color: #135e96;
    text-decoration: underline;
}

/* Pagination */
.bm-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
    padding: 20px 0;
    border-top: 1px solid #ccd0d4;
}

.bm-page-info {
    color: #646970;
    font-size: 14px;
}

.bm-pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.bm-page-link {
    display: inline-block;
    padding: 8px 12px;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    color: #2271b1;
    text-decoration: none;
    font-size: 14px;
    line-height: 1;
}

.bm-page-link:hover {
    background: #f0f0f1;
    border-color: #999;
}

.bm-page-link.active {
    background: #2271b1;
    border-color: #2271b1;
    color: #fff;
    cursor: default;
}

/* Forms */
.bm-form-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.bm-form {
    width: 100%;
    margin: 0 auto;
}

/* Form Grid Layout */
.bm-form-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    margin-bottom: 30px;
}

@media (max-width: 768px) {
    .bm-form-grid {
        grid-template-columns: 1fr;
    }
}

.bm-form-main {
    min-width: 0;
}

.bm-form-sidebar {
    min-width: 0;
}

.bm-form-group {
    margin-bottom: 24px;
    min-width: 0;
}

.bm-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 10px;
}

.bm-checkbox-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.bm-checkbox-group input[type="checkbox"] {
    margin: 0;
}

fieldset {
    border: 1px solid #ccd0d4;
    padding: 15px;
    border-radius: 4px;
}

legend {
    padding: 0 10px;
    font-weight: 600;
    color: #1d2327;
}

.bm-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.bm-form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #1d2327;
}

.required {
    color: #dc3545;
    margin-left: 3px;
}

/* Required Field Styles */
.bm-form-input:required,
.bm-form-select:required {
    border-left: 3px solid #dc3545;
}

.bm-form-input:required:valid,
.bm-form-select:required:valid {
    border-left: 3px solid #28a745;
}

.bm-help-text {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #646970;
}

/* Date Input */
.bm-date-input {
    position: relative;
    display: flex;
    align-items: center;
}

.calendar-icon {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    font-size: 16px;
}

/* Status Section */
.bm-status-section {
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    padding: 24px;
}

.bm-status-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 20px 0;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 4px;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: currentColor;
    display: inline-block;
    flex-shrink: 0;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.status-text {
    font-size: 14px;
    font-weight: 500;
}

/* Status colors - match with status badge colors */
.bm-status-indicator[data-status="Pending"] {
    color: #e65100;
}

.bm-status-indicator[data-status="Contracted"] {
    color: #33691e;
}

.bm-status-indicator[data-status="High Value"] {
    color: #0d47a1;
}

.bm-status-indicator[data-status="Lost"] {
    color: #b71c1c;
}

.bm-status-indicator[data-status="Action Required"] {
    color: #880e4f;
}

.bm-status-indicator[data-status="Archive"] {
    color: #616161;
}

.bm-status-indicator[data-status="Completed"] {
    color: #2e7d32;
}

.bm-form-input,
.bm-form-textarea,
.bm-form-select {
    width: 100%;
    max-width: 100%; /* Ensures input doesn't overflow */
    padding: 8px 12px;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.5;
}

.bm-form-textarea {
    min-height: 100px;
    resize: vertical;
}

.bm-form-input:focus,
.bm-form-textarea:focus,
.bm-form-select:focus {
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
    outline: none;
}

.bm-form-actions {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #ccd0d4;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.bm-form-actions .bm-button {
    width: 100%;
    text-align: center;
    margin: 0;
}

/* Buttons */
.bm-button {
    display: inline-block;
    padding: 8px 16px;
    border: 1px solid transparent;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
}


.bm-button-primary {
    background: #2271b1;
    color: #fff;
    border-color: #2271b1;
}

.bm-button-primary:hover {
    background: #135e96;
    border-color: #135e96;
}

.bm-button-secondary {
    background: #f0f0f1;
    color: #1d2327;
    border-color: #ccd0d4;
}

.bm-button-secondary:hover {
    background: #e5e5e5;
    border-color: #999;
}

.bm-button-danger {
    background: #dc3232;
    color: #fff;
    border-color: #dc3232;
}

.bm-button-danger:hover {
    background: #b32d2e;
    border-color: #b32d2e;
}

/* Monthly Projections Calendar */
.bm-projections-calendar {
    width: 100%;
    padding: 20px 0;
}

/* Project Manager Filter */
.bm-filter-section {
    margin-bottom: 20px;
    padding: 20px;
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
}

.bm-multi-select-container {
    margin-top: 10px;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    overflow: hidden;
}

.bm-multi-select-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: #f0f0f1;
    border-bottom: 1px solid #ccd0d4;
}

.bm-selected-count {
    font-size: 13px;
    color: #646970;
}

.bm-select-all,
.bm-deselect-all {
    padding: 4px 8px;
    font-size: 12px;
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 3px;
    cursor: pointer;
}

.bm-select-all:hover,
.bm-deselect-all:hover {
    background: #f0f0f1;
}

.bm-multi-select-options {
    max-height: 200px;
    overflow-y: auto;
    padding: 10px;
}

.bm-multi-select-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
}

.bm-multi-select-option label {
    cursor: pointer;
    font-size: 14px;
}

.bm-filter-actions {
    margin-top: 15px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.bm-calendar-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.bm-month-card {
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    padding: 15px;
}

.bm-month-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #ccd0d4;
}

.bm-month-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.bm-month-total {
    font-size: 16px;
    font-weight: 600;
    color: #2271b1;
}

.bm-contractors-list {
    margin-bottom: 15px;
}

.bm-contractor-section {
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f0f0f1;
}

.bm-contractor-section:last-child {
    border-bottom: none;
}

.bm-contractor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.bm-contractor-name {
    font-weight: 500;
    color: #1d2327;
}

.bm-contractor-total {
    color: #2271b1;
    font-weight: 500;
}

.bm-projects-list {
    padding-left: 15px;
}

.bm-project-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
    font-size: 13px;
}

.bm-project-name {
    color: #646970;
}

.bm-project-amount {
    color: #2271b1;
}

.bm-month-footer {
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid #ccd0d4;
}

.bm-master-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    color: #1d2327;
}

.bm-total-amount {
    color: #2271b1;
}

/* Responsive adjustments */
@media screen and (max-width: 1024px) {
    .bm-calendar-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media screen and (max-width: 768px) {
    .bm-calendar-grid {
        grid-template-columns: 1fr;
    }
}

/* Login Required Message */
.bm-login-required {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 300px;
    padding: 2rem;
}

.bm-login-message {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    padding: 2rem;
    text-align: center;
    max-width: 500px;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.bm-login-message h2 {
    margin-top: 0;
    color: #343a40;
    margin-bottom: 1rem;
}

.bm-login-message p {
    margin-bottom: 1.5rem;
    color: #6c757d;
}

/* Empty State */
.bm-empty-state {
    text-align: center;
    padding: 40px 20px;
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    margin-bottom: 20px;
}

.bm-empty-state-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.bm-empty-state h2 {
    font-size: 24px;
    margin-bottom: 10px;
}

.bm-empty-state p {
    color: #646970;
    margin-bottom: 30px;
}

.bm-get-started {
    display: flex;
    gap: 30px;
    justify-content: center;
    max-width: 800px;
    margin: 0 auto;
}

.bm-get-started-item {
    flex: 1;
    padding: 20px;
    background: #f0f0f1;
    border-radius: 4px;
}

.bm-get-started-item h3 {
    font-size: 18px;
    margin-bottom: 10px;
}

.bm-get-started-item p {
    margin-bottom: 20px;
}

/* Dashboard */
.bm-dashboard {
    margin-top: 20px;
}

.bm-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 30px;
    justify-content: center;
}

.bm-stat-card {
    flex: 1;
    min-width: 200px;
    max-width: calc(25% - 15px);
}

/* Ensure cards are evenly spaced when less than 4 are shown */
@media (min-width: 768px) {
    .bm-stats:has(.bm-stat-card:only-child) .bm-stat-card {
        max-width: 50%;
    }
    
    .bm-stats:has(.bm-stat-card:nth-child(2)) .bm-stat-card {
        max-width: calc(50% - 10px);
    }
    
    .bm-stats:has(.bm-stat-card:nth-child(3)) .bm-stat-card {
        max-width: calc(33.33% - 14px);
    }
}

.bm-stat-card {
    background: #fff;
    padding: 20px;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    text-align: center;
}

/* Stat card left-border accents */
.bm-stat-card:has(.bm-active-projects)    { border-left: 3px solid #33691e; }
.bm-stat-card:has(.bm-projection-total)   { border-left: 3px solid #2271b1; }
.bm-stat-card:has(.bm-total-value)        { border-left: 3px solid #0d47a1; }
.bm-stat-card:has(.bm-current-year-value) { border-left: 3px solid #1976d2; }
.bm-stat-card:has(.bm-next-year-value)    { border-left: 3px solid #546e7a; }
.bm-stat-card:has(.bm-total-projects)     { border-left: 3px solid #646970; }

.bm-stat-value {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 10px;
}

.bm-stat-label {
    color: #646970;
}

/* Cards */
.bm-card {
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    margin-bottom: 20px;
    overflow: hidden;
}

.bm-card-header {
    padding: 15px 20px;
    border-bottom: 1px solid #ccd0d4;
}

.bm-card-header h2 {
    margin: 0;
    font-size: 16px;
}

/* Tables */
.bm-table {
    width: 100%;
    border-collapse: collapse;
}

/* Project and Contractor list table specific */
.bm-project-list,
.bm-contractor-list {
    overflow-x: auto;
    margin: 0;
    padding: 0;
}

.bm-project-list .bm-table {
    min-width: 950px;
    border-collapse: collapse;
    font-size: 13px;
}

/* Main projects page specific styles */
.bm-container > .bm-card > .bm-project-list .bm-table {
    table-layout: fixed;
}

.bm-contractor-list .bm-table {
    min-width: 900px;
    border-collapse: collapse;
    font-size: 13px;
    table-layout: fixed;
}

.bm-project-list .bm-table td {
    overflow: visible;
}

.bm-project-list .bm-table th,
.bm-project-list .bm-table td {
    padding: 10px 8px;
}

.bm-project-list .bm-table th {
    background: #f0f0f1;
}

.bm-table th,
.bm-table td {
    padding: 12px 8px;
    text-align: left;
    border-bottom: 1px solid #ccd0d4;
}

.bm-table th {
    background: #f0f0f1;
    font-weight: 600;
    white-space: normal; /* Allow text to wrap */
    padding: 12px 8px;
}

/* High Value Projects specific styles - completely isolated from other tables */
.bm-high-value-table {
    font-size: 13px;
    border-collapse: collapse;
    width: 100%;
}

/* Style the table header cells */
.bm-high-value-table th {
    background: #f0f0f1;
    font-weight: 600;
    text-align: center !important;
    padding: 10px 12px;
}

/* Style table cells */
.bm-high-value-table th,
.bm-high-value-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #ccd0d4;
}

/* Project column alignment */
.bm-high-value-table td:first-child {
    text-align: center;
}

/* Status column width */
.bm-high-value-table th:nth-child(2),
.bm-high-value-table td:nth-child(2) {
    min-width: 144px; /* Increased by 20% from 120px */
    padding-left: 8px;
    padding-right: 8px;
}

/* Style project links in high value table */
.bm-high-value-table .bm-project-link {
    display: block;
    width: 100%;
    text-align: center;
    padding: 2px 4px;
    color: #2271b1;
    text-decoration: none;
    font-weight: 500;
}

/* Style status wrapper */
.bm-high-value-table .bm-status-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
}

/* Add subtle row alternation */
.bm-high-value-table tr:nth-child(even) {
    background-color: #f8f9fa;
}

/* Override general project link styles */
.bm-project-link {
    text-align: inherit;
}

/* Style currency values in high value table */
.bm-high-value-table .bm-currency {
    display: inline-block;
    text-align: center;
    min-width: 90px;
    padding: 0 4px;
}

/* Right align contract value column */
.bm-high-value-table td:nth-child(3) {
    text-align: right !important;
    padding-right: 10px !important;
}

/* Style status badges in high value table */
.bm-high-value-table .bm-status-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Style follow-up checkmarks in high value table */
.bm-high-value-table td:last-child {
    text-align: center !important;
    font-size: 16px;
}

/* Set default alignment for all cells except first column */
.bm-high-value-table td:not(:first-child) {
    text-align: center !important;
}

/* Remove redundant padding rule since we already have it in the base styles */

/* Sales Team Performance and Follow-ups table alignment */
.bm-salespeople-list .bm-table th,
.bm-salespeople-list .bm-table td,
.bm-followups-list .bm-table th,
.bm-followups-list .bm-table td {
    text-align: center;
}

/* Keep action buttons right-aligned */
.bm-followups-list .bm-table td:last-child {
    text-align: center;
}

/* Contractor table alignment */
.bm-contractor-list .bm-table th {
    text-align: center;
}

.bm-contractor-list .bm-table td {
    text-align: center;
}

.bm-contractor-list .bm-table td:first-child {
    text-align: center;
}

.bm-contractor-info {
    display: flex;
    justify-content: center;
}

.bm-contact-info {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: center;
    padding: 4px 0;
}

.bm-contact-info > div {
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bm-contact-info a {
    color: #2271b1;
    text-decoration: none;
}

.bm-contact-info a:hover {
    text-decoration: underline;
}

.bm-contractor-list .bm-table td:last-child {
    text-align: center;
}

.bm-button-group {
    display: flex;
    justify-content: center;
}

/* Column alignments for project list */
.bm-project-list .bm-table th {
    text-align: center;
    padding: 12px 8px;
}

/* Center project links */
.bm-project-link {
    display: inline-block;
    width: 100%;
    text-align: center;
}

.bm-table td {
    white-space: nowrap;
    padding: 12px 8px;
}

/* Override any last-child rules for project list */
.bm-project-list .bm-table th:last-child,
.bm-project-list .bm-table td:last-child {
    text-align: center;
    padding: 10px 12px;
}

/* Column specific styles */
.bm-project-list .bm-table th:nth-child(1), /* Checkbox */
.bm-project-list .bm-table td:nth-child(1),
.bm-contractor-list .bm-table th:nth-child(1),
.bm-contractor-list .bm-table td:nth-child(1) {
    width: 30px;
    min-width: 30px;
    padding: 10px 8px;
    text-align: center;
}

/* Contractor table specific column styles */
.bm-contractor-list .bm-table th:nth-child(2), /* Name + contact sub-text */
.bm-contractor-list .bm-table td:nth-child(2) {
    min-width: 200px;
    width: 200px;
    max-width: 200px;
    padding-left: 8px;
    padding-right: 8px;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bm-contractor-link {
    display: inline-block;
    width: 100%;
    text-align: center;
}

.bm-contractor-list .bm-table th:nth-child(3), /* Total Projects */
.bm-contractor-list .bm-table td:nth-child(3),
.bm-contractor-list .bm-table th:nth-child(4), /* Active Projects */
.bm-contractor-list .bm-table td:nth-child(4) {
    min-width: 80px;
    width: 80px;
    text-align: center;
}

.bm-contractor-list .bm-table th:nth-child(5), /* Success Rate */
.bm-contractor-list .bm-table td:nth-child(5) {
    min-width: 100px;
    width: 100px;
    text-align: center;
}

.bm-success-rate {
    width: 100%;
    text-align: center;
    display: flex;
    justify-content: center;
}

.bm-success-rate-bar {
    text-align: center;
    background-color: #e3f2fd;
    border-radius: 3px;
    padding: 2px 4px;
    color: #0d47a1;
    display: inline-block;
}

.bm-contractor-list .bm-table th:nth-child(6), /* Active Value */
.bm-contractor-list .bm-table td:nth-child(6) {
    min-width: 110px;
    width: 110px;
    text-align: right;
    padding-right: 12px;
}

.bm-contractor-list .bm-table th:nth-child(7), /* Lifetime Value */
.bm-contractor-list .bm-table td:nth-child(7) {
    min-width: 110px;
    width: 110px;
    text-align: right;
    padding-right: 12px;
}

.bm-contractor-list .bm-table th:nth-child(8), /* Avg Margin */
.bm-contractor-list .bm-table td:nth-child(8) {
    min-width: 90px;
    width: 90px;
    text-align: center;
}

.bm-contractor-list .bm-table th:nth-child(9), /* Actions */
.bm-contractor-list .bm-table td:nth-child(9) {
    min-width: 80px;
    width: 80px;
    text-align: center;
}

/* Make contractor table buttons more compact */
.bm-contractor-list .bm-table .bm-button {
    padding: 3px 8px;
    font-size: 11px;
    min-width: 60px;
}

/* Contractor name: left-align to match contact sub-text */
.bm-contractor-list .bm-contractor-link {
    display: inline;
    width: auto;
    text-align: left;
}

/* Purchasing manager contact shown below contractor name */
.bm-contractor-contact-sub {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 3px;
    font-size: 11px;
    color: #646970;
    align-items: flex-start;
}

.bm-contractor-contact-sub a {
    color: #646970;
    text-decoration: none;
}

.bm-contractor-contact-sub a:hover {
    color: #2271b1;
    text-decoration: underline;
}

/* Rate bar in contractor list — constrain width, center in cell */
.bm-contractor-list .bm-rate-bar {
    max-width: 90px;
    margin: 0 auto;
}

/* Rate bar label in contractor list — match standard size */
.bm-contractor-list .bm-rate-label {
    font-size: 12px;
    min-width: 30px;
}

/* Checkbox column header and footer styling */
.bm-project-list .bm-table thead td.manage-column.column-cb.check-column,
.bm-project-list .bm-table tfoot td.manage-column.column-cb.check-column,
.bm-contractor-list .bm-table thead td.manage-column.column-cb.check-column,
.bm-contractor-list .bm-table tfoot td.manage-column.column-cb.check-column {
    background: #f0f0f1;
    border-bottom: 1px solid #ccd0d4;
}

/* Project Title column - base styles */
.bm-project-list .bm-table th:nth-child(2), /* Project Title */
.bm-project-list .bm-table td:nth-child(2) {
    min-width: 160px;
}

/* Project Title column - main projects page specific */
.bm-container > .bm-card > .bm-project-list .bm-table th:nth-child(2),
.bm-container > .bm-card > .bm-project-list .bm-table td:nth-child(2) {
    width: 160px;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bm-project-list .bm-table th:nth-child(3), /* Contractor */
.bm-project-list .bm-table td:nth-child(3) {
    min-width: 120px;
    text-align: center;
}

.bm-project-list .bm-table th:nth-child(4), /* Status */
.bm-project-list .bm-table td:nth-child(4) {
    text-align: center;
    min-width: 110px;
    max-width: 110px;
    width: 110px;
    padding: 10px 6px;
}

.bm-project-list .bm-table th:nth-child(5), /* Contract Value */
.bm-project-list .bm-table td:nth-child(5) {
    text-align: right;
    padding-right: 20px;
    min-width: 120px;
    width: 120px;
    white-space: nowrap;
    overflow: visible;
}

.bm-project-list .bm-table th:nth-child(6), /* Units */
.bm-project-list .bm-table td:nth-child(6) {
    text-align: center;
    white-space: nowrap;
    min-width: 60px;
    width: 60px;
}

.bm-project-list .bm-table th:nth-child(7), /* Start Date */
.bm-project-list .bm-table td:nth-child(7) {
    text-align: center;
    white-space: nowrap;
    overflow: visible;
    min-width: 90px;
    width: 90px;
}

.bm-project-list .bm-table th:nth-child(8), /* Sales Person */
.bm-project-list .bm-table td:nth-child(8) {
    text-align: center;
    white-space: nowrap;
    min-width: 120px;
    width: 120px;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bm-project-list .bm-table th:nth-child(9), /* Actions */
.bm-project-list .bm-table td:nth-child(9) {
    text-align: center;
    white-space: nowrap;
    min-width: 140px;
    width: 140px;
    max-width: 140px;
    padding-left: 4px;
    padding-right: 4px;
}

.bm-project-list .bm-table td:last-child { /* Follow-up */
    text-align: center;
    white-space: nowrap;
    font-size: 16px; /* Make checkmark slightly larger */
}

.bm-table tr:last-child td {
    border-bottom: none;
}

/* Actions column buttons */
.bm-project-list .bm-table td:last-child .bm-button-group {
    display: flex;
    justify-content: center;
    gap: 2px;
}

.bm-table td:last-child .bm-button {
    display: inline-block;
    padding: 3px 6px;
    font-size: 11px;
    min-width: 60px;
    text-align: center;
    margin: 0;
}

/* Status Indicators */
.bm-status {
    display: inline-block;
    padding: 4px 6px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 500;
    width: auto;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Adjust status badge in high value table */
.bm-high-value-table .bm-status {
    width: 90px;
}

.bm-status-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.bm-status-contracted { background: #dcedc8; color: #33691e; }
.bm-status-pending { background: #fff3e0; color: #e65100; }
.bm-status-high-value { background: #e3f2fd; color: #0d47a1; }
.bm-status-lost { background: #ffebee; color: #b71c1c; }
.bm-status-action-required { background: #fce4ec; color: #880e4f; }
.bm-status-archive { background: #eeeeee; color: #616161; }
.bm-status-completed { background: #e8f5e8; color: #2e7d32; }

/* Loading State */
.bm-loading {
    text-align: center;
    color: #646970;
    padding: 20px;
}

.bm-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
    z-index: 100;
}

#the-list.loading {
    position: relative;
    min-height: 100px;
}

/* Selected Row State */
tr.is-selected {
    background-color: #f0f6fc !important;
}

tr.is-selected:hover {
    background-color: #e5f0f9 !important;
}

/* Error State */
.bm-error {
    text-align: center;
    padding: 40px 20px;
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
}

.bm-error p {
    margin-bottom: 20px;
    color: #d32f2f;
}

/* Notifications */
.bm-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 4px;
    z-index: 9999;
    max-width: 400px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    white-space: pre-line;
}

.bm-notification-success {
    background-color: #28a745;
    color: white;
}

.bm-notification-error {
    background-color: #dc3545;
    color: white;
}

@keyframes slideIn {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Project Notes and Follow-ups Sections */
.bm-section {
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
}

.bm-section h3 {
    margin: 0 0 20px 0;
    font-size: 18px;
    font-weight: 600;
    color: #1d2327;
}

.bm-notes-list,
.bm-followups-list {
    margin-top: 20px;
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    overflow: hidden;
}

/* Adjust follow-ups table in sidebar */
.bm-status-section .bm-followups-list {
    margin-top: 15px;
    font-size: 13px;
}

.bm-status-section .bm-followups-list .bm-table th {
    padding: 8px 4px;
    font-size: 13px;
}

.bm-status-section .bm-followups-list .bm-table td {
    padding: 8px 4px;
    font-size: 13px;
}

.bm-status-section .bm-followups-list .bm-table th:first-child {
    width: 100px;
}

.bm-status-section .bm-followups-list .bm-table th:nth-child(2) {
    width: 80px;
}

.bm-status-section #add-followup-btn {
    width: 100%;
    margin-top: 10px;
}

.bm-notes-list .bm-table th:first-child,
.bm-followups-list .bm-table th:first-child {
    width: 180px;
}

.bm-notes-list .bm-table td,
.bm-followups-list .bm-table td {
    white-space: normal;
}

.bm-form-group button {
    margin-top: 10px;
}

.bm-empty {
    text-align: center;
    color: #646970;
    padding: 15px;
}

/* Overdue Follow-ups Styling */
.bm-overdue-followup {
    background-color: #fff5f5;
    border-left: 4px solid #ff6b6b;
}

.bm-overdue-followup td {
    color: #d32f2f;
    font-weight: 500;
}

.bm-overdue-followup .bm-project-link {
    color: #d32f2f;
}

.bm-overdue-followup .bm-project-link:hover {
    color: #b71c1c;
}

/* Performance Tab — Rate Bar */
.bm-rate-bar {
    display: flex;
    align-items: center;
    gap: 8px;
}

.bm-rate-track {
    flex: 1;
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    overflow: hidden;
    min-width: 60px;
}

.bm-rate-fill {
    height: 100%;
    border-radius: 3px;
}

.bm-rate-fill--high { background: #33691e; }
.bm-rate-fill--mid  { background: #e65100; }
.bm-rate-fill--low  { background: #b71c1c; }

.bm-rate-label {
    font-size: 12px;
    color: #646970;
    white-space: nowrap;
    min-width: 32px;
}

/* Performance Tab — Top Performer Row */
.bm-top-performer {
    background-color: #dcedc8;
}

.bm-top-performer td {
    font-weight: 500;
}

/* Performance Tab — Totals Footer */
.bm-performance-tfoot td {
    font-weight: 600;
    border-top: 2px solid #ccd0d4;
    color: #1d2327;
    background: #f0f0f1;
}

/* Due-Today Follow-ups Styling */
.bm-due-today-followup {
    background-color: #fff3e0;
    border-left: 4px solid #e65100;
}

.bm-due-today-followup td {
    color: #e65100;
    font-weight: 500;
}

.bm-due-today-followup .bm-project-link {
    color: #e65100;
}

.bm-due-today-followup .bm-project-link:hover {
    color: #bf360c;
}

/* Clickable Margin Styling */
.bm-clickable-margin {
    cursor: pointer;
    color: #2271b1;
    text-decoration: none;
    transition: all 0.2s ease;
}

.bm-clickable-margin:hover {
    color: #135e96;
    text-decoration: underline;
    background-color: #f0f6fc;
    padding: 2px 4px;
    border-radius: 3px;
    margin: -2px -4px;
}

/* Clickable Total Projects Styling */
.bm-clickable-total-projects {
    cursor: pointer;
    color: #2271b1;
    text-decoration: none;
    transition: all 0.2s ease;
}

.bm-clickable-total-projects:hover {
    color: #135e96;
    text-decoration: underline;
    background-color: #f0f6fc;
    padding: 2px 4px;
    border-radius: 3px;
    margin: -2px -4px;
}

/* Clickable Active Projects Styling */
.bm-clickable-active-projects {
    cursor: pointer;
    color: #2271b1;
    text-decoration: none;
    transition: all 0.2s ease;
}

.bm-clickable-active-projects:hover {
    color: #135e96;
    text-decoration: underline;
    background-color: #f0f6fc;
    padding: 2px 4px;
    border-radius: 3px;
    margin: -2px -4px;
}

/* Contractor detail — stat card strip */
.bm-stat-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 8px;
}

/* Contractor detail — performance sidebar: stack cards vertically */
.bm-contractor-performance-section .bm-stat-cards {
    flex-direction: column;
    gap: 8px;
}

.bm-contractor-performance-section .bm-stat-cards .bm-stat-card {
    min-width: 0;
    max-width: none;
    width: 100%;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.bm-contractor-performance-section .bm-stat-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #646970;
    order: 2;
}

.bm-contractor-performance-section .bm-stat-value {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 0;
    color: #1d2327;
    order: 1;
}

/* Rate bar in sidebar performance card */
.bm-contractor-performance-section .bm-rate-bar {
    order: 1;
    width: 100%;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.bm-contractor-performance-section .bm-rate-track {
    width: 100%;
    height: 8px;
}

.bm-contractor-performance-section .bm-rate-label {
    font-size: 18px;
    font-weight: 700;
    color: #1d2327;
    min-width: auto;
}

/* Contractor detail — actions sidebar: no orphaned border-top without h3 */
.bm-status-section .bm-form-actions {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

/* Contractor detail — danger zone separator before destructive action */
.bm-danger-zone {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #fde8e8;
}

.bm-danger-zone .bm-button {
    width: 100%;
    text-align: center;
}

/* Contractor detail — purchasing manager section is subordinate */
.bm-form-main .bm-section + .bm-section {
    background: #fff;
}

.bm-form-main .bm-section + .bm-section h3 {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #646970;
    margin-bottom: 16px;
}

/* Contractor detail — projects table sits directly in section, no nested card */
.bm-contractor-projects-section {
    overflow: hidden;
}

/* Proposal 1 — contractor name as record identity heading */
.bm-contractor-detail .bm-form-header h2 {
    border-left: 4px solid #2271b1;
    padding-left: 12px;
    min-height: 1.4em;
}

/* Proposal 5 — projects table column proportions */
.bm-contractor-projects-table {
    table-layout: fixed;
    margin-top: 12px;
}

.bm-contractor-projects-table th,
.bm-contractor-projects-table td {
    text-align: center;
}

.bm-contractor-projects-table th:nth-child(1) { width: 200px; }
.bm-contractor-projects-table th:nth-child(2) { width: 110px; }
.bm-contractor-projects-table th:nth-child(3) { width: 130px; }
.bm-contractor-projects-table th:nth-child(4) { width: 100px; }
.bm-contractor-projects-table th:nth-child(5) { width: 110px; }
.bm-contractor-projects-table th:nth-child(6) { width: 65px; }

/* Proposal 6 — compact Edit button in projects table */
.bm-contractor-projects-table .bm-project-link.bm-button {
    padding: 4px 10px;
    font-size: 12px;
}

/* Proposal 7 — tighter sidebar section padding */
.bm-contractor-detail .bm-status-section {
    padding: 16px;
}

/* Contractor detail — status filter dropdown natural width */
.bm-section-header .bm-form-select {
    width: auto;
}

/* Contractor detail — section header with inline filter */
.bm-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
}

.bm-section-header h3 {
    margin: 0;
}
