/* ========== RK Product app styles — brand tokens in css/planahome-theme.css ========== */

/* Uniform page container - use on all main pages */
.page-wrapper {
    padding: 1.5rem;
    max-width: 100%;
}

.rk-page-feedback:focus {
    outline: 2px solid rgba(37, 99, 235, 0.45);
    outline-offset: 2px;
}

.rk-page-feedback:focus:not(:focus-visible) {
    outline: none;
}

.rk-page-feedback:focus-visible {
    outline: 2px solid rgba(37, 99, 235, 0.45);
    outline-offset: 2px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-header-content { flex: 1; }

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--bb-dark);
    margin: 0 0 0.25rem 0;
    letter-spacing: -0.02em;
}

.page-subtitle {
    color: var(--bb-secondary);
    font-size: 0.9rem;
    margin: 0;
}

/* Uniform filter card - dashboard, projects, admin grids */
.admin-filter-card,
.uniform-filter-card {
    background: var(--bb-card-bg);
    border: 1px solid var(--bb-border);
    border-radius: var(--bb-radius-lg);
    box-shadow: var(--bb-shadow-sm);
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
}

.admin-filter-card h6,
.uniform-filter-card h6 {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--bb-secondary);
    margin-bottom: 0.75rem;
}

/* Admin grid with built-in filter bar and pagination */
.admin-grid-card {
    background: var(--bb-card-bg);
    border: 1px solid var(--bb-border);
    border-radius: var(--bb-radius-lg);
    box-shadow: var(--bb-shadow);
    overflow-x: auto;
    overflow-y: visible;
}

.admin-grid-filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: #f8fafc;
    border-bottom: 1px solid var(--bb-border);
}

.admin-grid-filter-bar .form-control-sm,
.admin-grid-filter-bar .form-select-sm {
    min-width: 140px;
}

.admin-grid-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    background: #fafbfc;
    border-top: 1px solid var(--bb-border);
}

.admin-grid-pagination .pagination { gap: 0.25rem; margin: 0; }
.admin-grid-pagination .page-link {
    color: var(--bb-primary);
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    padding: 0.375rem 0.75rem;
}
.admin-grid-pagination .page-item.active .page-link {
    background: var(--bb-primary);
    border-color: var(--bb-primary);
    color: #fff;
}
.admin-grid-pagination-info {
    font-size: 0.875rem;
    color: var(--bb-secondary);
}

/* ========== Unified Table & Grid Theme - font, colors, styles ========== */
.table,
.projects-table,
.dashboard-projects-table,
.admin-settings-grid .table,
.task-config-grid .table,
.tasks-page .table,
.tasks-page-grid .table,
.inbox-grid table,
.payments-repeater-table {
    font-family: var(--bb-font);
}

.table thead th,
.projects-table thead th,
.dashboard-projects-table thead th,
.admin-settings-grid .table thead th,
.task-config-grid .table thead th,
.tasks-page .table thead th,
.tasks-page-grid .table thead th,
.inbox-grid table thead th {
    font-family: var(--bb-font);
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--bb-dark);
    background: #f1f5f9 !important;
    border-color: #e2e8f0 !important;
    padding: 0.875rem 1rem !important;
}

.table tbody td,
.projects-table tbody td,
.dashboard-projects-table tbody td,
.admin-settings-grid .table tbody td,
.task-config-grid .table tbody td,
.tasks-page .table tbody td,
.inbox-grid table tbody td {
    font-family: var(--bb-font);
    font-size: 0.9rem;
    color: var(--bb-dark);
    border-color: #e2e8f0;
}

.table tbody tr:hover,
.projects-table tbody tr:hover,
.dashboard-projects-table tbody tr:hover,
.admin-settings-grid .table.table-hover tbody tr:hover,
.task-config-grid .table tbody tr:hover,
.tasks-page .table tbody tr:hover,
.inbox-grid table tbody tr:hover {
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%) !important;
}

.table.table-striped tbody tr:nth-of-type(odd),
.projects-table.table-striped tbody tr:nth-of-type(odd),
.dashboard-projects-table tbody tr:nth-of-type(odd) {
    background-color: rgba(241, 245, 249, 0.5);
}

/* Project open > configured days and not completed — red row background, normal text & borders */
tr.project-overdue-incomplete,
tr.project-overdue-incomplete:nth-of-type(odd),
.projects-table tbody tr.project-overdue-incomplete,
.projects-table tbody tr.project-overdue-incomplete:nth-of-type(odd),
.dashboard-projects-table tbody tr.project-overdue-incomplete,
.dashboard-projects-table tbody tr.project-overdue-incomplete:nth-of-type(odd),
.table tbody tr.project-overdue-incomplete,
.table tbody tr.project-overdue-incomplete:nth-of-type(odd) {
    background-color: #f8d7da !important;
    background: #f8d7da !important;
}

tr.project-overdue-incomplete:hover,
.projects-table tbody tr.project-overdue-incomplete:hover,
.dashboard-projects-table tbody tr.project-overdue-incomplete:hover,
.table tbody tr.project-overdue-incomplete:hover {
    background-color: #f1c0c5 !important;
    background: #f1c0c5 !important;
}

.project-card.project-overdue-incomplete {
    border-color: #f5c6cb !important;
    background-color: #f8d7da;
}

.project-card.project-overdue-incomplete .project-card-title,
.project-card.project-overdue-incomplete .project-card-meta-row {
    color: var(--bb-dark);
}

.table.table-bordered,
.projects-table.table-bordered,
.dashboard-projects-table {
    border-color: #e2e8f0;
}

.projects-card .table-responsive,
.dashboard-projects-card .card-body .table-responsive,
.admin-grid-card .table-responsive {
    border-radius: 0 0 var(--bb-radius) var(--bb-radius);
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
}

/* Roles grid - Users, roles & page access page - theme font and styles */
.roles-grid-section {
    font-family: var(--bb-font);
}

.roles-grid-card .card-header {
    font-family: var(--bb-font);
    font-weight: 600;
    font-size: 1rem;
    color: var(--bb-dark);
}

.roles-grid-card .admin-grid-filter-bar .form-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--bb-secondary);
}

.roles-grid-card .admin-grid-filter-bar .form-control,
.roles-grid-card .admin-grid-filter-bar .form-select {
    font-size: 0.875rem;
}

.roles-grid-card .table {
    font-size: 0.9rem;
}

.roles-grid-card .table thead th {
    font-family: var(--bb-font);
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--bb-secondary);
}

.roles-grid-card .table tbody td {
    font-family: var(--bb-font);
    color: var(--bb-dark);
}

.roles-grid-card .table tbody td strong {
    font-weight: 600;
    color: var(--bb-dark);
}

.roles-grid-card .badge.bg-success {
    background: var(--bb-success) !important;
}

.roles-grid-card .badge.bg-secondary {
    background: var(--bb-secondary) !important;
}

.roles-grid-card .btn-outline-primary {
    border-color: var(--bb-primary);
    color: var(--bb-primary);
}

.roles-grid-card .btn-outline-primary:hover {
    background: var(--bb-primary);
    color: #fff;
}

.roles-grid-card .btn-outline-danger:hover {
    background: var(--bb-danger);
    color: #fff;
}

h1:focus {
    outline: none;
}

a, .btn-link {
    color: #0071c1;
}

/* Override for sidebar navigation links - ensure they are white - HIGHEST PRIORITY */
.sidebar a,
.sidebar .nav-link,
.sidebar-nav a,
.sidebar-nav .nav-link,
.sidebar-nav .nav-item a,
.sidebar-nav .nav-item .nav-link,
.sidebar-nav .nav-item ::deep a,
.sidebar-nav .nav-item ::deep .nav-link,
div.sidebar-nav a,
div.sidebar-nav .nav-link,
div.sidebar-nav .nav-item a,
div.sidebar-nav .nav-item .nav-link {
    color: #ffffff !important;
}

.sidebar a span,
.sidebar-nav a span,
.sidebar-nav .nav-link span,
.sidebar-nav .nav-item a span,
.sidebar-nav .nav-item .nav-link span,
.sidebar-nav .nav-item ::deep a span,
.sidebar-nav .nav-item ::deep .nav-link span,
.sidebar-nav .nav-item ::deep .nav-link *,
div.sidebar-nav a span,
div.sidebar-nav .nav-link span,
div.sidebar-nav .nav-item a span,
div.sidebar-nav .nav-item .nav-link span {
    color: #ffffff !important;
}

/* Ensure all text content inside sidebar nav links is white */
.sidebar-nav .nav-item ::deep .nav-link,
.sidebar-nav .nav-item .nav-link {
    color: #ffffff !important;
}

.sidebar-nav .nav-item ::deep .nav-link *:not(.nav-icon),
.sidebar-nav .nav-item .nav-link *:not(.nav-icon) {
    color: #ffffff !important;
}

.btn-primary {
    color: #fff;
    background: linear-gradient(180deg, var(--bb-primary) 0%, var(--bb-primary-dark) 100%);
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 2px 4px rgba(var(--bs-primary-rgb), 0.28), 0 1px 0 rgba(255, 255, 255, 0.2) inset;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.btn-primary:hover {
    box-shadow: 0 4px 8px rgba(var(--bs-primary-rgb), 0.38), 0 1px 0 rgba(255, 255, 255, 0.2) inset;
}

.form-control, .form-select {
    border: 1px solid #cbd5e1;
    border-radius: var(--bb-radius);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--bb-primary);
    box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb), 0.25);
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem rgba(var(--bs-primary-rgb), 0.45);
}

.content {
    padding-top: 1.1rem;
}

/* Global cards - 3D Blazor Bootstrap look */
.card {
    background: var(--bb-card-bg);
    border: 1px solid var(--bb-border);
    border-radius: var(--bb-radius-lg);
    box-shadow: var(--bb-shadow);
    overflow: hidden;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.card:hover {
    box-shadow: var(--bb-shadow-md);
}

/* Search/Filter panel - Projects, Dashboard - 3D look */
.card.mb-4.shadow-sm,
.projects-page .card.mb-4 {
    box-shadow: var(--bb-shadow-md), 0 1px 0 rgba(255, 255, 255, 0.8) inset;
    border: 1px solid var(--bb-border);
    border-radius: var(--bb-radius-lg);
}

.projects-page .card.mb-4 .card-body h6 {
    font-weight: 600;
    color: #475569;
}

.card .card-body {
    padding: 1.25rem 1.5rem;
}

.card .card-header {
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid var(--bb-border);
    font-weight: 600;
    padding: 0.875rem 1.25rem;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHZpZXdCb3g9IjAgMCA1NiA0OSIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTEzLjUgNi41TDIwLjUgMTIuNUwzMy41IDAuNUw0MC41IDYuNUw1My41IDAuNVY0OUg2LjVWMC41TDEzLjUgNi41WiIgZmlsbD0iI0U4NDQzNyIvPgo8cGF0aCBkPSJNMjAgMTJMMzQgMEw0OCAxMlY0OUgyMFYxMloiIGZpbGw9IiNGRkZGRkYiLz4KPHA+PC9wPgo8L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "An error has occurred."
}

.modal {
    z-index: 1050;
}

.modal-content {
    border-radius: var(--bb-radius-xl);
    box-shadow: var(--bb-shadow-lg);
    border: 1px solid var(--bb-border);
}

.modal-backdrop {
    z-index: 1040;
}

.alert {
    border-radius: var(--bb-radius);
    border: 1px solid transparent;
}

.alert-danger {
    border-color: #fecaca;
}

.alert-success {
    border-color: #bbf7d0;
}

/* ========== Workflow progress - project detail ========== */
.workflow-progress-card {
    border: 1px solid var(--bb-border);
    border-radius: var(--bb-radius-xl);
    overflow: hidden;
    box-shadow: var(--bb-shadow);
    transition: box-shadow 0.2s ease;
}

.workflow-progress-card:hover {
    box-shadow: var(--bb-shadow-md);
}

.workflow-progress-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e9ecef;
}

.workflow-progress-header {
    margin-bottom: 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #495057;
}

.workflow-progress-title {
    opacity: 0.95;
}

.workflow-progress-body {
    padding: 0;
}

.workflow-stepper {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0;
    flex-wrap: nowrap;
    position: relative;
}

.workflow-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    min-width: 0;
    position: relative;
    text-align: center;
}

.workflow-step-marker {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: #e9ecef;
    color: #6c757d;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    flex-shrink: 0;
    z-index: 2;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.workflow-step-num {
    display: block;
    line-height: 1;
}

.workflow-step-check {
    font-size: 1rem;
    color: #fff;
    line-height: 1;
    font-weight: 700;
}

.workflow-step.done .workflow-step-marker {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(39, 174, 96, 0.35);
}

.workflow-step.current .workflow-step-marker {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: #fff;
    box-shadow: 0 0 0 4px rgba(52, 152, 219, 0.25);
}

.workflow-step-content {
    flex: 1;
    min-width: 0;
    max-width: 100%;
}

.workflow-step-label {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: #95a5a6;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    line-height: 1.2;
}

.workflow-step-tasks {
    padding-left: 1rem;
    text-align: left;
}

.workflow-step-task {
    font-size: 0.7rem;
    color: #7f8c8d;
    line-height: 1.4;
}

.workflow-step.current .workflow-step-task {
    color: #2980b9;
}

.workflow-step.done .workflow-step-task {
    color: #27ae60;
}

.workflow-step.current .workflow-step-label {
    color: #2980b9;
    font-weight: 600;
}

.workflow-step.done .workflow-step-label {
    color: #27ae60;
    font-weight: 500;
}

.workflow-step-connector {
    position: absolute;
    left: calc(50% + 1.25rem);
    top: 1.25rem;
    right: -50%;
    height: 3px;
    margin-right: 1.25rem;
    background: #e9ecef;
    z-index: 1;
    border-radius: 2px;
    pointer-events: none;
}

.workflow-step.done .workflow-step-connector {
    background: linear-gradient(90deg, #27ae60, #2ecc71);
}

.workflow-step.last .workflow-step-connector {
    display: none;
}

/* Next step callout */
.workflow-next-callout {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-top: 1.5rem;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, #ebf5fb 0%, #e8f6f3 100%);
    border-radius: 10px;
    border-left: 4px solid #3498db;
}

.workflow-next-icon {
    font-size: 1.25rem;
    color: #3498db;
    font-weight: 700;
    line-height: 1.4;
    flex-shrink: 0;
}

/* ========== Milestone Progress Today - construction progress ========== */
.milestone-progress-section {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: var(--bb-radius-lg);
    border: 1px solid var(--bb-border);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
}

.milestone-progress-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.milestone-progress-header .bi {
    font-size: 1.1rem;
    color: var(--bb-primary);
}

.milestone-progress-title {
    font-weight: 600;
    font-size: 1rem;
    color: var(--bb-dark);
    margin: 0;
}

.milestone-progress-hint {
    font-size: 0.8rem;
    color: var(--bb-secondary);
    margin: 0 0 1rem 0;
    line-height: 1.4;
}

.milestone-progress-table-wrap {
    overflow-x: auto;
    margin-top: 0.75rem;
}

.milestone-progress-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.milestone-progress-table thead th {
    padding: 0.6rem 0.75rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--bb-secondary);
    border-bottom: 1px solid var(--bb-border);
}

.milestone-progress-row {
    border-bottom: 1px solid var(--bb-border-light);
    transition: background 0.15s ease;
}

.milestone-progress-row:hover {
    background: rgba(37, 99, 235, 0.04);
}

.milestone-progress-row.has-value {
    background: linear-gradient(to right, rgba(5, 150, 105, 0.06) 0%, transparent 100%);
}

.milestone-progress-row td {
    padding: 0.75rem;
    vertical-align: middle;
}

.milestone-progress-cell-name {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.milestone-progress-cell-name .milestone-name {
    font-weight: 500;
    color: var(--bb-dark);
}

.milestone-progress-cell-pct {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--bb-dark);
}

.milestone-progress-cell-bar {
    min-width: 120px;
}

.milestone-progress-cell-input .milestone-progress-input-wrap {
    display: inline-flex;
    justify-content: flex-end;
}

.milestone-progress-bar-wrap {
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
}

.milestone-progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--pah-primary) 0%, var(--pah-primary-bright) 100%);
    border-radius: 2px;
    transition: width 0.25s ease;
}

.milestone-progress-row.has-value .milestone-progress-bar-fill {
    background: linear-gradient(90deg, var(--bb-success) 0%, #10b981 100%);
}

.milestone-progress-input-wrap {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.milestone-progress-input-wrap input {
    flex: 1;
    min-width: 4rem;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: right;
    padding: 0.4rem 0.5rem;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.milestone-progress-input-wrap input:focus {
    outline: none;
    border-color: var(--bb-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.milestone-progress-input-wrap input::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

.milestone-progress-input-wrap input:disabled {
    background: #f1f5f9;
    color: #94a3b8;
    cursor: not-allowed;
}

.milestone-progress-input-wrap .percent-suffix {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--bb-secondary);
    flex-shrink: 0;
}

.milestone-progress-empty {
    text-align: center;
    padding: 2rem;
    background: #fff;
    border-radius: var(--bb-radius);
    border: 1px dashed #cbd5e1;
}

.milestone-progress-empty .bi {
    font-size: 2rem;
    color: #94a3b8;
    margin-bottom: 0.75rem;
}

.milestone-progress-empty p {
    margin: 0;
    color: var(--bb-secondary);
    font-size: 0.9rem;
}

.milestone-progress-empty .btn {
    margin-top: 0.75rem;
}

.workflow-next-content {
    flex: 1;
    min-width: 0;
}

.workflow-next-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #2980b9;
    margin-bottom: 0.25rem;
}

.workflow-next-message {
    font-size: 0.9rem;
    color: #2c3e50;
    line-height: 1.5;
}

@media (max-width: 768px) {
    .workflow-stepper {
        flex-wrap: wrap;
        gap: 1rem;
    }
    .workflow-step {
        flex: 0 0 auto;
        width: calc(33.333% - 0.5rem);
    }
    .workflow-step-connector {
        display: none;
    }
}

/* ========== Project information - project detail ========== */
.project-info-card,
.project-payments-card,
.project-tasks-card {
    border: 1px solid var(--bb-border);
    border-radius: var(--bb-radius-xl);
    overflow: hidden;
    box-shadow: var(--bb-shadow);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.project-info-card:hover,
.project-payments-card:hover,
.project-tasks-card:hover {
    box-shadow: var(--bb-shadow-lg) !important;
}

.project-info-header {
    background: linear-gradient(135deg, #1e293b 0%, #334155 50%, #475569 100%);
    color: #fff;
    padding: 0;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) inset;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.section-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.25rem;
    background: transparent;
    border: none;
    color: #fff;
    cursor: pointer;
    text-align: left;
    font-size: inherit;
    font-weight: inherit;
    letter-spacing: inherit;
    text-transform: inherit;
    transition: background-color 0.2s ease;
    user-select: none;
}

.section-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.section-toggle:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: -2px;
}

.section-toggle:active {
    background-color: rgba(255, 255, 255, 0.15);
}

.section-chevron {
    font-size: 0.75rem;
    transition: transform 0.25s ease;
    opacity: 0.85;
    flex-shrink: 0;
    margin-left: 0.75rem;
    display: inline-block;
    line-height: 1;
}

.section-chevron.expanded {
    transform: rotate(180deg);
}

.project-info-title,
.project-payments-title {
    opacity: 0.95;
    flex: 1;
}

.project-info-body {
    background: linear-gradient(to bottom, #fafbfc 0%, #fff 100%);
    padding: 1rem 1.25rem;
}

.project-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
}

@media (max-width: 768px) {
    .project-info-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.625rem;
    }
}

@media (max-width: 576px) {
    .project-info-grid {
        grid-template-columns: 1fr;
        gap: 0.625rem;
    }
}

.project-info-grid-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.625rem 0.75rem;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    transition: all 0.2s ease;
}

.project-info-grid-item:hover {
    background: #ffffff;
    border-color: #dee2e6;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.project-info-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin: 0;
    line-height: 1.2;
}

.project-info-value {
    font-size: 0.875rem;
    color: #2c3e50;
    font-weight: 500;
    margin: 0;
    word-break: break-word;
    line-height: 1.3;
}

.project-info-value-highlight {
    color: #1b6ec2 !important;
    font-weight: 600 !important;
    font-size: 1.05rem !important;
}

.project-info-badge-pending {
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.35rem 0.65rem;
}

.project-info-badge-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
    color: #fff !important;
}

.project-info-badge-success {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%) !important;
    color: #fff !important;
}

/* ========== Project info subsection (Amount received & date) ========== */
.project-info-subsection {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid #e9ecef;
}

.project-info-subsection-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: #495057;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 0.2rem 0;
}

.project-info-subsection-desc {
    font-size: 0.8rem;
    color: #6c757d;
    margin: 0 0 1rem 0;
}

.payments-repeater-subsection {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

/* ========== Payments repeater (amount received & date) ========== */
.payments-repeater {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid #e9ecef;
}

.payments-repeater-header {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    margin-bottom: 1rem;
}

.payments-repeater-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: #495057;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.payments-repeater-subtitle {
    font-size: 0.75rem;
    color: #6c757d;
}

.payments-repeater-table-wrap {
    margin-bottom: 1rem;
    border: 1px solid var(--bb-border);
    border-radius: var(--bb-radius);
    overflow: hidden;
    background: var(--bb-card-bg);
    box-shadow: var(--bb-shadow-sm);
}

.payments-repeater-table {
    width: 100%;
    margin: 0;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.payments-repeater-table thead {
    background: linear-gradient(180deg, #f8fafc 0%, #e2e8f0 100%);
    border-bottom: 2px solid #cbd5e1;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.payments-repeater-table th {
    padding: 0.6rem 0.85rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6c757d;
    text-align: left;
}

.payments-repeater-table tbody tr {
    border-bottom: 1px solid #f1f3f5;
}

.payments-repeater-table tbody tr:last-child {
    border-bottom: none;
}

.payments-repeater-table tbody tr:hover {
    background: #fafbfc;
}

.payments-repeater-table td {
    padding: 0.6rem 0.85rem;
    color: #2c3e50;
}

.payments-repeater-num {
    font-weight: 500;
    color: #6c757d;
    width: 2rem;
}

.payments-repeater-amount {
    font-weight: 600;
    color: #0d6efd;
}

.payments-repeater-actions-col {
    width: 140px;
}

.payments-repeater-actions {
    white-space: nowrap;
}

.payments-repeater-actions .btn + .btn {
    margin-left: 0.25rem;
}

.payments-repeater-edit-row td {
    vertical-align: middle;
}

.payments-repeater-edit-row .payments-repeater-amount-input {
    max-width: 120px;
}

.payments-repeater-empty {
    font-size: 0.85rem;
    color: #6c757d;
    margin: 0 0 1rem 0;
    font-style: italic;
}

.payments-repeater-add {
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px dashed #dee2e6;
}

.payments-repeater-add-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: #495057;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.5rem;
}

.payments-repeater-add-fields {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.payments-repeater-add-fields--extended {
    align-items: flex-end;
}

.payments-repeater-field {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.payments-repeater-field-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.payments-repeater-field--remarks {
    flex: 1 1 12rem;
    min-width: 10rem;
}

.payments-repeater-field--action {
    flex: 0 0 auto;
}

.payments-repeater-invoice-input {
    width: 11rem;
    background-color: #f8f9fa;
}

.payments-repeater-remarks-input {
    min-width: 10rem;
}

.payments-repeater-remarks-cell {
    max-width: 14rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.payments-repeater-date {
    width: 10.5rem;
}

.payments-repeater-amount-input {
    width: 8rem;
}

.payments-repeater-add-btn {
    font-weight: 600;
}

.payments-repeater-error {
    font-size: 0.8rem;
    color: #dc3545;
    margin-top: 0.5rem;
}

.payments-repeater-modal {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.payments-repeater-modal .payments-repeater-header {
    margin-bottom: 0.85rem;
}

.main-task-row {
    background: #fff;
}

.subtask-row {
    background: #fafbfc;
}

/* ========== Project payments section - project detail ========== */
.project-payments-card {
    border: none;
    border-radius: 12px;
    overflow: hidden;
}

.project-payments-header {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: #fff;
    padding: 0;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.project-payments-body {
    background: linear-gradient(to bottom, #fafbfc 0%, #fff 100%);
    padding: 1.25rem 1.5rem;
}

.project-payments-subtitle {
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.payments-repeater-section {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

/* ========== Project tasks section - project detail ========== */
.project-tasks-card {
    border: none;
    border-radius: 12px;
    overflow: hidden;
}

.project-tasks-header {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: #fff;
    padding: 0;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.project-tasks-body {
    background: linear-gradient(to bottom, #fafbfc 0%, #fff 100%);
    padding: 1.25rem 1.5rem;
}

.project-tasks-table {
    margin-bottom: 0;
}

.project-tasks-table thead tr {
    background: linear-gradient(180deg, #f8fafc 0%, #e2e8f0 100%);
    border-bottom: 2px solid #cbd5e1;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.project-tasks-table .project-tasks-filter-row th {
    padding: 0.4rem 0.5rem;
    font-weight: normal;
    vertical-align: middle;
}

.project-tasks-table .project-tasks-filter-row .form-control-sm,
.project-tasks-table .project-tasks-filter-row .form-select-sm {
    min-width: 100px;
    font-size: 0.8rem;
}

.project-tasks-table thead th {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #495057;
    padding: 0.75rem 1rem;
    border: none;
}

.project-tasks-table tbody td {
    padding: 0.75rem 1rem;
    vertical-align: middle;
}

.project-tasks-table .task-indent {
    color: #95a5a6;
    margin-right: 0.35rem;
}

.project-tasks-table .task-name {
    font-weight: 500;
    color: #2c3e50;
}

.project-tasks-table .stage-badge {
    background: #e9ecef;
    color: #495057;
    font-weight: 500;
    font-size: 0.75rem;
}

.project-tasks-empty {
    text-align: center;
    padding: 3rem 2rem;
    color: #6c757d;
}

.project-pc-task-section {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}

.project-pc-task-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.65rem 1rem;
    background: linear-gradient(180deg, #f1f5f9 0%, #e2e8f0 100%);
    border-bottom: 1px solid #cbd5e1;
}

.project-pc-task-section-header h6 {
    font-weight: 600;
    color: #334155;
}

.project-pc-task-section .task-list-simple {
    padding: 0.25rem 0;
}

.pc-site-tracking-table-wrap {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
}

.pc-site-tracking-table thead th {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #64748b;
    white-space: nowrap;
}

.pc-site-tracking-row-expanded td {
    background: #f8fafc;
}

.pc-site-tracking-detail-row td {
    background: #f1f5f9;
}

.pc-site-tracking-panel {
    border-top: 1px solid #e2e8f0;
    background: #fff;
}

.pc-site-chevron {
    display: inline-block;
    transition: transform 0.2s ease;
    font-size: 0.65rem;
}

.pc-site-chevron.expanded {
    transform: rotate(-180deg);
}

.pc-site-cost-accordion .accordion-button {
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.65rem 1rem;
}

.pc-site-cost-accordion .accordion-body {
    background: #fafbfc;
}

.pc-site-entry-list .list-group-item {
    border-bottom: 1px solid #e2e8f0;
}

.pc-site-entry-editing {
    background: #eff6ff;
    border-radius: 6px;
    padding: 0.35rem 0.5rem !important;
}

.pc-material-site-table thead th {
    font-size: 0.75rem;
    white-space: nowrap;
}

.pc-material-site-table tfoot td {
    font-size: 0.85rem;
}

.pc-vendor-payments-table-wrap {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
}

.pc-vendor-payments-detail-row td {
    background: #f8fafc;
    border-top: none;
}

tr.pc-vendor-balance-due td {
    background: #fffbeb;
}

.project-tasks-empty-icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 1rem;
    opacity: 0.7;
}

.project-tasks-empty-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
}

.project-tasks-empty-text {
    font-size: 0.9rem;
    max-width: 28rem;
    margin: 0 auto;
    line-height: 1.5;
}

/* ========== Workflow by stage - tasks grouped by stage ========== */
.workflow-by-stage {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.workflow-stage-card {
    border: 1px solid var(--bb-border);
    border-radius: var(--bb-radius-lg);
    margin-bottom: 1rem;
    overflow: hidden;
    background: var(--bb-card-bg);
    box-shadow: var(--bb-shadow-sm);
    transition: box-shadow 0.2s ease;
}

.workflow-stage-card:hover {
    box-shadow: var(--bb-shadow);
}

.workflow-stage-card.stage-done {
    border-color: #d1fae5;
    background: linear-gradient(to bottom, #f0fdf4 0%, #fff 100%);
}

.workflow-stage-card.stage-current {
    border-color: #93c5fd;
    background: linear-gradient(to bottom, #eff6ff 0%, #fff 100%);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
}

.workflow-stage-header {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    font-weight: 600;
    font-size: 0.95rem;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.workflow-stage-card.stage-done .workflow-stage-header {
    background: #ecfdf5;
    border-bottom-color: #d1fae5;
}

.workflow-stage-card.stage-current .workflow-stage-header {
    background: #eff6ff;
    border-bottom-color: #93c5fd;
}

.workflow-stage-num {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    background: #6c757d;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    margin-right: 0.75rem;
    flex-shrink: 0;
}

.workflow-stage-card.stage-done .workflow-stage-num {
    background: #10b981;
}

.workflow-stage-card.stage-current .workflow-stage-num {
    background: #3b82f6;
}

.workflow-stage-check {
    color: #10b981;
    font-weight: 700;
}

.workflow-stage-tasks {
    padding: 0.5rem 0;
}

.workflow-stage-task-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 1rem;
    border-bottom: 1px solid #f1f3f5;
    gap: 1rem;
}

.workflow-stage-task-row:last-child {
    border-bottom: none;
}

.workflow-stage-task-row:hover {
    background: #fafbfc;
}

.workflow-stage-task-info {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    flex: 1;
    min-width: 0;
}

.workflow-stage-task-name {
    font-weight: 500;
    color: #2c3e50;
}

.workflow-stage-task-actions {
    flex-shrink: 0;
}

.workflow-stage-connector {
    text-align: center;
    padding: 0.5rem;
    color: #94a3b8;
    font-size: 1rem;
}

/* ========== Task Management Modal - Approval section ========== */
.task-modal-approval-section {
    margin-top: 0.5rem;
}

.task-modal-approval-callout {
    padding: 1rem 1.25rem;
    border-radius: 10px;
    border-left: 4px solid #6c757d;
    background: #f8f9fa;
}

.task-modal-approval-heading {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.35rem;
    color: #1e293b;
}

.task-modal-approval-desc {
    font-size: 0.9rem;
    color: #475569;
    margin-bottom: 0;
}

.task-modal-callout-submit {
    border-left-color: #0d6efd;
    background: linear-gradient(to right, #e7f1ff 0%, #f8f9fa 100%);
}

.task-modal-callout-customer {
    border-left-color: #198754;
    background: linear-gradient(to right, #d1e7dd 0%, #f8f9fa 100%);
}

.task-modal-callout-internal {
    border-left-color: #0dcaf0;
    background: linear-gradient(to right, #cff4fc 0%, #f8f9fa 100%);
}

.task-modal-callout-complete {
    border-left-color: #198754;
    background: linear-gradient(to right, #d1e7dd 0%, #f8f9fa 100%);
}

.task-modal-reject-card {
    padding: 1rem 1.25rem;
    border-radius: 8px;
    border: 1px solid #fecaca;
    background: #fef2f2;
}

.task-modal-reject-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: #991b1b;
    margin-bottom: 0.25rem;
}

/* ========== Work section – Tasks (Project Detail) ========== */
/* Tasks card uses .project-info-card / .project-info-header / .project-info-body for consistent look */

.task-list-simple {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.task-list-row {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 0.875rem 1.5rem;
    border-bottom: 1px solid #f1f5f9;
    transition: background-color 0.15s ease;
}

.task-list-row:last-child {
    border-bottom: none;
}

.task-list-row:hover {
    background: #f8fafc;
}

.task-list-row-actionable {
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.04) 0%, transparent 100%);
}

.task-list-row-actionable:hover {
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.08) 0%, #f8fafc 100%);
}

.task-list-num {
    width: 2rem;
    height: 2rem;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.8125rem;
    color: #64748b;
    background: #f1f5f9;
    border-radius: 8px;
}

.task-list-row-actionable .task-list-num {
    background: #e0f2fe;
    color: #0369a1;
}

.task-list-info {
    flex: 1;
    min-width: 0;
}

.task-list-name {
    display: block;
    font-weight: 600;
    font-size: 0.9375rem;
    color: #0f172a;
    line-height: 1.35;
}

.task-list-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
    margin-top: 0.375rem;
    font-size: 0.8125rem;
    color: #64748b;
}

.task-list-meta .badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.2em 0.5em;
    border-radius: 6px;
}

.task-list-role {
    text-transform: capitalize;
    font-weight: 500;
    color: #475569;
}

.task-list-action .btn-primary {
    font-weight: 600;
    font-size: 0.8125rem;
    padding: 0.35rem 0.85rem;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

.task-list-action {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.task-list-btn-delete {
    font-weight: 600;
    font-size: 0.8125rem;
    padding: 0.35rem 0.65rem;
    border-radius: 8px;
}

/* ========== Top Navbar - theme font, gradient background, refined styles ========== */
.app-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.top-navbar {
    display: flex;
    align-items: center;
    min-height: 4rem;
    background: var(--bb-navbar-bg);
    padding: 0 1.5rem;
    box-shadow: var(--bb-navbar-shadow);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    position: sticky;
    top: 0;
    z-index: 1030;
    gap: 0;
    font-family: var(--bb-font);
}

.navbar-brand {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    margin-right: 2rem;
}

.brand-link {
    color: #fff !important;
    font-family: var(--bb-font);
    font-size: 1.125rem;
    font-weight: 700;
    text-decoration: none;
    letter-spacing: -0.025em;
    padding: 0.25rem 0;
    transition: color 0.2s ease, opacity 0.2s ease;
}

.brand-link:hover {
    color: #f1f5f9 !important;
    opacity: 0.95;
}

.navbar-nav-top {
    display: flex;
    align-items: center;
    flex: 1;
    justify-content: flex-end;
    gap: 0;
    font-family: var(--bb-font);
}

.nav-links-group {
    display: flex;
    align-items: center;
    gap: 0.125rem;
}

.nav-actions-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-left: 0.5rem;
    padding-left: 1rem;
    border-left: 1px solid var(--bb-navbar-accent);
}

.nav-username {
    color: rgba(255, 255, 255, 0.95);
    font-family: var(--bb-font);
    font-size: 0.875rem;
    font-weight: 600;
    white-space: nowrap;
}

.nav-link-top {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    color: rgba(255, 255, 255, 0.9) !important;
    text-decoration: none !important;
    font-family: var(--bb-font);
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: var(--bb-radius);
    transition: background 0.2s ease, color 0.2s ease;
    white-space: nowrap;
}

.nav-link-top:hover {
    background: var(--bb-navbar-hover);
    color: #fff !important;
}

.nav-link-top.active {
    background: rgba(255, 255, 255, 0.15);
    color: #fff !important;
    font-weight: 600;
}

.nav-link-top .bi {
    font-size: 1.1rem;
    opacity: 0.92;
}

/* Settings dropdown - Admin only */
.nav-settings-dropdown {
    position: relative;
}
.nav-settings-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--bb-font);
    font-size: 0.9rem;
    font-weight: 500;
}
.nav-settings-toggle::after {
    margin-left: 0.35em;
}
.nav-settings-menu {
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--bb-radius-lg);
    padding: 0.35rem;
    min-width: 200px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}
.nav-settings-menu .dropdown-item {
    color: rgba(255, 255, 255, 0.9);
    font-family: var(--bb-font);
    padding: 0.55rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
}
.nav-settings-menu .dropdown-item:hover {
    background: var(--bb-navbar-hover);
    color: #fff;
}
.nav-settings-menu .dropdown-item.active {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.nav-btn-logout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(220, 38, 38, 0.15);
    border: 1px solid rgba(220, 38, 38, 0.3);
    border-radius: var(--bb-radius);
    color: #fecaca !important;
    font-family: var(--bb-font);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
    white-space: nowrap;
}

.nav-btn-logout:hover {
    background: rgba(220, 38, 38, 0.25);
    border-color: rgba(220, 38, 38, 0.5);
    color: #fee2e2 !important;
}

.nav-btn-logout .bi {
    font-size: 1.05rem;
}

.navbar-spacer {
    flex: 1;
    min-width: 1rem;
}

.main-content {
    flex: 1;
    padding: 1.5rem 1.5rem 2rem;
    background: var(--bb-body-bg);
}

.navbar-toggler-top {
    display: none;
    align-items: center;
    justify-content: center;
    background: var(--bb-navbar-accent);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 0.5rem 0.75rem;
    border-radius: var(--bb-radius);
    cursor: pointer;
    margin-right: 0.75rem;
    transition: background 0.2s ease;
}

.navbar-toggler-top:hover {
    background: var(--bb-navbar-hover);
}

.navbar-toggler-top .bi {
    font-size: 1.5rem;
}

@media (max-width: 768px) {
    .navbar-toggler-top {
        display: inline-flex;
    }

    .top-navbar {
        min-height: 3.5rem;
        padding: 0.5rem 1rem;
    }

    .navbar-brand {
        margin-right: auto;
    }

    .navbar-nav-top {
        position: fixed;
        top: 3.5rem;
        left: 0;
        right: 0;
        background: var(--bb-navbar-bg);
        flex-direction: column;
        padding: 1rem;
        gap: 0.25rem;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
        transform: translateY(-100%);
        opacity: 0;
        pointer-events: none;
        visibility: hidden;
        transition: transform 0.25s ease, opacity 0.25s ease, visibility 0.25s;
        z-index: 1029;
        border-radius: 0 0 12px 12px;
        align-items: stretch;
    }

    .navbar-nav-top.mobile-open {
        transform: translateY(0);
        opacity: 1;
        pointer-events: all;
        visibility: visible;
    }

    .nav-links-group {
        flex-direction: column;
        gap: 0.25rem;
    }

    .nav-actions-group {
        margin-left: 0;
        padding-left: 0;
        border-left: none;
        padding-top: 0.75rem;
        margin-top: 0.5rem;
        border-top: 1px solid rgba(255, 255, 255, 0.15);
    }

    .nav-link-top {
        height: auto;
        padding: 0.875rem 1rem;
        margin: 0;
        border-radius: 8px;
    }

    .nav-btn-logout {
        height: auto;
        padding: 0.875rem 1rem;
        margin: 0;
    }

    .navbar-spacer {
        display: none;
    }

    .nav-settings-dropdown {
        width: 100%;
    }
    .nav-settings-toggle {
        width: 100%;
        justify-content: flex-start;
        text-align: left;
    }
}

@media (min-width: 769px) {
    .main-content {
        max-width: 100%;
    }
}

.page {
    position: relative;
    display: flex;
    flex-direction: column;
}

.sidebar {
    display: none !important;
}

.top-row {
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    justify-content: space-between;
    height: 4rem;
    display: flex;
    align-items: center;
    padding: 0 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.top-row h1 {
    color: #1e293b;
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

.top-row ::deep a, .top-row ::deep .btn-link {
    white-space: nowrap;
    margin-left: 1.5rem;
    text-decoration: none;
}

.top-row ::deep a:hover, .top-row ::deep .btn-link:hover {
    text-decoration: underline;
}

.top-row ::deep a:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
}

@media screen and (max-width: 640px) {
    .top-row {
        justify-content: space-between;
    }

    .top-row ::deep a, .top-row ::deep .btn-link {
        margin-left: 0;
    }
}

.navbar-toggler {
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.25rem;
    color: rgba(255, 255, 255, 0.55);
    cursor: pointer;
    display: block;
    font-size: 1.25rem;
    line-height: 1;
    margin: 0.5rem;
    padding: 0.25rem 0.5rem;
    position: absolute;
    right: 0;
    top: 0;
    width: 2.5rem;
    height: 2.5rem;
    z-index: 1001;
}

.navbar-toggler:hover {
    background-color: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.25);
    color: rgba(255, 255, 255, 0.75);
}

.navbar-toggler:focus {
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(255, 255, 255, 0.25);
}

.navbar-toggler::before {
    content: "☰";
    display: block;
    font-size: 1.5rem;
    line-height: 1.5rem;
    text-align: center;
}

.navbar-toggler:checked::before {
    content: "✕";
}

.mobile-menu-toggle {
    display: none !important;
    cursor: pointer;
    padding: 0.5rem;
    color: #475569;
    background: transparent;
    border: none;
    border-radius: 4px;
    margin-right: 1rem;
    align-items: center;
    justify-content: center;
}

.mobile-menu-toggle:hover {
    background-color: #f1f5f9;
}

@media screen and (max-width: 640px) {
    .mobile-menu-toggle {
        display: flex !important;
    }
}

/* Mobile styles - using standard breakpoint */
@media screen and (max-width: 640px) {
    .top-row {
        justify-content: flex-start !important;
        padding-left: 1rem !important;
        position: sticky !important;
        top: 0 !important;
        z-index: 1001 !important;
        background: #ffffff !important;
    }

    .top-row ::deep a, .top-row ::deep .btn-link {
        margin-left: 0 !important;
    }

    .top-row h1 {
        font-size: 1.25rem !important;
        margin-left: 0.5rem !important;
    }

    .sidebar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        height: 100vh !important;
        width: 250px !important;
        z-index: 1000 !important;
        transform: translateX(-100%) !important;
        transition: transform 0.3s ease-in-out !important;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2) !important;
    }

    .navbar-toggler:checked ~ .sidebar {
        transform: translateX(0) !important;
    }

    .sidebar-overlay {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        background: rgba(0, 0, 0, 0.5) !important;
        opacity: 0 !important;
        pointer-events: none !important;
        transition: opacity 0.3s ease-in-out !important;
        z-index: 999 !important;
        cursor: pointer !important;
    }

    .navbar-toggler:checked ~ .sidebar-overlay {
        opacity: 1 !important;
        pointer-events: all !important;
    }

    .nav-scrollable {
        padding-top: 5.5rem !important;
    }

    .page {
        flex-direction: column !important;
    }

    .content {
        width: 100% !important;
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
}

@media (min-width: 641px) {
    .page {
        flex-direction: row;
    }

    .sidebar {
        width: 280px;
        height: 100vh;
        position: sticky;
        top: 0;
        display: flex;
        flex-direction: column;
        transform: translateX(0) !important;
    }

    .top-row {
        position: sticky;
        top: 0;
        z-index: 1;
    }

    .top-row.auth ::deep a:first-child {
        flex: 1;
        text-align: right;
        width: 0;
    }

    .top-row, article {
        padding-left: 2rem !important;
        padding-right: 1.5rem !important;
    }

    .navbar-toggler {
        display: none;
    }

    .collapse {
        display: block;
    }
}

.nav-scrollable {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 3.5rem);
    overflow-y: auto;
    overflow-x: hidden;
    padding-top: 1rem;
}

@media screen and (max-width: 640px) {
    .nav-scrollable {
        padding-top: 5.5rem !important;
    }
}

.nav-scrollable::-webkit-scrollbar {
    width: 6px;
}

.nav-scrollable::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.nav-scrollable::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.nav-scrollable::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.navbar-nav {
    display: flex;
    flex-direction: column;
    padding-left: 0;
    margin-bottom: 0;
    list-style: none;
}

.navbar-nav .nav-link {
    padding: 0.5rem 1rem;
    color: #d7d7d7;
    border-radius: 4px;
    height: 3rem;
    display: flex;
    align-items: center;
    line-height: 3rem;
}

.navbar-nav .nav-link:hover {
    background-color: rgba(255,255,255,0.1);
    color: white;
}

.navbar-nav .nav-link.active {
    background-color: rgba(255,255,255,0.25);
    color: white;
}

/* Navigation styles matching original Blazor template */
.nav {
    display: flex;
    flex-wrap: wrap;
    padding-left: 0;
    margin-bottom: 0;
    list-style: none;
}

.nav.flex-column {
    flex-direction: column;
    padding-top: 0.5rem;
}

@media screen and (max-width: 640px) {
    .nav.flex-column {
        padding-top: 0 !important;
    }
}

.nav-item {
    margin-bottom: 0;
}

.nav-link {
    display: block;
    padding: 0.5rem 1rem;
    color: #d7d7d7;
    text-decoration: none;
    border-radius: 4px;
    height: 3rem;
    display: flex;
    align-items: center;
    line-height: 3rem;
}

.nav-link:hover {
    background-color: rgba(255,255,255,0.1);
    color: white;
}

.nav-link.active {
    background-color: rgba(255,255,255,0.25);
    color: white;
}

.nav-link span {
    margin-right: 0.5rem;
}

/* Override for sidebar navigation - ensure all links are white */
.sidebar .nav-link,
.sidebar .nav-item .nav-link,
.sidebar .nav-item ::deep .nav-link {
    color: #ffffff !important;
}

.sidebar .nav-link span,
.sidebar .nav-item .nav-link span,
.sidebar .nav-item ::deep .nav-link span {
    color: #ffffff !important;
}

.sidebar .nav-link:hover {
    background-color: rgba(255,255,255,0.1);
    color: #ffffff !important;
}

.sidebar .nav-link.active {
    background-color: rgba(255,255,255,0.25);
    color: #ffffff !important;
}

.content {
    padding-top: 1.1rem;
}

/* Sidebar Header */
.sidebar-header {
    padding: 1.5rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-brand h3 {
    color: #ffffff;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.5px;
}

.brand-subtitle {
    color: #94a3b8;
    font-size: 0.75rem;
    margin: 0.25rem 0 0 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1.25rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
}

.user-details {
    flex: 1;
}

.user-name {
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.125rem;
}

.user-role {
    color: #94a3b8;
    font-size: 0.75rem;
    text-transform: capitalize;
}

/* Navigation */
/* Hide Inbox link - removed from nav; keeps cached/old markup from showing it */
.sidebar-nav a[href="/inbox"],
.sidebar-nav a[href="inbox"],
.sidebar .nav-item a[href="/inbox"],
.sidebar .nav-item a[href="inbox"] {
    display: none !important;
}

.sidebar-nav {
    padding: 1rem 0.75rem;
}

.nav-section {
    margin-bottom: 1.5rem;
}

.nav-section-title {
    color: #94a3b8;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.25px;
    padding: 0.5rem 1rem 0.35rem 1rem;
    margin-bottom: 0.25rem;
    margin-top: 0.25rem;
}
.sidebar-nav .nav-section:first-child .nav-section-title {
    margin-top: 0;
}
.nav-section:last-child {
    margin-bottom: 0.5rem;
}

.nav-item {
    margin-bottom: 0.25rem;
}

/* Base nav-link styling - MUST be white */
.nav-item ::deep .nav-link,
.nav-item .nav-link,
.sidebar-nav .nav-item .nav-link,
.sidebar-nav .nav-item ::deep .nav-link,
.sidebar-nav .nav-link,
.sidebar .nav-link {
    color: #ffffff !important;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s ease;
    text-decoration: none;
    border-left: 3px solid transparent;
}

/* Force ALL text content inside nav-links to be white */
.nav-item ::deep .nav-link,
.nav-item .nav-link,
.sidebar-nav .nav-item .nav-link,
.sidebar-nav .nav-item ::deep .nav-link,
.sidebar-nav .nav-link {
    color: #ffffff !important;
}

.nav-item ::deep .nav-link span,
.nav-item .nav-link span,
.sidebar-nav .nav-item .nav-link span,
.sidebar-nav .nav-item ::deep .nav-link span,
.sidebar-nav .nav-link span,
.sidebar-nav .nav-item .nav-link *,
.sidebar-nav .nav-item ::deep .nav-link *,
.sidebar-nav .nav-link * {
    color: #ffffff !important;
}

/* Target anchor tags directly */
.sidebar-nav a,
.sidebar-nav a.nav-link,
.sidebar-nav .nav-item a,
.sidebar-nav .nav-item a.nav-link {
    color: #ffffff !important;
}

.sidebar-nav a span,
.sidebar-nav a.nav-link span,
.sidebar-nav .nav-item a span,
.sidebar-nav .nav-item a.nav-link span {
    color: #ffffff !important;
}

.nav-item ::deep .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.08);
    color: #ffffff !important;
    border-left-color: #667eea;
    transform: translateX(2px);
}

.nav-item ::deep .nav-link:hover span,
.sidebar-nav .nav-item ::deep .nav-link:hover span {
    color: #ffffff !important;
}

.nav-item ::deep .nav-link:hover .nav-icon,
.sidebar-nav .nav-item ::deep .nav-link:hover .nav-icon {
    color: #ffffff !important;
    stroke: #ffffff !important;
}

.nav-item ::deep .nav-link.active {
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.15) 0%, rgba(102, 126, 234, 0.05) 100%);
    color: #ffffff !important;
    border-left-color: #667eea;
    font-weight: 600;
}

.nav-item ::deep .nav-link.active span,
.sidebar-nav .nav-item ::deep .nav-link.active span {
    color: #ffffff !important;
}

.nav-item ::deep .nav-link.active .nav-icon,
.sidebar-nav .nav-item ::deep .nav-link.active .nav-icon {
    color: #ffffff !important;
    stroke: #ffffff !important;
}

.nav-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    stroke-width: 2;
    color: #ffffff;
    stroke: currentColor;
}

.sidebar-nav .nav-link .nav-icon,
.sidebar-nav .nav-item ::deep .nav-link .nav-icon,
.sidebar-nav .nav-item .nav-link .nav-icon,
.sidebar-nav .nav-item a .nav-icon,
.sidebar-nav .nav-item ::deep a .nav-icon {
    color: #ffffff !important;
    stroke: #ffffff !important;
}

/* Ensure all SVG icons in sidebar navigation are white */
.sidebar-nav svg,
.sidebar-nav .nav-icon,
.sidebar .nav-icon {
    color: #ffffff !important;
    stroke: #ffffff !important;
    fill: none !important;
}

/* Comprehensive rule to ensure ALL text in sidebar navigation links is white - ULTRA SPECIFIC */
.sidebar-nav .nav-link,
.sidebar-nav .nav-item .nav-link,
.sidebar-nav .nav-item ::deep .nav-link,
.sidebar-nav a,
.sidebar-nav a.nav-link,
.sidebar .nav-link,
.sidebar a,
div.sidebar-nav .nav-link,
div.sidebar-nav .nav-item .nav-link,
div.sidebar-nav a {
    color: #ffffff !important;
}

.sidebar-nav .nav-link *,
.sidebar-nav .nav-item .nav-link *,
.sidebar-nav .nav-item ::deep .nav-link *,
.sidebar-nav a *,
.sidebar-nav a.nav-link *,
div.sidebar-nav .nav-link *,
div.sidebar-nav .nav-item .nav-link * {
    color: #ffffff !important;
}

/* Specifically target span elements and text nodes */
.sidebar-nav span,
.sidebar-nav .nav-link span,
.sidebar-nav .nav-item span,
.sidebar-nav .nav-item .nav-link span,
.sidebar-nav .nav-item ::deep .nav-link span,
.sidebar-nav .nav-item ::deep span,
div.sidebar-nav span,
div.sidebar-nav .nav-link span,
div.sidebar-nav .nav-item span,
div.sidebar-nav .nav-item .nav-link span {
    color: #ffffff !important;
}

/* Target the exact structure from NavMenu.razor */
.nav-item .nav-link span,
.nav-item ::deep .nav-link span,
div.nav-item .nav-link span,
div.nav-item ::deep .nav-link span {
    color: #ffffff !important;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 1rem 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: auto;
}

.logout-btn {
    width: 100%;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #f87171;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.3);
    transform: translateX(2px);
}

.logout-btn .nav-icon {
    width: 20px;
    height: 20px;
}

/* Projects Page Professional Styling */
.projects-page {
    padding: 2rem;
    max-width: 100%;
}

/* Page header - 3D look */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.header-content {
    flex: 1;
}

.page-title {
    font-size: 2rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 0.5rem 0;
    letter-spacing: -0.5px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.page-subtitle {
    color: #64748b;
    font-size: 0.95rem;
    margin: 0;
}

.btn-add {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.btn-add:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn-add svg {
    width: 18px;
    height: 18px;
}

/* ========== Projects view toolbar ========== */
.projects-view-toolbar {
    padding: 0.5rem 0;
}

.projects-view-toggle .btn {
    font-weight: 500;
}

.projects-view-toggle .bi {
    margin-right: 0.35rem;
}

/* Multi-select filter dropdown (projects page) */
.multi-select-filter {
    position: relative;
    min-width: 0;
}

.multi-select-filter-toggle {
    min-height: 31px;
}

.multi-select-filter-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1095;
    background: rgba(15, 23, 42, 0.12);
    cursor: default;
}

.multi-select-filter-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 1100;
    min-width: 220px;
    max-width: 320px;
    max-height: min(400px, calc(100vh - 8rem));
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #fff;
}

.multi-select-filter-menu__head .btn-close {
    flex-shrink: 0;
}

.multi-select-filter-menu > .p-2,
.multi-select-filter-menu > .multi-select-filter-actions {
    flex-shrink: 0;
}

.multi-select-filter-options {
    flex: 1 1 auto;
    min-height: 0;
    max-height: min(280px, calc(100vh - 14rem));
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #94a3b8 #f1f5f9;
}

.multi-select-filter-options::-webkit-scrollbar {
    width: 8px;
}

.multi-select-filter-options::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.multi-select-filter-options::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 4px;
}

.multi-select-filter-options::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

/* Site construction / home: floating filter menu (does not push grid down) */
.site-construction-page .site-machinery-ledger-filters .multi-select-filter.is-open,
.site-construction-page .site-labour-ledger-filters .multi-select-filter.is-open,
.site-construction-page .site-material-ledger-filters .multi-select-filter.is-open,
.site-construction-home-filters .multi-select-filter.is-open {
    z-index: 1100;
}

.site-construction-page .site-machinery-ledger-filters .multi-select-filter-menu,
.site-construction-page .site-labour-ledger-filters .multi-select-filter-menu,
.site-construction-page .site-material-ledger-filters .multi-select-filter-menu,
.site-construction-home-filters .multi-select-filter-menu {
    min-width: 260px;
    max-width: min(320px, 96vw);
}

.multi-select-filter-option {
    display: flex;
    align-items: flex-start;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    margin: 0;
    cursor: pointer;
}

.multi-select-filter-option:hover {
    background: #f8fafc;
}

.multi-select-filter-search-hint,
.multi-select-filter-more-hint {
    line-height: 1.35;
}

.projects-page-filters {
    background: #f8fafc;
}

.projects-page-filters .multi-select-filter-menu {
    min-width: 260px;
}

/* ========== Projects card & table - same as dashboard grid ========== */
.projects-card {
    background: var(--bb-card-bg);
    border: 1px solid #e2e8f0;
    border-radius: var(--bb-radius-lg);
    box-shadow: var(--bb-shadow-sm);
    overflow: hidden;
}

.projects-card .table-responsive {
    overflow-x: auto;
}

/* ========== Projects grid - card layout (mobile-first) ========== */
.projects-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 1rem;
}

@media (min-width: 576px) {
    .projects-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 1.15rem;
        padding: 1.25rem;
    }
}

@media (min-width: 992px) {
    .projects-grid {
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
        gap: 1.25rem;
        padding: 1.5rem;
    }
}

.project-card {
    background: var(--bb-card-bg);
    border: 1px solid #e2e8f0;
    border-radius: var(--bb-radius-xl);
    padding: 1.25rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.04);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.project-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--bb-shadow-md);
    border-color: rgba(37, 99, 235, 0.25);
}

.project-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.project-card-id {
    font-size: 0.75rem;
    font-weight: 600;
    font-family: var(--bb-font);
    color: var(--bb-secondary);
    background: #f1f5f9;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    letter-spacing: 0.02em;
}

.project-card-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: #0f172a;
    margin: 0;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.project-card-meta {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #475569;
}

.project-card-meta-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.project-card-meta-row .bi {
    color: #94a3b8;
    font-size: 1rem;
    flex-shrink: 0;
    width: 1.25rem;
    text-align: center;
}

.project-card-amounts {
    padding: 0.75rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 0.5rem;
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.project-card-amount-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

.project-card-amount-row span:first-child {
    color: #64748b;
}

.project-card-amount-row strong {
    color: #0f172a;
}

.project-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid #e2e8f0;
    margin-top: auto;
}

.project-card-actions .btn {
    font-weight: 500;
}

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

/* ========== Projects table - same as dashboard grid ========== */
.projects-table-wrap {
    overflow-x: auto;
}

.projects-table {
    width: 100%;
    margin-bottom: 0;
    font-size: 0.9rem;
}

.projects-table th,
.projects-table td {
    padding: 0.75rem 1rem;
    vertical-align: middle;
    line-height: 1.5;
}

.projects-table thead th {
    white-space: nowrap;
}

.projects-table th.sortable-th,
.projects-table .grid-sort-btn {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    color: inherit;
    font-weight: 600;
}

.projects-table .grid-sort-btn:hover {
    color: var(--bs-primary);
}

.projects-table th.sortable-th:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.projects-table th.sortable-th .sort-indicator,
.projects-table .grid-sort-btn .sort-indicator {
    font-size: 0.65rem;
    vertical-align: middle;
}

.projects-table thead .grid-header-row th {
    vertical-align: bottom;
    background-color: #f8f9fa;
}

.projects-table thead .grid-filter-row th {
    padding: 0.35rem 0.4rem;
    background-color: #fff;
    border-bottom: 2px solid #dee2e6;
    vertical-align: top;
}

.projects-table thead .grid-filter-row .form-control,
.projects-table thead .grid-filter-row .form-select {
    min-width: 4.5rem;
    font-size: 0.75rem;
}

.projects-card-filters {
    border-bottom: 1px solid #eee;
}

.projects-table thead th.text-center {
    text-align: center;
}

.projects-table tbody tr {
    transition: background 0.15s ease;
}

.projects-table tbody tr:nth-of-type(odd) {
    background-color: rgba(0, 0, 0, 0.02);
}

.projects-table tbody tr:hover {
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%) !important;
}

.projects-table tbody td {
    padding: 0.75rem 1rem;
    vertical-align: middle;
    font-size: 0.9rem;
    font-family: var(--bb-font);
    color: var(--bb-dark);
    border: 1px solid #e2e8f0;
    line-height: 1.5;
}

.projects-table tbody td:first-child,
.projects-table tbody td:nth-child(2) {
    padding-left: 1rem;
    padding-right: 1rem;
}

.projects-table .project-name,
.projects-table .project-name strong {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--bb-dark);
    line-height: 1.5;
}

.projects-table code {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--bb-dark);
    background: transparent;
    padding: 0;
    border: none;
    line-height: 1.5;
}

.projects-table .number-cell,
.projects-table .amount-cell {
    font-family: 'JetBrains Mono', 'Consolas', monospace;
    text-align: right;
    color: var(--bb-dark);
    font-weight: 500;
    white-space: nowrap;
    vertical-align: middle;
    line-height: 1.5;
    min-width: 7rem;
    word-break: keep-all;
    overflow-wrap: normal;
}

.projects-table .amount-cell strong {
    font-weight: 500;
    white-space: nowrap;
    display: inline;
}

.projects-table .phone-cell,
.projects-table .date-cell {
    color: #64748b;
    font-size: 0.875rem;
}

.projects-table .actions-cell {
    text-align: center;
    width: 140px;
}

.btn-group-actions {
    display: inline-flex;
    gap: 0.5rem;
    align-items: center;
    justify-content: center;
}

.btn-action {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}

.btn-view {
    background-color: #dbeafe;
    color: #1e40af;
}

.btn-view:hover {
    background-color: #bfdbfe;
    color: #1e3a8a;
    transform: scale(1.1);
}

.btn-edit {
    background-color: #fef3c7;
    color: #92400e;
}

.btn-edit:hover {
    background-color: #fde68a;
    color: #78350f;
    transform: scale(1.1);
}

.btn-delete {
    background-color: #fee2e2;
    color: #991b1b;
}

.btn-delete:hover {
    background-color: #fecaca;
    color: #7f1d1d;
    transform: scale(1.1);
}

.badge {
    display: inline-block;
    padding: 0.35em 0.65em;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 6px;
}

.badge-warning {
    background-color: #fef3c7;
    color: #92400e;
}

.badge-success {
    background-color: #d1fae5;
    color: #065f46;
}

.empty-state {
    padding: 4rem 2rem;
    text-align: center;
}

.empty-icon {
    color: #cbd5e1;
    margin-bottom: 1.5rem;
}

.empty-state h3 {
    color: #1e293b;
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
}

.empty-state p {
    color: #64748b;
    margin: 0 0 1.5rem 0;
}

/* Responsive - Projects grid & table */
@media (max-width: 768px) {
    .projects-grid {
        grid-template-columns: 1fr;
        padding: 1rem;
    }

    .project-card {
        padding: 1rem;
    }

    .project-card-title {
        font-size: 1rem;
    }
}

@media (max-width: 1200px) {
    .projects-table {
        font-size: 0.85rem;
    }
    
    .projects-table thead th,
    .projects-table tbody td {
        padding: 0.75rem 1rem;
    }
}

@media (max-width: 768px) {
    .projects-page {
        padding: 1rem;
    }
    
    .page-header {
        flex-direction: column;
    }
    
    .page-title {
        font-size: 1.5rem;
    }
    
    .projects-table thead th {
        font-size: 0.75rem;
        padding: 0.75rem 0.5rem;
    }
    
    .projects-table tbody td {
        padding: 0.75rem 0.5rem;
        font-size: 0.8rem;
    }
    
    .btn-group-actions {
        flex-direction: column;
        gap: 0.25rem;
    }
}

/* FINAL OVERRIDE - Maximum specificity for sidebar navigation links */
.sidebar .sidebar-nav .nav-item .nav-link,
.sidebar .sidebar-nav .nav-item ::deep .nav-link,
.sidebar .sidebar-nav .nav-item a.nav-link,
div.sidebar div.sidebar-nav div.nav-item a.nav-link,
div.sidebar div.sidebar-nav div.nav-item .nav-link {
    color: #ffffff !important;
}

.sidebar .sidebar-nav .nav-item .nav-link span,
.sidebar .sidebar-nav .nav-item ::deep .nav-link span,
.sidebar .sidebar-nav .nav-item a.nav-link span,
div.sidebar div.sidebar-nav div.nav-item a.nav-link span,
div.sidebar div.sidebar-nav div.nav-item .nav-link span {
    color: #ffffff !important;
}

/* Universal selector override for sidebar navigation */
.sidebar-nav * .nav-link,
.sidebar-nav * a.nav-link {
    color: #ffffff !important;
}

.sidebar-nav * .nav-link *,
.sidebar-nav * a.nav-link * {
    color: #ffffff !important;
}

/* ========== Admin Dashboard ========== */
.dashboard-header {
    margin-bottom: 1.5rem;
}

.dashboard-title {
    font-size: 1.875rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.35rem;
    letter-spacing: -0.02em;
}

.dashboard-subtitle {
    font-size: 1rem;
    color: #475569;
}

/* Admin settings cards - 3D look */
.container-fluid .card.shadow-sm {
    box-shadow: var(--bb-shadow) !important;
    border: 1px solid var(--bb-border);
    border-radius: var(--bb-radius-lg);
}

/* Blazor Bootstrap-style filter card - https://demos.blazorbootstrap.com/grid/overview */
.dashboard-filter-card {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.dashboard-filter-title {
    font-size: 0.8125rem;
    font-weight: 700;
    color: #212529 !important;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.dashboard-filter-card .card-body .form-label {
    font-weight: 500;
    color: #495057;
    font-size: 0.875rem;
}

.dashboard-filter-card .card-body .form-control,
.dashboard-filter-card .card-body .form-select {
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
}

.dashboard-filter-card .card-body .form-control:focus,
.dashboard-filter-card .card-body .form-select:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.dashboard-filter-card .btn-group .btn {
    border-radius: 0.375rem;
}

.dashboard-filter-card .card-body {
    padding: 1.25rem 1.5rem;
}

.dashboard-summary-card {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    border: 1px solid #e2e8f0;
    transition: box-shadow 0.2s ease;
}

.dashboard-summary-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.dashboard-summary-card .card-body {
    padding: 1.25rem 1.5rem;
}

.dashboard-summary-card .card-body h6 {
    font-weight: 600;
    color: #495057 !important;
}

.dashboard-summary-card.revenue-card {
    border-left: 4px solid var(--bb-primary);
    box-shadow: var(--bb-shadow), 2px 0 8px rgba(13, 110, 253, 0.12);
}

.dashboard-summary-card.pending-card {
    border-left: 4px solid #fd7e14;
    box-shadow: var(--bb-shadow), 2px 0 8px rgba(253, 126, 20, 0.12);
}

.dashboard-summary-card.expense-card {
    border-left: 4px solid #dc2626;
    box-shadow: var(--bb-shadow), 2px 0 8px rgba(220, 38, 38, 0.12);
}

.dashboard-summary-card.profit-card {
    border-left: 4px solid #059669;
    box-shadow: var(--bb-shadow), 2px 0 8px rgba(5, 150, 105, 0.12);
}

.dashboard-type-revenue-card {
    border-left: 4px solid #94a3b8;
}

.dashboard-type-revenue-card.dashboard-type-architectural {
    border-left-color: #6366f1;
}

.dashboard-type-revenue-card.dashboard-type-structural {
    border-left-color: #0ea5e9;
}

.dashboard-type-revenue-card.dashboard-type-construction {
    border-left-color: #d97706;
}

.dashboard-type-revenue-card-active {
    box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.35), 0 4px 12px rgba(0, 0, 0, 0.08);
}

.company-pl-card {
    border: 1px solid #e2e8f0;
}

.company-pl-kpi {
    padding: 0.75rem 1rem;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    height: 100%;
}

.company-pl-kpi-profit {
    background: #ecfdf5;
    border-color: #a7f3d0;
}

.company-pl-kpi-loss {
    background: #fef2f2;
    border-color: #fecaca;
}

.audit-log-page .audit-log-changes {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 0.5rem 0.65rem;
    word-break: break-word;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.78rem;
    line-height: 1.45;
}

.audit-log-entry .card-body {
    border-left: 3px solid #cbd5e1;
}

.expense-breakdown-row td {
    vertical-align: top !important;
}

.expense-breakdown {
    max-width: 100%;
}

.expense-cat-card {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.6rem 0.75rem;
    background: #fff;
    border-radius: var(--bb-radius);
    border: 1px solid var(--bb-border);
}

.expense-cat-label {
    font-size: 0.75rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.expense-cat-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--bb-dark);
}

/* ========== Dashboard - improved visibility and charts ========== */
.dashboard-page-header .page-title {
    font-size: 1.75rem;
}

.dashboard-filter-card {
    padding: 1.25rem 1.5rem !important;
}

.dashboard-filter-card .filter-section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--bb-dark);
}

.dashboard-card-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b !important;
    margin-bottom: 0.35rem !important;
}

.dashboard-card-value {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.dashboard-summary-card .card-body {
    padding: 1.25rem 1.5rem !important;
}

@media (min-width: 1200px) {
    .dashboard-card-value {
        font-size: 1.75rem;
    }
}

.dashboard-reports-card .card-header {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid var(--bb-border);
}

.dashboard-chart-box {
    background: #fff;
    border: 1px solid var(--bb-border);
    border-radius: var(--bb-radius-lg);
    padding: 1.25rem;
}

.dashboard-chart-box .chart-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--bb-dark);
    margin-bottom: 1rem;
}

.chart-bar-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.6rem;
}

.chart-bar-row-sm {
    margin-bottom: 0.4rem;
}

.chart-bar-label {
    flex: 0 0 100px;
    font-size: 0.8rem;
    color: var(--bb-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chart-bar-track {
    flex: 1;
    height: 20px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.chart-bar-row-sm .chart-bar-track {
    height: 14px;
}

.chart-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--pah-primary) 0%, var(--pah-primary-bright) 100%);
    border-radius: 4px;
    transition: width 0.4s ease;
}

.chart-bar-fill-alt {
    background: linear-gradient(90deg, #059669 0%, #10b981 100%);
}

.chart-bar-value {
    flex: 0 0 28px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--bb-dark);
    text-align: right;
}

/* Pie charts */
.pie-chart-wrap {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.pie-chart-wrap.pie-chart-with-donut {
    gap: 1.25rem;
}

.pie-chart {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.pie-chart-donut.pie-chart-clickable {
    cursor: pointer;
}

.pie-chart-donut {
    position: relative;
}

.pie-chart-donut::after {
    content: '';
    position: absolute;
    inset: 22%;
    background: #fff;
    border-radius: 50%;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.06);
}

.pie-donut-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1;
    pointer-events: none;
}

.pie-donut-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--bb-dark);
    line-height: 1.1;
}

.pie-donut-value-sm {
    font-size: 0.95rem;
    line-height: 1.2;
}

.pie-donut-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--bb-secondary);
}

.pie-legend {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.85rem;
    color: var(--bb-dark);
}

.pie-legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}

.pie-legend-item.pie-legend-clickable {
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    margin: 0 -0.5rem;
    border-radius: var(--bb-radius);
    transition: background 0.2s;
}

.pie-legend-item.pie-legend-clickable:hover {
    background: rgba(37, 99, 235, 0.08);
}

.pie-legend-count {
    color: var(--bb-secondary);
    font-weight: 500;
}

.pie-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.reports-by-project-bars {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.reports-by-project-bars .single-bar-row {
    margin-bottom: 0;
}

/* Revenue vs expenses comparison bars (project-wise) */
.revenue-expense-bars {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}
.revenue-expense-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.85rem;
}
.revenue-expense-row .rev-exp-label {
    flex: 0 0 140px;
    font-weight: 500;
    color: var(--bb-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.revenue-expense-row .rev-exp-bars {
    flex: 1;
    display: flex;
    gap: 0.5rem;
    align-items: center;
    min-width: 0;
}
.revenue-expense-row .bar-legend {
    flex: 0 0 120px;
    display: flex;
    gap: 0.75rem;
    font-size: 0.75rem;
    color: var(--bb-secondary);
}
.rev-bar-track, .exp-bar-track {
    height: 20px;
    border-radius: 4px;
    overflow: hidden;
    background: #e2e8f0;
    min-width: 40px;
    flex: 1;
    max-width: 120px;
}
.rev-bar-fill { background: linear-gradient(90deg, #059669 0%, #10b981 100%); height: 100%; border-radius: 4px; transition: width 0.3s ease; }
.exp-bar-fill { background: linear-gradient(90deg, #dc2626 0%, #ef4444 100%); height: 100%; border-radius: 4px; transition: width 0.3s ease; }

/* P&L by project (profit = green, loss = red single bar) */
.pl-bars { display: flex; flex-direction: column; gap: 0.5rem; }
.pl-row { display: flex; align-items: center; gap: 0.75rem; font-size: 0.85rem; }
.pl-row .pl-label { flex: 0 0 130px; font-weight: 500; color: var(--bb-dark); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-row .pl-track { flex: 1; height: 18px; max-width: 140px; background: #e2e8f0; border-radius: 4px; overflow: hidden; }
.pl-row .pl-fill-profit { background: linear-gradient(90deg, #059669, #10b981); height: 100%; border-radius: 4px; transition: width 0.3s ease; }
.pl-row .pl-fill-loss { background: linear-gradient(90deg, #ef4444, #dc2626); height: 100%; border-radius: 4px; transition: width 0.3s ease; }
.pl-row .pl-value { flex: 0 0 72px; font-size: 0.8rem; font-weight: 600; text-align: right; }

/* Single bar for realization % or pending */
.single-bar-row { display: flex; align-items: center; gap: 0.75rem; font-size: 0.85rem; margin-bottom: 0.45rem; }
.single-bar-row .single-bar-label { flex: 0 0 120px; font-weight: 500; color: var(--bb-dark); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.single-bar-row .single-bar-track { flex: 1; height: 16px; max-width: 120px; background: #e2e8f0; border-radius: 4px; overflow: hidden; }
.single-bar-row .single-bar-fill { height: 100%; border-radius: 4px; transition: width 0.3s ease; }
.single-bar-row .single-bar-value { flex: 0 0 60px; font-size: 0.8rem; color: var(--bb-secondary); text-align: right; }

.chart-status-cards {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.status-card {
    flex: 1;
    padding: 1rem;
    border-radius: var(--bb-radius);
    text-align: center;
}

.status-card .status-count {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
}

.status-card .status-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    opacity: 0.9;
}

.status-approved {
    background: rgba(5, 150, 105, 0.12);
    color: #047857;
}

.status-pending {
    background: rgba(217, 119, 6, 0.12);
    color: #b45309;
}

.status-rejected {
    background: rgba(220, 38, 38, 0.12);
    color: #b91c1c;
}

.dashboard-reports-table {
    font-size: 0.9rem;
}

.dashboard-reports-table th {
    font-weight: 600;
    padding: 0.75rem 1rem;
}

.dashboard-reports-table td {
    padding: 0.75rem 1rem;
}

/* ========== Admin Dashboard grid - Blazor Bootstrap style ========== */
/* https://demos.blazorbootstrap.com/grid/overview - table table-hover table-bordered table-striped */
.dashboard-projects-card {
    background: var(--bb-card-bg);
    border: 1px solid #e2e8f0;
    border-radius: var(--bb-radius-lg);
    box-shadow: var(--bb-shadow-sm);
    overflow: hidden;
    font-family: var(--bb-font);
}

.dashboard-projects-card .card-body {
    padding: 0;
}

.dashboard-projects-card .card-body .table-responsive {
    overflow-x: auto;
}

/* Admin dashboard — mobile project cards (replaces wide table below lg) */
.dashboard-projects-mobile {
    display: none;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.75rem;
}

.dashboard-project-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: var(--bb-radius-lg, 0.75rem);
    padding: 0.85rem 0.9rem;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.dashboard-project-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.65rem;
}

.dashboard-project-card-title-wrap {
    min-width: 0;
    flex: 1 1 auto;
}

.dashboard-project-card-title {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--bb-primary, #2563eb);
    text-decoration: none;
    line-height: 1.3;
    word-break: break-word;
}

.dashboard-project-card-title:hover {
    text-decoration: underline;
}

.dashboard-project-card-code {
    margin-top: 0.2rem;
    font-size: 0.75rem;
}

.dashboard-project-card-code code {
    font-size: 0.72rem;
    color: #64748b;
    background: #f1f5f9;
    padding: 0.1rem 0.35rem;
    border-radius: 0.25rem;
}

.dashboard-project-card-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.45rem 0.75rem;
    margin: 0;
}

.dashboard-project-card-metric {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.dashboard-project-card-metric dt {
    margin: 0;
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
}

.dashboard-project-card-metric dd {
    margin: 0;
    font-size: 0.875rem;
    color: #0f172a;
    word-break: break-word;
}

.dashboard-project-card-metric--total dd {
    font-size: 0.95rem;
}

.dashboard-project-card-site {
    margin-top: 0.65rem;
    padding-top: 0.65rem;
    border-top: 1px dashed #e2e8f0;
}

.dashboard-project-card-site--muted {
    padding-top: 0.5rem;
    margin-top: 0.5rem;
    border-top: 1px dashed #e2e8f0;
}

.dashboard-project-card-site-title {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #475569;
    margin-bottom: 0.45rem;
}

.dashboard-project-card-metrics--site {
    grid-template-columns: 1fr 1fr;
}

@media (max-width: 991.98px) {
    .dashboard-projects-mobile {
        display: flex;
    }

    .dashboard-projects-card .dashboard-grid-header {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 0.5rem;
    }

    .dashboard-page-header .page-header-content {
        max-width: 100%;
    }

    .dashboard-filter-card .row.align-items-center.g-3 > .col-auto,
    .dashboard-filter-card .row.align-items-end.g-3 > .col-auto {
        flex: 1 1 100%;
        width: 100%;
        max-width: 100%;
    }

    .dashboard-filter-card .form-select-sm,
    .dashboard-filter-card .form-control-sm {
        width: 100% !important;
        max-width: 100%;
    }

    .dashboard-filter-card .btn-group {
        flex-wrap: wrap;
    }
}

@media (max-width: 575.98px) {
    .dashboard-project-card-metrics,
    .dashboard-project-card-metrics--site {
        grid-template-columns: 1fr;
    }
}

/* Admin pages — shared mobile grid cards + stacked tables */
.admin-grid-mobile-cards {
    display: none;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.75rem;
}

.admin-grid-mobile-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: var(--bb-radius-lg, 0.75rem);
    padding: 0.85rem 0.9rem;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.admin-grid-mobile-card--muted {
    opacity: 0.92;
}

.admin-grid-mobile-card--highlight {
    border-color: #93c5fd;
    background: linear-gradient(180deg, #eff6ff 0%, #fff 100%);
}

.admin-grid-mobile-card--root {
    border-left: 3px solid var(--bb-primary, #2563eb);
}

.admin-grid-mobile-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.55rem;
}

.admin-grid-mobile-card-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #0f172a;
    line-height: 1.3;
    word-break: break-word;
}

.admin-grid-mobile-card-sub {
    font-size: 0.78rem;
    color: #64748b;
    margin-top: 0.15rem;
    word-break: break-word;
}

.admin-grid-mobile-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.45rem 0.75rem;
    margin: 0;
}

.admin-grid-mobile-metric {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.admin-grid-mobile-metric--wide {
    grid-column: 1 / -1;
}

.admin-grid-mobile-metric dt {
    margin: 0;
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
}

.admin-grid-mobile-metric dd {
    margin: 0;
    font-size: 0.875rem;
    color: #0f172a;
    word-break: break-word;
}

.admin-grid-mobile-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.65rem;
    padding-top: 0.55rem;
    border-top: 1px dashed #e2e8f0;
}

.admin-grid-mobile-actions .btn {
    flex: 1 1 auto;
    min-height: 2.35rem;
}

@media (max-width: 991.98px) {
    .admin-grid-mobile-cards {
        display: flex;
    }

    .rk-admin-page .page-header,
    .admin-settings-grid > .page-header,
    .task-config-page-header,
    .client-companies-header,
    .vendor-master-header,
    .payment-schedule-config-page .page-header,
    .audit-log-page > .d-flex:first-child {
        flex-direction: column;
        align-items: flex-start !important;
    }

    .admin-grid-card .table-responsive,
    .vendor-grid-card .table-responsive,
    .client-companies-table-wrap,
    .task-config-table-wrap,
    .payment-schedule-config-page .table-responsive,
    .admin-settings-grid .table-responsive {
        overflow: visible;
    }

    .admin-grid-filter-bar,
    .client-companies-filter-bar,
    .vendor-grid-toolbar,
    .task-config-filter-bar {
        flex-direction: column;
        align-items: stretch !important;
    }

    .admin-grid-filter-bar > div,
    .task-config-filter-field {
        width: 100%;
        min-width: 0 !important;
    }

    .admin-grid-filter-bar .form-control-sm,
    .admin-grid-filter-bar .form-select-sm {
        width: 100% !important;
        min-width: 0 !important;
    }

    .admin-grid-pagination {
        flex-direction: column;
        align-items: stretch !important;
        text-align: center;
    }

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

    table.rk-admin-data-table.rk-mobile-stack-table {
        min-width: 0 !important;
        width: 100%;
    }

    table.rk-admin-data-table.rk-mobile-stack-table tbody td.text-end {
        flex-direction: column;
        align-items: stretch !important;
        text-align: left !important;
    }

    table.rk-admin-data-table.rk-mobile-stack-table tbody td.text-end .btn,
    table.rk-admin-data-table.rk-mobile-stack-table tbody td .btn {
        width: 100%;
        margin: 0.15rem 0 !important;
        min-height: 2.35rem;
    }

    .audit-log-page .card-body .row > [class*="col-"] {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .audit-log-entry .card-body .d-flex.flex-wrap.justify-content-between {
        flex-direction: column;
        align-items: flex-start !important;
    }
}

@media (max-width: 575.98px) {
    .admin-grid-mobile-metrics {
        grid-template-columns: 1fr;
    }
}

/* Grid header with search - Blazor Bootstrap skin */
.dashboard-grid-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 1rem;
    padding: 1rem 1.25rem !important;
    background: #f8f9fa !important;
    border-bottom: 1px solid #dee2e6 !important;
}

.dashboard-grid-title {
    font-size: 0.95rem !important;
    font-weight: 600 !important;
    color: #212529 !important;
}

.dashboard-search-wrap {
    position: relative;
    width: 220px;
}

.dashboard-search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    font-size: 0.9rem;
    pointer-events: none;
}

.dashboard-search-input {
    padding-left: 2.25rem !important;
    padding-right: 2rem !important;
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
}

.dashboard-search-input:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* ========== Grid headers - theme colors for readability ========== */
.data-grid thead,
.data-grid thead.table-light,
.dashboard-projects-table thead,
.dashboard-projects-table thead.table-light,
.projects-table thead,
.tasks-page .table thead,
.tasks-page .table thead.table-light,
.tasks-page-grid .table thead,
.tasks-page-grid .table thead.table-light,
.inbox-grid table thead,
.admin-settings-grid .table thead,
.admin-settings-grid .table thead.table-light,
.task-config-grid .table thead,
.task-config-grid .table thead.table-light {
    background-color: #f1f5f9 !important;
    background: #f1f5f9 !important;
}

.data-grid thead th,
.dashboard-projects-table thead th,
.projects-table thead th,
.tasks-page .table thead th,
.tasks-page-grid .table thead th,
.inbox-grid table thead th,
.admin-settings-grid .table thead th,
.admin-settings-grid .table thead.table-light th,
.task-config-grid .table thead th,
.task-config-grid .table thead.table-light th {
    font-family: var(--bb-font) !important;
    font-size: 0.75rem !important;
    font-weight: 700 !important;
    color: var(--bb-dark) !important;
    padding: 0.875rem 1rem !important;
    border-color: #e2e8f0 !important;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}


/* Table - Blazor Bootstrap with attractive headers */
.dashboard-projects-table {
    margin-bottom: 0;
}

.dashboard-projects-table th,
.dashboard-projects-table td {
    padding: 0.75rem 1rem;
    vertical-align: middle;
    line-height: 1.5;
}

.dashboard-projects-table thead th {
    white-space: nowrap;
}

.dashboard-projects-table thead th.text-end {
    text-align: right;
}

.dashboard-projects-table tbody tr {
    transition: background 0.15s ease;
}

.dashboard-projects-table tbody tr:nth-of-type(odd) {
    background-color: rgba(0, 0, 0, 0.02);
}

.dashboard-projects-table tbody tr:hover {
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%) !important;
}

.dashboard-projects-table td {
    padding: 0.75rem 1rem;
    vertical-align: middle;
    font-size: 0.9rem;
    font-family: var(--bb-font);
    color: var(--bb-dark);
    border: 1px solid #e2e8f0;
    line-height: 1.5;
}

.dashboard-projects-table td code {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--bb-dark);
    background: transparent;
    padding: 0;
    border: none;
    line-height: 1.5;
}

.dashboard-projects-table td strong {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--bb-dark);
    line-height: 1.5;
}

.dashboard-projects-table .text-end {
    text-align: right;
    white-space: nowrap;
    vertical-align: middle;
    min-width: 6.5rem;
}

.dashboard-projects-table .badge {
    font-weight: 500;
    padding: 0.35em 0.6em;
    border-radius: 0.25rem;
}

.dashboard-projects-table .btn-outline-secondary {
    font-weight: 500;
    border-radius: 0.375rem;
}

/* Pagination - theme style */
.dashboard-pagination .pagination {
    gap: 0.25rem;
}

.dashboard-pagination .page-link {
    color: var(--bb-primary);
    border: 1px solid #e2e8f0;
    border-radius: var(--bb-radius);
    padding: 0.375rem 0.75rem;
    font-family: var(--bb-font);
}

.dashboard-pagination .page-link:hover {
    background: #f1f5f9;
    border-color: #e2e8f0;
}

.dashboard-pagination .page-item.active .page-link {
    background: var(--bb-primary);
    border-color: var(--bb-primary);
    color: #fff;
}

.dashboard-pagination .page-item.disabled .page-link {
    color: var(--bb-secondary);
}

.dashboard-pagination-info {
    font-size: 0.875rem;
    font-family: var(--bb-font);
    color: var(--bb-secondary);
}

/* Shared grid pagination - Projects, Inbox, Tasks */
.grid-pagination .pagination {
    gap: 0.25rem;
}

.grid-pagination .page-link {
    color: var(--bb-primary);
    border: 1px solid #e2e8f0;
    border-radius: var(--bb-radius);
    padding: 0.375rem 0.75rem;
    font-family: var(--bb-font);
}

.grid-pagination .page-link:hover {
    background: #f1f5f9;
}

.grid-pagination .page-item.active .page-link {
    background: var(--bb-primary);
    border-color: var(--bb-primary);
    color: #fff;
}

.grid-pagination .page-item.disabled .page-link {
    color: var(--bb-secondary);
}

.grid-pagination-info {
    font-size: 0.875rem;
    font-family: var(--bb-font);
    color: var(--bb-secondary);
}

/* Inbox filter card */
.inbox-filter-card {
    background: var(--bb-card-bg);
    border: 1px solid #e2e8f0;
    border-radius: var(--bb-radius-lg);
    font-family: var(--bb-font);
}

.inbox-filter-card .form-label {
    font-weight: 500;
    color: #495057;
}

/* Admin table base - only for tables NOT in styled grid wrappers */

.table.table-hover tbody tr:hover {
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%) !important;
}

/* Payments repeater table - modal and ProjectDetail */
.payments-repeater-table {
    font-family: var(--bb-font);
}

.payments-repeater-table th {
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--bb-secondary);
}

.payments-repeater-table td {
    font-size: 0.9rem;
    color: var(--bb-dark);
}

/* ProjectDetail and other table-sm bordered tables */
.table.table-sm.table-bordered {
    font-family: var(--bb-font);
}

.table.table-sm.table-bordered thead th {
    font-weight: 600;
    font-size: 0.75rem;
    color: var(--bb-dark);
    background: #f8fafc !important;
}

.table.table-sm.table-bordered td {
    font-size: 0.875rem;
    color: var(--bb-dark);
}

/* ========== Admin modals - Add/Edit Role, Add/Edit User - theme font and styles ========== */
.admin-modal-backdrop {
    background-color: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
}

.admin-modal-dialog {
    max-width: min(95vw, 700px);
}

.admin-modal-dialog.modal-lg {
    max-width: min(95vw, 800px);
}

.admin-modal-dialog-sm {
    max-width: min(95vw, 420px);
}

.admin-modal-content {
    border: none;
    border-radius: var(--bb-radius-xl);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.05);
    font-family: var(--bb-font);
    overflow: hidden;
}

.admin-modal-header {
    background: linear-gradient(135deg, var(--bb-primary) 0%, var(--bb-primary-dark) 100%);
    color: #fff;
    padding: 1rem 1.25rem;
    border-bottom: none;
}

.admin-modal-header-danger {
    background: linear-gradient(135deg, var(--bb-danger) 0%, #b91c1c 100%);
}

.admin-modal-title {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0;
}

.admin-modal-close {
    filter: brightness(0) invert(1);
    opacity: 0.85;
}

.admin-modal-close:hover {
    opacity: 1;
}

.admin-modal-body {
    padding: 1.5rem 1.25rem;
    background: var(--bb-card-bg);
}

.admin-modal-body .form-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--bb-dark);
}

.admin-modal-body .form-control,
.admin-modal-body .form-select {
    font-size: 0.9rem;
    border-radius: var(--bb-radius);
    border: 1px solid #e2e8f0;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.admin-modal-body .form-control:focus,
.admin-modal-body .form-select:focus {
    border-color: var(--bb-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.admin-modal-section {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--bb-secondary);
    margin: 0 0 0.75rem 0;
    padding-bottom: 0.5rem;
}

.admin-modal-divider {
    margin: 1.25rem 0 1rem 0;
    border-color: #e2e8f0;
}

.admin-modal-table-wrap {
    max-height: 360px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: var(--bb-radius);
    padding: 0.75rem;
    background: #fafbfc;
}

.admin-modal-table-wrap .table {
    font-size: 0.875rem;
}

.admin-modal-table-wrap .table thead th {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--bb-secondary);
}

.admin-modal-table-wrap .table tbody td {
    color: var(--bb-dark);
}

.admin-modal-footer {
    padding: 1rem 1.25rem;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

.admin-modal-footer .btn-primary {
    font-weight: 600;
    padding: 0.5rem 1.25rem;
}

.admin-modal-body .alert {
    border-radius: var(--bb-radius);
}

.admin-modal-body .form-check-label {
    font-family: var(--bb-font);
    color: var(--bb-dark);
}

/* UserEditModal roles list */
.admin-modal-roles-wrap,
.admin-modal-body .border.rounded {
    max-height: 200px;
    overflow-y: auto;
    border-color: #e2e8f0 !important;
    border-radius: var(--bb-radius) !important;
    background: #fafbfc;
}

/* ========== Add/Edit Project Modal - polished styles, Plus Jakarta Sans ========== */
.project-edit-modal-backdrop {
    background-color: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
}

.project-edit-modal-dialog {
    max-width: min(95vw, 900px);
    margin: 1rem auto;
}

@media (min-width: 992px) {
    .project-edit-modal-dialog {
        max-width: min(92vw, 1000px);
    }
}

@media (min-width: 1200px) {
    .project-edit-modal-dialog {
        max-width: min(90vw, 1100px);
    }
}

.project-edit-modal-content {
    border: none;
    border-radius: var(--bb-radius-xl);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.05);
    font-family: var(--bb-font);
    overflow: hidden;
}

.project-edit-modal-header {
    background: linear-gradient(135deg, var(--bb-primary) 0%, var(--bb-primary-dark) 100%);
    color: #fff;
    padding: 1rem 1.25rem;
    border-bottom: none;
}

.project-edit-modal-title {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0;
}

.project-edit-modal-close {
    filter: brightness(0) invert(1);
    opacity: 0.85;
}

.project-edit-modal-close:hover {
    opacity: 1;
}

.project-edit-modal-body {
    padding: 1.5rem 1.25rem;
    max-height: calc(100vh - 140px);
    overflow-y: auto;
    background: var(--bb-card-bg);
}

.project-edit-modal-body .form-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--bb-dark);
}

.project-edit-modal-body .form-control,
.project-edit-modal-body .form-select {
    font-size: 0.9rem;
    border-radius: 0.5rem;
    border: 1px solid #e2e8f0;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.project-edit-modal-body .form-control:focus,
.project-edit-modal-body .form-select:focus {
    border-color: var(--bb-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.project-edit-modal-section {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--bb-secondary);
    margin: 1.25rem 0 0.75rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e2e8f0;
}

.project-edit-modal-footer {
    padding: 1rem 1.25rem;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

.project-edit-modal-footer .btn-primary {
    font-weight: 600;
    padding: 0.5rem 1.25rem;
}

.project-edit-modal-body .payments-repeater-modal {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

/* Section box used inside project edit modal to visually group fields */
.project-modal-section-box {
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
    border: 1px solid #e6eef9;
    border-radius: 8px;
    padding: 1rem;
}

.project-modal-section-box .form-label {
    color: #44566a;
}

.project-edit-modal-body .payments-repeater-table {
    font-size: 0.85rem;
}

.project-edit-modal-body .payments-repeater-table th,
.project-edit-modal-body .payments-repeater-table td {
    padding: 0.4rem 0.6rem;
}

.project-edit-modal-body .alert-danger {
    border-radius: 0.5rem;
}

@media (min-height: 700px) {
    .project-edit-modal-body {
        max-height: calc(100vh - 120px);
    }
}

@media (max-width: 576px) {
    .project-edit-modal-dialog {
        max-width: 98vw;
        margin: 0.5rem auto;
    }
    .project-edit-modal-body {
        padding: 1rem;
    }
}

/* Project edit modal — section panels & vendor assignment */
.project-edit-modal-body {
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 12rem);
}

.project-edit-modal-panel {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1rem 1.1rem 1.15rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.project-edit-modal-panel--core {
    border-color: #dbeafe;
    background: linear-gradient(135deg, #ffffff 0%, #f0f7ff 100%);
}

.project-edit-modal-panel-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--bb-primary);
    margin-bottom: 0.75rem;
}

.project-edit-modal-panel-icon {
    font-size: 1.1rem;
    opacity: 0.9;
}

.project-edit-modal-panel--customer {
    border-left: 3px solid #6366f1;
}

.project-edit-modal-panel--roles {
    border-left: 3px solid #0ea5e9;
}

.project-edit-modal-panel--financial {
    border-left: 3px solid #10b981;
}

.project-edit-modal-section {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0;
}

.project-edit-vendor-panel {
    margin-top: 0.75rem;
    padding: 1rem;
    border-radius: 10px;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
}

.project-edit-vendor-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.35rem;
}

.project-edit-vendor-link {
    font-weight: 600;
}

.project-vendor-assignment {
    margin-top: 0.25rem;
}

.project-vendor-assign-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: flex-end;
    margin-bottom: 0.75rem;
}

.project-vendor-assign-field {
    flex: 1 1 220px;
    min-width: 0;
}

.project-vendor-assign-action .btn {
    font-weight: 600;
    padding: 0.4rem 1rem;
    border-radius: 8px;
    white-space: nowrap;
}

.project-vendor-preview {
    padding: 0.65rem 0.85rem;
    margin-bottom: 0.85rem;
    border-radius: 8px;
    background: #fff;
    border: 1px dashed #cbd5e1;
}

.project-vendor-preview-label {
    display: block;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b;
    margin-bottom: 0.35rem;
}

.project-vendor-preview-block {
    font-size: 0.8rem;
    margin-bottom: 0.2rem;
}

.project-vendor-preview-block:last-child {
    margin-bottom: 0;
}

.project-vendor-preview-service {
    font-weight: 700;
    color: var(--bb-primary);
    margin-right: 0.35rem;
}

.project-vendor-preview-items {
    color: #475569;
}

.project-vendor-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.project-vendor-empty {
    text-align: center;
    padding: 1.25rem 1rem;
    border-radius: 10px;
    border: 1px dashed #cbd5e1;
    background: #fff;
}

.project-vendor-empty-icon {
    font-size: 1.75rem;
    color: #94a3b8;
    display: block;
    margin-bottom: 0.35rem;
}

.project-vendor-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 0.75rem 0.85rem;
    transition: box-shadow 0.2s, border-color 0.2s;
}

.project-vendor-card:hover {
    border-color: #93c5fd;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.08);
}

.project-vendor-card-main {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
}

.project-vendor-card-icon {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 8px;
    background: linear-gradient(135deg, #dbeafe 0%, #eff6ff 100%);
    color: var(--bb-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.project-vendor-card-name {
    font-weight: 700;
    color: #0f172a;
    font-size: 0.95rem;
}

.project-vendor-card-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.2rem;
}

.project-vendor-card-items {
    margin-top: 0.25rem;
    line-height: 1.35;
}

.project-edit-modal-footer {
    gap: 0.5rem;
    box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.06);
}

.project-edit-modal-footer .btn {
    border-radius: 8px;
    min-width: 6rem;
}

.project-edit-modal-loading {
    min-height: 12rem;
}

@media (max-width: 576px) {
    .project-vendor-assign-row {
        flex-direction: column;
        align-items: stretch;
    }

    .project-vendor-assign-action .btn {
        width: 100%;
    }

    .project-vendor-card-main {
        flex-wrap: wrap;
    }
}

/* Workflow board - stage-based work tracking */
.workflow-board {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.workflow-stage-column {
    min-width: 280px;
    max-width: 320px;
    flex: 1 1 280px;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 0.75rem;
    border: 1px solid #dee2e6;
}

.workflow-stage-header {
    font-weight: 600;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #dee2e6;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.workflow-stage-header.has-review {
    border-bottom-color: #ffc107;
}

.workflow-stage-tasks {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.workflow-task-card {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 0.75rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.workflow-task-card.actionable {
    border-color: #0d6efd;
    box-shadow: 0 0 0 1px rgba(13, 110, 253, 0.25);
}

.workflow-task-title {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.35rem;
}

.workflow-task-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
    margin-bottom: 0.5rem;
}

.workflow-task-role {
    font-size: 0.75rem;
    color: #6c757d;
}

.workflow-task-assignees {
    font-size: 0.8rem;
    color: #495057;
}

.assignee-row {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.2rem;
}

.assignee-name {
    flex: 1;
}

.assignee-status {
    font-size: 0.65rem;
}

.workflow-task-rework {
    background: #fff3cd;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

/* CRITICAL: Grid header text must be readable - light bg + dark text */
table.dashboard-projects-table thead th,
table.projects-table thead th,
.dashboard-projects-card table thead th,
.projects-card table thead th,
.inbox-grid table thead th,
.tasks-page-grid table thead th,
.admin-settings-grid table thead th,
.task-config-grid table thead th {
    background-color: #f1f5f9 !important;
    color: var(--bb-dark) !important;
}

/* ========== Task configuration page — rich grid ========== */
.task-config-page .task-config-page-header {
    margin-bottom: 1.25rem;
}

.task-config-grid {
    border: 1px solid #dbe4f0;
    border-radius: 14px;
    box-shadow: 0 4px 24px rgba(15, 23, 42, 0.08), 0 0 0 1px rgba(255, 255, 255, 0.6) inset;
    overflow: hidden;
    background: #fff;
}

.task-config-filter-bar {
    background: linear-gradient(135deg, #f0f7ff 0%, #f8fafc 55%, #ffffff 100%);
    padding: 1.1rem 1.35rem;
    gap: 1rem;
    border-bottom: 1px solid #dbe4f0;
}

.task-config-filter-field {
    min-width: 200px;
}

.task-config-filter-field--compact {
    min-width: 110px;
}

.task-config-filter-bar .form-label {
    font-weight: 600;
    color: #475569;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.task-config-filter-input {
    border-radius: 8px;
    border-color: #cbd5e1;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.task-config-filter-input:focus {
    border-color: var(--bb-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.task-config-hint {
    border-radius: 10px;
    border: 1px solid #bfdbfe;
    background: linear-gradient(180deg, #eff6ff 0%, #f8fafc 100%);
}

.task-config-grid-body {
    padding: 0;
    background: linear-gradient(180deg, #fafbfc 0%, #ffffff 48px);
}

.task-config-table-wrap {
    padding: 0 0.5rem;
}

.task-config-table {
    margin-bottom: 0;
    border-collapse: separate;
    border-spacing: 0;
}

.task-config-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: linear-gradient(180deg, #e8f0fe 0%, #f1f5f9 100%) !important;
    color: #1e3a5f !important;
    border-bottom: 2px solid #c7d7f5 !important;
    padding: 0.85rem 1rem !important;
    white-space: nowrap;
}

.task-config-table tbody td {
    padding: 0.9rem 1rem !important;
    vertical-align: middle;
    border-color: #e8eef5 !important;
}

.task-config-row {
    transition: background 0.15s ease, box-shadow 0.15s ease;
}

.task-config-row--root {
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.06) 0%, transparent 55%);
}

.task-config-row--sub {
    background: #fff;
}

.task-config-row:nth-child(even).task-config-row--sub {
    background: #fafbfd;
}

.task-config-table tbody tr:hover {
    background: linear-gradient(90deg, #eff6ff 0%, #f8fafc 100%) !important;
    box-shadow: inset 3px 0 0 var(--bb-primary);
}

.task-config-cell-task {
    min-width: 220px;
    max-width: 320px;
}

.task-config-task-name {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.task-config-root-icon {
    color: var(--bb-primary);
    font-size: 1rem;
    margin-top: 0.15rem;
    flex-shrink: 0;
}

.task-config-subtask-marker {
    width: 10px;
    height: 10px;
    border-left: 2px solid #94a3b8;
    border-bottom: 2px solid #94a3b8;
    margin-top: 0.35rem;
    margin-left: 0.15rem;
    flex-shrink: 0;
    border-radius: 0 0 0 2px;
}

.task-config-task-text {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.task-config-display-name {
    font-weight: 700;
    color: #0f172a;
    font-size: 0.92rem;
    line-height: 1.3;
}

.task-config-code {
    font-size: 0.72rem;
    color: #64748b;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.task-config-parents-hint {
    margin-top: 0.35rem;
    margin-left: 1.65rem;
    font-size: 0.72rem;
    color: #64748b;
    line-height: 1.35;
}

.task-config-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    padding: 0.28rem 0.55rem;
    border-radius: 6px;
    text-transform: uppercase;
}

.task-config-badge--root {
    background: linear-gradient(135deg, var(--pah-primary-bright) 0%, var(--pah-primary-dark) 100%);
    color: #fff;
    box-shadow: 0 1px 4px rgba(37, 99, 235, 0.35);
}

.task-config-badge--sub {
    background: #e2e8f0;
    color: #475569;
    border: 1px solid #cbd5e1;
}

.task-config-trigger {
    font-size: 0.82rem;
    color: #334155;
    line-height: 1.35;
    display: inline-block;
    max-width: 11rem;
}

.task-config-review {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
}

.task-config-review--none {
    background: #f1f5f9;
    color: #64748b;
}

.task-config-review--customer {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

.task-config-review--internal {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

.task-config-role-badge {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 600;
    color: #1e3a5f;
    background: linear-gradient(180deg, #fff 0%, #f1f5f9 100%);
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    padding: 0.25rem 0.65rem;
    max-width: 14rem;
    line-height: 1.3;
}

.task-config-meta-badge,
.task-config-section-badge {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.22rem 0.5rem;
    border-radius: 6px;
}

.task-config-meta-badge {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.task-config-section-badge {
    background: #e0f2fe;
    color: #0369a1;
    border: 1px solid #bae6fd;
}

.task-config-ptype {
    font-size: 0.8rem;
    font-weight: 600;
    color: #64748b;
}

.task-config-actions {
    display: inline-flex;
    gap: 0.35rem;
    justify-content: flex-end;
    flex-wrap: nowrap;
}

.task-config-btn-edit {
    color: var(--bb-primary);
    border: 1px solid #93c5fd;
    background: #fff;
    border-radius: 8px;
    font-weight: 600;
    padding: 0.3rem 0.55rem;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.task-config-btn-edit:hover {
    background: var(--bb-primary);
    border-color: var(--bb-primary);
    color: #fff;
}

.task-config-btn-delete {
    color: #b91c1c;
    border: 1px solid #fecaca;
    background: #fff;
    border-radius: 8px;
    font-weight: 600;
    padding: 0.3rem 0.55rem;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.task-config-btn-delete:hover {
    background: #dc2626;
    border-color: #dc2626;
    color: #fff;
}

.task-config-grid .admin-grid-pagination {
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    border-top: 1px solid #dbe4f0;
    padding: 0.85rem 1.35rem;
}

.task-config-grid .admin-grid-pagination .page-link {
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85rem;
}

.task-config-empty {
    text-align: center;
    padding: 2.5rem 1.5rem;
    margin: 1rem;
    border-radius: 12px;
    border: 1px dashed #cbd5e1;
    background: #fff;
}

.task-config-empty-icon {
    display: block;
    font-size: 2.25rem;
    color: #94a3b8;
    margin-bottom: 0.5rem;
}

/* Task Configuration — Add/Edit & delete confirm modals */
.task-config-modal-backdrop {
    background-color: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
}

.task-config-modal-dialog {
    max-width: min(94vw, 720px);
    margin: 1.25rem auto;
}

.task-config-modal-content {
    border: none;
    border-radius: 14px;
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.35), 0 0 0 1px rgba(148, 163, 184, 0.12);
    font-family: var(--bb-font);
    overflow: hidden;
}

.task-config-modal-header {
    background: linear-gradient(135deg, #4f46e5 0%, #3730a3 100%);
    color: #fff;
    padding: 1rem 1.25rem;
    border-bottom: none;
}

.task-config-modal-title {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0;
    display: flex;
    align-items: center;
}

.task-config-modal-close {
    filter: brightness(0) invert(1);
    opacity: 0.88;
}

.task-config-modal-close:hover {
    opacity: 1;
}

.task-config-modal-body {
    padding: 1.25rem;
    max-height: calc(100vh - 150px);
    overflow-y: auto;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
}

.task-config-modal-body .form-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.35rem;
}

.task-config-form-control {
    font-size: 0.9rem;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.task-config-form-control:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18);
}

.task-config-form-panel {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1rem 1.1rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.task-config-form-panel--primary {
    border-color: #c7d2fe;
    background: linear-gradient(180deg, #ffffff 0%, #f5f7ff 100%);
}

.task-config-form-section {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #64748b;
    margin: 0 0 0.75rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
}

.task-config-check-panel {
    max-height: 160px;
    overflow-y: auto;
    padding: 0.65rem 0.75rem;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
}

.task-config-check-panel--tall {
    max-height: 180px;
}

.task-config-check-panel .form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0;
    margin-bottom: 0;
    min-height: 1.5rem;
    padding-left: 0;
}

.task-config-check-panel .form-check-input {
    float: none;
    margin: 0;
    flex: 0 0 1em;
    width: 1em;
    height: 1em;
    position: static;
}

.task-config-check-panel .form-check-label {
    cursor: pointer;
    padding-left: 0;
    line-height: 1.35;
}

.task-config-check-panel::-webkit-scrollbar {
    width: 6px;
}

.task-config-check-panel::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.task-config-radio-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
}

.task-config-radio-card {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.75rem 0.85rem;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
    margin: 0;
}

.task-config-radio-card .form-check-input {
    margin-top: 0.1rem;
    flex-shrink: 0;
}

.task-config-radio-card.is-selected {
    border-color: #6366f1;
    background: #eef2ff;
    box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.25);
}

.task-config-radio-card-title {
    font-weight: 700;
    font-size: 0.9rem;
    color: #1e293b;
}

.task-config-radio-card-desc {
    font-size: 0.78rem;
    color: #64748b;
}

.task-config-inline-hint {
    font-size: 0.82rem;
    color: #64748b;
    margin: 0.5rem 0 0;
    padding: 0.5rem 0.65rem;
    background: #f1f5f9;
    border-radius: 8px;
    border-left: 3px solid #6366f1;
}

.task-config-option-card {
    padding: 0.75rem 0.85rem;
    border-radius: 10px;
    border: 1px dashed #c7d2fe;
    background: #fafaff;
}

.task-config-repeat-preview {
    padding: 0.85rem;
    border-radius: 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.task-config-preview-list {
    padding-top: 0.5rem;
}

.task-config-preview-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #475569;
    margin-bottom: 0.35rem;
}

.task-config-preview-item {
    font-size: 0.85rem;
    color: #334155;
    padding: 0.25rem 0;
    border-bottom: 1px solid #f1f5f9;
}

.task-config-preview-item:last-child {
    border-bottom: none;
}

.task-config-review-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.task-config-review-card {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.85rem;
    border: 2px solid #e2e8f0;
    border-radius: 999px;
    background: #f8fafc;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    color: #475569;
    margin: 0;
    transition: border-color 0.2s, background 0.2s;
}

.task-config-review-card.is-selected {
    border-color: #6366f1;
    background: #eef2ff;
    color: #3730a3;
}

.task-config-modal-footer {
    padding: 0.9rem 1.25rem;
    background: #fff;
    border-top: 1px solid #e2e8f0;
    gap: 0.5rem;
}

.task-config-btn-cancel {
    font-weight: 600;
    border-radius: 8px;
    padding: 0.45rem 1rem;
}

.task-config-btn-save {
    font-weight: 600;
    border-radius: 8px;
    padding: 0.45rem 1.25rem;
    background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
    border: none;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.35);
}

.task-config-btn-save:hover:not(:disabled) {
    background: linear-gradient(135deg, #4338ca 0%, #3730a3 100%);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
}

.task-config-btn-save:disabled {
    opacity: 0.55;
}

.task-config-confirm-dialog {
    max-width: 420px;
}

.task-config-confirm-content {
    border: none;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 20px 40px -10px rgba(15, 23, 42, 0.3);
}

.task-config-confirm-header {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    color: #fff;
    border-bottom: none;
    padding: 0.9rem 1.15rem;
}

.task-config-confirm-header .modal-title {
    font-size: 1rem;
    font-weight: 700;
}

.task-config-confirm-body {
    padding: 1.15rem 1.25rem;
    font-size: 0.92rem;
    color: #334155;
    background: #fff;
}

.task-config-btn-delete-confirm {
    font-weight: 600;
    border-radius: 8px;
    padding: 0.45rem 1.1rem;
}

@media (max-width: 576px) {
    .task-config-radio-cards {
        grid-template-columns: 1fr;
    }

    .task-config-modal-body {
        padding: 1rem;
    }
}

/* Company Settings page */
.company-settings-page {
    max-width: 960px;
    margin: 0 auto;
    padding-bottom: 2rem;
}

.company-settings-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.company-settings-title {
    font-size: 1.65rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #0f172a;
    margin: 0 0 0.35rem 0;
    display: flex;
    align-items: center;
}

.company-settings-subtitle {
    font-size: 0.92rem;
    color: #64748b;
    margin: 0;
    max-width: 36rem;
    line-height: 1.5;
}

.company-settings-back {
    border-radius: 8px;
    font-weight: 600;
    white-space: nowrap;
}

.company-settings-loading {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 2rem;
    color: #64748b;
    font-weight: 500;
}

.company-settings-alert {
    border-radius: 10px;
    border: none;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
    display: flex;
    align-items: center;
}

.company-settings-card {
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 16px;
    padding: 1.25rem;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
}

.company-settings-panel {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.15rem 1.25rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.company-settings-panel--brand {
    border-color: #c7d2fe;
    background: linear-gradient(180deg, #ffffff 0%, #f8faff 100%);
}

.company-settings-panel-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #334155;
    margin: 0 0 1rem 0;
    padding-bottom: 0.65rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.company-settings-panel-icon {
    color: #4f46e5;
    font-size: 1.1rem;
}

.company-settings-form .form-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 0.35rem;
}

.company-settings-input {
    font-size: 0.9rem;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.company-settings-input:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.company-settings-logo-upload {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.company-settings-file-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #3730a3;
    background: #eef2ff;
    border: 1px dashed #a5b4fc;
    border-radius: 8px;
    cursor: pointer;
    width: fit-content;
    transition: background 0.2s, border-color 0.2s;
}

.company-settings-file-btn:hover {
    background: #e0e7ff;
    border-color: #6366f1;
}

.company-settings-file-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.company-settings-logo-preview {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.75rem;
    padding: 0.65rem 0.85rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}

.company-settings-logo-preview img {
    max-height: 64px;
    max-width: 220px;
    object-fit: contain;
    border-radius: 6px;
}

.company-settings-logo-remove {
    color: #dc2626;
    font-weight: 600;
    border: 1px solid #fecaca;
    background: #fff;
    border-radius: 8px;
}

.company-settings-logo-remove:hover {
    background: #fef2f2;
    color: #b91c1c;
}

.company-settings-color-field {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.company-settings-color-swatch {
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    flex-shrink: 0;
    background: transparent;
}

.company-settings-color-field .company-settings-input {
    flex: 1;
    min-width: 0;
}

.company-settings-footer {
    display: flex;
    justify-content: flex-end;
    padding: 0.5rem 0 0;
    margin-top: 0.25rem;
}

.company-settings-save {
    font-weight: 600;
    border-radius: 10px;
    padding: 0.55rem 1.5rem;
    background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
    border: none;
    box-shadow: 0 2px 10px rgba(79, 70, 229, 0.35);
}

.company-settings-save:hover:not(:disabled) {
    background: linear-gradient(135deg, #4338ca 0%, #3730a3 100%);
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.4);
}

.company-settings-save:disabled {
    opacity: 0.7;
}

@media (max-width: 768px) {
    .company-settings-header {
        flex-direction: column;
    }

    .company-settings-card {
        padding: 0.85rem;
    }

    .company-settings-panel {
        padding: 1rem;
    }
}

/* Client Companies page */
.client-companies-page {
    max-width: 1280px;
    margin: 0 auto;
    padding-bottom: 2rem;
}

.client-companies-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.client-companies-title {
    font-size: 1.65rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #0f172a;
    margin: 0 0 0.35rem 0;
    display: flex;
    align-items: center;
}

.client-companies-subtitle {
    font-size: 0.92rem;
    color: #64748b;
    margin: 0;
    max-width: 40rem;
    line-height: 1.5;
}

.client-companies-back {
    border-radius: 8px;
    font-weight: 600;
    white-space: nowrap;
}

.client-companies-alert {
    border-radius: 10px;
    border: none;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
    display: flex;
    align-items: center;
}

.client-companies-grid {
    border: 1px solid #dbe4f0;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(15, 23, 42, 0.08);
    overflow: hidden;
    background: #fff;
}

.client-companies-grid-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.15rem 1.35rem;
    background: linear-gradient(135deg, #f0f7ff 0%, #f8fafc 55%, #ffffff 100%);
    border-bottom: 1px solid #dbe4f0;
}

.client-companies-grid-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 0.25rem 0;
    display: flex;
    align-items: center;
}

.client-companies-grid-desc {
    font-size: 0.85rem;
    color: #64748b;
    margin: 0;
}

.client-companies-btn-add {
    font-weight: 600;
    border-radius: 10px;
    padding: 0.45rem 1rem;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.25);
}

.client-companies-filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 1rem;
    padding: 1rem 1.35rem;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.client-companies-filter-field {
    flex: 1 1 280px;
    min-width: 200px;
}

.client-companies-filter-field .form-label {
    font-weight: 600;
    color: #475569;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.client-companies-filter-input {
    border-radius: 10px;
    border: 1px solid #cbd5e1;
    padding: 0.5rem 0.75rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.client-companies-filter-input:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.client-companies-count {
    font-size: 0.88rem;
    color: #64748b;
    padding-bottom: 0.35rem;
    white-space: nowrap;
}

.client-companies-delete-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin: 1rem 1.35rem 0;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    background: linear-gradient(90deg, #fff7ed 0%, #fffbeb 100%);
    border: 1px solid #fed7aa;
    color: #9a3412;
    font-size: 0.9rem;
}

.client-companies-delete-actions {
    display: flex;
    gap: 0.5rem;
}

.client-companies-btn-delete-confirm {
    background: #dc2626;
    border-color: #dc2626;
    color: #fff;
    font-weight: 600;
    border-radius: 8px;
}

.client-companies-btn-delete-confirm:hover {
    background: #b91c1c;
    border-color: #b91c1c;
    color: #fff;
}

.client-companies-grid-body {
    background: linear-gradient(180deg, #fafbfc 0%, #ffffff 40px);
}

.client-companies-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 3rem;
    color: #64748b;
    font-weight: 500;
}

.client-companies-empty {
    text-align: center;
    padding: 3rem 1.5rem;
    color: #64748b;
}

.client-companies-empty-icon {
    display: block;
    font-size: 2.5rem;
    color: #94a3b8;
    margin-bottom: 0.5rem;
}

.client-companies-table-wrap {
    overflow-x: auto;
    padding: 0.5rem 0.75rem 0;
}

.client-companies-page .site-sc-grid-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 0.75rem;
    padding: 0.65rem 0.85rem 1rem;
    margin: 0 0.75rem;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
    border-radius: 0 0 0.5rem 0.5rem;
}

.client-companies-page .site-sc-grid-pagination__toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    min-width: 0;
}

.client-companies-page .site-sc-grid-pagination__size {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin: 0;
}

.client-companies-page .site-sc-grid-pagination__size .form-select {
    width: 4.25rem;
    min-height: 2rem;
    font-size: 0.875rem;
}

.client-companies-page .site-sc-grid-pagination__info {
    white-space: nowrap;
}

.client-companies-page .site-sc-grid-pagination__nav .pagination {
    flex-wrap: wrap;
    gap: 0.15rem;
}

.client-companies-page .site-sc-grid-pagination__nav .page-link {
    min-width: 2.25rem;
    text-align: center;
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

@media (max-width: 575.98px) {
    .client-companies-page .site-sc-grid-pagination {
        flex-direction: column;
        align-items: stretch;
    }

    .client-companies-page .site-sc-grid-pagination__nav .pagination {
        justify-content: center;
    }
}

.client-companies-table {
    border-collapse: separate;
    border-spacing: 0;
}

.client-companies-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: linear-gradient(180deg, #e8f0fe 0%, #f1f5f9 100%) !important;
    color: #1e3a5f !important;
    border-bottom: 2px solid #c7d7f5 !important;
    padding: 0.8rem 1rem !important;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.client-companies-table tbody td {
    padding: 0.85rem 1rem !important;
    vertical-align: middle;
    border-color: #e8eef5 !important;
    font-size: 0.9rem;
}

.client-companies-row {
    transition: background 0.15s ease;
}

.client-companies-row:hover {
    background: #f8fafc !important;
}

.client-companies-cell-name {
    min-width: 180px;
}

.client-companies-name {
    display: block;
    font-weight: 700;
    color: #0f172a;
}

.client-companies-address {
    display: block;
    font-size: 0.78rem;
    color: #64748b;
    margin-top: 0.15rem;
    max-width: 280px;
    line-height: 1.35;
}

.client-companies-email {
    color: #4f46e5;
    text-decoration: none;
}

.client-companies-email:hover {
    text-decoration: underline;
}

.client-companies-dash {
    color: #94a3b8;
}

.client-companies-actions {
    white-space: nowrap;
}

.client-companies-btn-edit {
    font-weight: 600;
    border-radius: 8px;
    border: 1px solid #a5b4fc;
    color: #4338ca;
    background: #eef2ff;
    margin-right: 0.35rem;
}

.client-companies-btn-edit:hover {
    background: #e0e7ff;
    color: #3730a3;
    border-color: #818cf8;
}

.client-companies-btn-delete {
    font-weight: 600;
    border-radius: 8px;
    border: 1px solid #fecaca;
    color: #b91c1c;
    background: #fff;
}

.client-companies-btn-delete:hover {
    background: #fef2f2;
    color: #991b1b;
}

/* Client company add/edit modal */
.client-company-modal-backdrop {
    background-color: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
}

.client-company-modal-dialog {
    max-width: min(94vw, 720px);
    margin: 1.25rem auto;
}

.client-company-modal-content {
    border: none;
    border-radius: 14px;
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.35);
    overflow: hidden;
}

.client-company-modal-header {
    background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
    color: #fff;
    padding: 1rem 1.25rem;
    border-bottom: none;
}

.client-company-modal-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
}

.client-company-modal-close {
    filter: brightness(0) invert(1);
    opacity: 0.88;
}

.client-company-modal-close:hover {
    opacity: 1;
}

.client-company-modal-body {
    padding: 1.25rem;
    max-height: calc(100vh - 150px);
    overflow-y: auto;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
}

.client-company-form-panel {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1rem 1.1rem;
    margin-bottom: 1rem;
}

.client-company-form-panel--primary {
    border-color: #99f6e4;
    background: linear-gradient(180deg, #ffffff 0%, #f0fdfa 100%);
}

.client-company-form-section {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #64748b;
    margin: 0 0 0.75rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
}

.client-company-modal-body .form-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #475569;
}

.client-company-input {
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.client-company-input:focus {
    border-color: #0d9488;
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}

.client-company-modal-footer {
    padding: 0.9rem 1.25rem;
    background: #fff;
    border-top: 1px solid #e2e8f0;
    gap: 0.5rem;
}

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

.client-company-btn-save {
    font-weight: 600;
    border-radius: 10px;
    padding: 0.45rem 1.25rem;
    background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
    border: none;
    box-shadow: 0 2px 10px rgba(13, 148, 136, 0.35);
}

.client-company-btn-save:hover:not(:disabled) {
    background: linear-gradient(135deg, #0f766e 0%, #115e59 100%);
}

@media (max-width: 992px) {
    .client-companies-col-tax {
        display: none;
    }

    .client-companies-header {
        flex-direction: column;
    }
}

@media (max-width: 768px) {
    .client-companies-col-actions {
        position: sticky;
        right: 0;
        background: #fff;
    }

    .client-companies-filter-field {
        flex: 1 1 100%;
    }
}

@media (max-width: 992px) {
    .task-config-table-wrap {
        margin: 0;
        padding: 0;
    }

    .task-config-col-meta,
    .task-config-col-ptype {
        display: none;
    }
}

@media (max-width: 768px) {
    .task-config-filter-field {
        min-width: 100%;
        flex: 1 1 100%;
    }

    .task-config-cell-task {
        min-width: 160px;
    }

    .task-config-trigger {
        max-width: 8rem;
    }
}

/* Dashboard & Projects grid - consistent column alignment */
.dashboard-projects-table tbody td,
.projects-table tbody td {
    font-size: 0.9rem;
    font-family: var(--bb-font);
    color: var(--bb-dark);
}

/* Admin Quotation Config - tabs and package list */
.page-wrapper .nav-tabs .nav-link { font-weight: 500; color: var(--bb-secondary); }
.page-wrapper .nav-tabs .nav-link.active { color: var(--bb-primary); background: var(--bb-card-bg); }

/* Lead to project workflow - stepper with arrows */
.lead-workflow {
    display: flex;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 0.25rem 0;
    padding: 1rem;
    background: var(--bb-light);
    border-radius: var(--bb-radius-lg);
    border: 1px solid var(--bb-border);
}

.lead-workflow .workflow-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 7rem;
    max-width: 8.5rem;
    padding: 0.5rem 0.35rem;
    border-radius: var(--bb-radius);
    transition: background 0.2s, box-shadow 0.2s;
}

.lead-workflow .workflow-step-done {
    background: rgba(5, 150, 105, 0.12);
    border: 1px solid rgba(5, 150, 105, 0.35);
}

.lead-workflow .workflow-step-current {
    background: rgba(37, 99, 235, 0.12);
    border: 1px solid var(--bb-primary);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.lead-workflow .workflow-step-pending {
    background: var(--bb-card-bg);
    border: 1px solid var(--bb-border);
    opacity: 0.85;
}

.lead-workflow .workflow-step-circle {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    margin-bottom: 0.35rem;
}

.workflow-step-done .workflow-step-circle {
    background: var(--bb-success);
    color: #fff;
}

.workflow-step-current .workflow-step-circle {
    background: var(--bb-primary);
    color: #fff;
}

.workflow-step-pending .workflow-step-circle {
    background: var(--bb-secondary);
    color: #fff;
}

.lead-workflow .workflow-step-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
    color: var(--bb-dark);
    line-height: 1.2;
}

.lead-workflow .workflow-step-detail {
    font-size: 0.7rem;
    text-align: center;
    margin-top: 0.15rem;
}

.lead-workflow .workflow-arrow {
    align-self: center;
    padding: 0 0.25rem;
    color: var(--bb-secondary);
    font-size: 1.1rem;
    font-weight: 700;
    margin-top: -0.5rem;
}

.lead-workspace-progress {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.15rem;
    padding: 0.5rem 0.75rem;
    background: var(--bb-light, #f8f9fa);
    border-radius: 0.375rem;
}

.lead-workspace-tabs .nav-link {
    cursor: pointer;
    border: none;
    background: transparent;
}

.lead-workspace-tabs .nav-link.active {
    font-weight: 600;
}

.lead-workspace-summary .card-body {
    min-height: 3.5rem;
}

@media (max-width: 991.98px) {
    .quotation-editor-split .quotation-summary-panel,
    .quotation-editor-split .cost-summary-card {
        position: static !important;
    }
}

.quotation-summary-panel .card-body {
    font-size: 0.9rem;
}

/* Cost estimator workspace — summary, structure, add-ons */
.cost-estimator-workspace {
    margin-top: 0.25rem;
}

.cost-summary-card {
    border: 1px solid var(--bb-border);
    border-radius: var(--bb-radius-xl);
    background: #fff;
    box-shadow: var(--bb-shadow-md);
    overflow: hidden;
}

.cost-summary-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.15rem;
    background: linear-gradient(135deg, var(--pah-primary-dark) 0%, var(--pah-primary) 55%, var(--pah-primary-bright) 100%);
    color: #fff;
}

.cost-summary-header-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.18);
    font-size: 1.15rem;
    flex-shrink: 0;
}

.cost-summary-title {
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.cost-summary-subtitle {
    font-size: 0.72rem;
    opacity: 0.85;
    margin-top: 0.15rem;
}

.cost-summary-body {
    padding: 1rem 1.15rem 1.15rem;
}

.cost-summary-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.55rem;
    margin-bottom: 1rem;
}

.cost-summary-stat {
    padding: 0.55rem 0.65rem;
    border-radius: var(--bb-radius);
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.cost-summary-stat-package {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, #eff6ff 0%, #f8fafc 100%);
    border-color: rgba(37, 99, 235, 0.2);
}

.cost-summary-stat-label {
    display: block;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--bb-secondary);
    margin-bottom: 0.15rem;
}

.cost-summary-stat-value {
    display: block;
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--bb-dark);
    line-height: 1.3;
}

.cost-summary-section-title {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--bb-secondary);
    margin-bottom: 0.65rem;
}

.cost-summary-breakdown {
    padding-top: 0.25rem;
    border-top: 1px dashed #e2e8f0;
}

.cost-summary-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: var(--bb-dark);
    padding: 0.3rem 0;
}

.cost-summary-line-subtotal {
    font-weight: 700;
    padding-top: 0.45rem;
    margin-top: 0.25rem;
    border-top: 1px solid #e2e8f0;
}

.cost-summary-line-discount {
    color: var(--bb-danger);
    font-weight: 600;
}

.cost-summary-field {
    margin: 0.45rem 0;
}

.cost-summary-field-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--bb-secondary);
    margin-bottom: 0.25rem;
}

.cost-summary-input {
    border-radius: 8px;
    border-color: #e2e8f0;
    background: #f8fafc;
    font-weight: 600;
}

.cost-summary-input:focus {
    border-color: var(--bb-primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.cost-summary-grand {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding: 0.85rem 1rem;
    border-radius: var(--bb-radius-lg);
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border: 1px solid rgba(5, 150, 105, 0.25);
}

.cost-summary-grand-label {
    font-size: 0.8125rem;
    font-weight: 800;
    color: #047857;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.cost-summary-grand-value {
    font-size: 1.25rem;
    font-weight: 800;
    color: #065f46;
    letter-spacing: -0.02em;
}

/* Toolbar */
.cost-estimator-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.85rem;
    margin-bottom: 1rem;
    padding: 0.85rem 1rem;
    border-radius: var(--bb-radius-lg);
    background: linear-gradient(135deg, #f8fafc 0%, #fff 100%);
    border: 1px solid var(--bb-border);
}

.cost-estimator-toolbar-field {
    min-width: 140px;
}

.cost-estimator-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--bb-secondary);
    margin-bottom: 0.3rem;
}

.cost-estimator-select {
    min-width: 8rem;
    border-radius: 8px;
    border-color: #e2e8f0;
    font-weight: 600;
}

.cost-estimator-rate-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
    flex: 1;
    min-width: 0;
}

.cost-estimator-rate-package {
    font-size: 0.875rem;
    font-weight: 800;
    color: var(--bb-dark);
    margin-right: 0.25rem;
}

.cost-estimator-rate-chip {
    font-size: 0.72rem;
    font-weight: 700;
    color: #1d4ed8;
    background: rgba(37, 99, 235, 0.1);
    border: 1px solid rgba(37, 99, 235, 0.2);
    border-radius: 999px;
    padding: 0.25rem 0.6rem;
}

/* Collapsible sections */
.cost-estimator-section {
    border: 1px solid var(--bb-border);
    border-radius: var(--bb-radius-xl);
    background: #fff;
    box-shadow: var(--bb-shadow-sm);
    overflow: hidden;
}

.cost-estimator-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding: 0.65rem 0.85rem 0.65rem 0.65rem;
    background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
    border-bottom: 1px solid var(--bb-border-light);
}

.cost-estimator-section-toggle {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    padding: 0.35rem 0.5rem;
    text-align: left;
    cursor: pointer;
    border-radius: var(--bb-radius);
    transition: background 0.15s ease;
}

.cost-estimator-section-toggle:hover {
    background: rgba(37, 99, 235, 0.06);
}

.cost-estimator-section-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--pah-primary-bright), var(--pah-primary));
    color: #fff;
    font-size: 1rem;
    flex-shrink: 0;
}

.cost-estimator-section-title {
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--bb-dark);
    letter-spacing: -0.02em;
}

.cost-estimator-section-chevron {
    font-size: 0.8rem;
    color: var(--bb-secondary);
    margin-left: auto;
}

.cost-estimator-section-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.cost-estimator-btn-outline {
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    border-color: #cbd5e1;
    color: var(--bb-dark);
    background: #fff;
}

.cost-estimator-btn-outline:hover {
    background: #f8fafc;
    border-color: var(--bb-primary);
    color: var(--bb-primary);
}

.cost-estimator-btn-primary {
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    background: var(--bb-primary);
    border-color: var(--bb-primary);
    color: #fff;
}

.cost-estimator-btn-primary:hover {
    background: var(--bb-primary-dark);
    border-color: var(--bb-primary-dark);
    color: #fff;
}

.cost-estimator-section-body {
    padding: 0;
}

/* Data tables */
.cost-estimator-table-wrap {
    overflow-x: auto;
}

.cost-estimator-table-wrap--scroll {
    max-height: 320px;
    overflow-y: auto;
}

.cost-estimator-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
    margin: 0;
}

.cost-estimator-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 0.65rem 0.85rem;
    font-size: 0.6875rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #475569;
    background: #f1f5f9;
    border-bottom: 2px solid #e2e8f0;
    white-space: nowrap;
}

.cost-estimator-table tbody td {
    padding: 0.5rem 0.85rem;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
}

.cost-estimator-table tbody tr:hover td {
    background: #fafbff;
}

.cost-estimator-table tfoot td {
    padding: 0.55rem 0.85rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--bb-secondary);
    background: #f8fafc;
    border-top: 2px solid #e2e8f0;
}

.cost-estimator-row-label {
    font-weight: 700;
    color: var(--bb-dark);
    white-space: nowrap;
}

.cost-estimator-amount {
    font-weight: 700;
    color: #1e40af;
    white-space: nowrap;
}

.cost-estimator-foot-value {
    font-weight: 800 !important;
    color: var(--bb-dark) !important;
    font-size: 0.9rem !important;
}

.cost-estimator-input {
    border-radius: 8px;
    border-color: #e2e8f0;
    background: #fff;
    text-align: right;
    font-weight: 600;
    min-width: 90px;
    max-width: 130px;
    margin-left: auto;
}

.cost-estimator-table td:first-child .cost-estimator-input,
.cost-estimator-table--addons .cost-estimator-input {
    text-align: left;
    margin-left: 0;
    max-width: none;
    width: 100%;
}

.cost-estimator-input-unit {
    max-width: 72px;
    text-align: center;
}

.cost-estimator-input:focus {
    border-color: var(--bb-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.cost-estimator-row-active td {
    background: #fffbeb;
}

.cost-estimator-row-active:hover td {
    background: #fef3c7;
}

.cost-estimator-th-action {
    width: 44px;
}

@media (max-width: 991.98px) {
    .cost-estimator-table-wrap,
    .cost-estimator-table-wrap--scroll {
        overflow: visible;
        max-height: none;
    }

    .cost-estimator-section .card-header {
        flex-direction: column;
        align-items: stretch !important;
    }

    .cost-estimator-section-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 0.4rem;
        width: 100%;
    }

    .cost-estimator-section-actions .btn {
        flex: 1 1 auto;
        min-height: 2.35rem;
    }

    .cost-estimator-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .cost-estimator-rate-banner {
        flex-wrap: wrap;
    }

    .cost-estimator-table.rk-mobile-stack-table {
        min-width: 0 !important;
    }

    .cost-estimator-table.rk-mobile-stack-table thead {
        display: none;
    }

    .cost-estimator-table.rk-mobile-stack-table tbody tr {
        display: block;
        margin-bottom: 0.75rem;
        border: 1px solid #e2e8f0;
        border-radius: 0.5rem;
        background: #fff;
        box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
        padding: 0.35rem 0;
    }

    .cost-estimator-table.rk-mobile-stack-table tbody tr.cost-estimator-row-active {
        background: #fffbeb;
        border-color: #fde68a;
    }

    .cost-estimator-table.rk-mobile-stack-table tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 0.75rem;
        padding: 0.45rem 0.75rem;
        border: none;
        border-bottom: 1px solid #f1f5f9;
        text-align: right !important;
    }

    .cost-estimator-table.rk-mobile-stack-table tbody td:last-child {
        border-bottom: none;
    }

    .cost-estimator-table.rk-mobile-stack-table tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        font-size: 0.75rem;
        color: #64748b;
        text-align: left;
        flex: 0 0 38%;
        max-width: 38%;
    }

    .cost-estimator-table.rk-mobile-stack-table tbody td.cost-estimator-row-label {
        font-weight: 700;
        color: #0f172a;
        white-space: normal;
    }

    .cost-estimator-table.rk-mobile-stack-table tbody td > .cost-estimator-input,
    .cost-estimator-table.rk-mobile-stack-table tbody td.cost-estimator-amount {
        flex: 1 1 auto;
        min-width: 0;
        max-width: none !important;
        margin-left: 0 !important;
        width: auto;
    }

    .cost-estimator-table.rk-mobile-stack-table tbody td.text-center {
        justify-content: space-between;
    }

    .cost-estimator-table.rk-mobile-stack-table tfoot.cost-estimator-mobile-tfoot {
        display: block;
        margin-top: 0.5rem;
    }

    .cost-estimator-table.rk-mobile-stack-table tfoot.cost-estimator-mobile-tfoot tr {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 0.75rem;
        margin-bottom: 0.5rem;
        padding: 0.65rem 0.75rem;
        border: 1px solid #e2e8f0;
        border-radius: 0.5rem;
        background: #f8fafc;
    }

    .cost-estimator-table.rk-mobile-stack-table tfoot.cost-estimator-mobile-tfoot td {
        display: block;
        border: none;
        padding: 0;
        background: transparent;
        font-weight: 600;
        color: #475569;
        text-align: left !important;
    }

    .cost-estimator-table.rk-mobile-stack-table tfoot.cost-estimator-mobile-tfoot td[colspan] {
        flex: 1;
    }

    .cost-estimator-table.rk-mobile-stack-table tfoot.cost-estimator-mobile-tfoot td:not([colspan]) {
        flex: 0 0 auto;
        font-weight: 700;
        color: #0f172a;
        text-align: right !important;
    }

    .cost-estimator-table.rk-mobile-stack-table tfoot.cost-estimator-mobile-tfoot td::before {
        content: none;
    }
}

.cost-estimator-remove-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.85rem;
    height: 1.85rem;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.cost-estimator-remove-btn:hover {
    background: #fef2f2;
    color: #dc2626;
}

@media (max-width: 575.98px) {
    .cost-summary-stats {
        grid-template-columns: 1fr;
    }
    .cost-estimator-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    .cost-estimator-section-head {
        flex-direction: column;
        align-items: stretch;
    }
    .cost-estimator-section-actions {
        justify-content: flex-end;
    }
}

@media (max-width: 992px) {
    .lead-workflow {
        flex-direction: column;
        align-items: stretch;
    }
    .lead-workflow .workflow-arrow {
        transform: rotate(90deg);
        margin: 0.1rem 0;
    }
    .lead-workflow .workflow-step {
        max-width: none;
        flex-direction: row;
        justify-content: flex-start;
        gap: 0.75rem;
        min-width: unset;
    }
    .lead-workflow .workflow-step-circle {
        margin-bottom: 0;
    }
    .lead-workflow .workflow-step-label {
        text-align: left;
    }
    .lead-workflow .workflow-step-detail {
        text-align: left;
    }
}

/* Lead detail - Customer info section (restructured, beautiful cards) */
.customer-info-section {
    --lead-card-radius: var(--bb-radius-lg);
    --lead-card-shadow: var(--bb-shadow-sm);
    --lead-card-border: 1px solid var(--bb-border);
}

.lead-detail-card {
    background: var(--bb-card-bg);
    border: var(--lead-card-border);
    border-radius: var(--lead-card-radius);
    box-shadow: var(--lead-card-shadow);
    overflow: hidden;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.lead-detail-card:hover {
    box-shadow: var(--bb-shadow);
    border-color: rgba(37, 99, 235, 0.2);
}

.lead-detail-card-customer {
    border-left: 3px solid var(--bb-primary);
}

.lead-detail-card-lead {
    border-left: 3px solid var(--bb-success);
}

.lead-detail-card-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1rem;
    background: linear-gradient(180deg, var(--bb-light) 0%, var(--bb-card-bg) 100%);
    border-bottom: 1px solid var(--bb-border);
}

.lead-detail-card-icon {
    font-size: 1.1rem;
    color: var(--bb-primary);
}

.lead-detail-card-lead .lead-detail-card-icon {
    color: var(--bb-success);
}

.lead-detail-card-title {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--bb-secondary);
}

.lead-detail-card-body {
    padding: 1rem 1.25rem;
}

.lead-detail-name {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--bb-dark);
    margin: 0 0 0.5rem 0;
    line-height: 1.3;
}

.lead-detail-subject {
    font-size: 1rem;
    font-weight: 600;
    color: var(--bb-dark);
    margin: 0 0 0.5rem 0;
    line-height: 1.35;
}

.lead-detail-meta {
    font-size: 0.875rem;
    color: var(--bb-secondary);
    margin: 0 0 0.35rem 0;
    display: flex;
    align-items: flex-start;
    gap: 0.35rem;
}

.lead-detail-meta .bi {
    flex-shrink: 0;
    margin-top: 0.15rem;
    color: var(--bb-primary);
}

.lead-detail-card-customer .lead-detail-meta .bi {
    color: var(--bb-primary);
}

.lead-detail-link {
    color: var(--bb-primary);
    text-decoration: none;
}

.lead-detail-link:hover {
    text-decoration: underline;
}

.lead-detail-description {
    padding-top: 0.5rem;
    border-top: 1px dashed var(--bb-border);
}

.lead-edit-form .form-label {
    color: var(--bb-dark);
}

@media (max-width: 991.98px) {
    .lead-detail-card-body {
        padding: 0.875rem 1rem;
    }
}

/* Create lead wizard - horizontal progress stepper */
.lead-wizard-progress {
    margin-top: 1rem;
    width: 100%;
    overflow-x: auto;
    padding-bottom: 0.25rem;
}
.lead-wizard-progress-list {
    display: flex;
    align-items: flex-start;
    list-style: none;
    margin: 0;
    padding: 0;
    min-width: min(100%, 720px);
}
.lead-wizard-progress-item {
    position: relative;
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-width: 4.5rem;
}
.lead-wizard-progress-node {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    background: #e2e8f0;
    color: #64748b;
    border: 2px solid #cbd5e1;
    z-index: 1;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.lead-wizard-progress-item.is-current .lead-wizard-progress-node {
    background: var(--bb-primary);
    border-color: var(--bb-primary);
    color: #fff;
    box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.2);
}
.lead-wizard-progress-item.is-done .lead-wizard-progress-node {
    background: #198754;
    border-color: #198754;
    color: #fff;
}
.lead-wizard-progress-label {
    font-size: 0.7rem;
    color: #64748b;
    margin-top: 0.35rem;
    line-height: 1.2;
    max-width: 5.5rem;
}
.lead-wizard-progress-item.is-current .lead-wizard-progress-label {
    color: var(--bb-primary);
    font-weight: 600;
}
.lead-wizard-progress-item.is-done .lead-wizard-progress-label {
    color: #198754;
}
.lead-wizard-progress-connector {
    position: absolute;
    top: 1rem;
    left: calc(50% + 1rem);
    width: calc(100% - 2rem);
    height: 2px;
    background: #e2e8f0;
    z-index: 0;
}
.lead-wizard-progress-connector.is-done {
    background: #198754;
}
.create-lead-step-banner {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, #eff6ff 0%, #f8fafc 100%);
    border: 1px solid #dbeafe;
    border-radius: var(--bb-radius-lg);
    border-left: 4px solid var(--bb-primary);
}
.create-lead-step-banner-num {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: var(--bb-primary);
    color: #fff;
    font-weight: 700;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.create-lead-step-banner-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--bb-dark);
}
.create-lead-step-banner-subtitle {
    font-size: 0.85rem;
    color: var(--bb-secondary);
}
.floor-wise-estimator .card-header {
    background: #fff;
}
.lead-flow-cta {
    border-left: 3px solid var(--bb-primary);
}

/* Create lead - card header (Back to Leads on right, title prominent) */
.create-lead-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid var(--bb-border);
    padding: 1rem 1.25rem;
}

.create-lead-card-header-left {
    flex: 1;
    min-width: 0;
}

.create-lead-card-header-right {
    flex-shrink: 0;
}

.create-lead-card-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--bb-dark);
    letter-spacing: -0.02em;
}

.create-lead-card-subtitle {
    font-size: 0.85rem;
    color: var(--bb-secondary);
}

/* Create lead - Step 1 Customer information (redesigned) */
.create-lead-step1 {
    width: 100%;
}

.create-lead-step1-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.create-lead-step1-header-text {
    flex: 1;
    min-width: 0;
}

.create-lead-step1-icon {
    font-size: 2rem;
    color: var(--bb-primary);
    flex-shrink: 0;
}

.create-lead-step1-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--bb-dark);
    letter-spacing: -0.02em;
}

.create-lead-step1-subtitle {
    font-size: 0.9rem;
    color: var(--bb-secondary);
}

.create-lead-contact-card {
    background: var(--bb-card-bg);
    border: 1px solid var(--bb-border);
    border-radius: var(--bb-radius-lg);
    box-shadow: var(--bb-shadow-sm);
    overflow: hidden;
    margin-bottom: 0.65rem;
    border-left: 3px solid var(--bb-primary);
    transition: box-shadow 0.2s ease;
}

.create-lead-contact-card:hover {
    box-shadow: var(--bb-shadow);
}

.create-lead-contact-card-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.85rem;
    background: linear-gradient(180deg, var(--bb-light) 0%, var(--bb-card-bg) 100%);
    border-bottom: 1px solid var(--bb-border);
}

.create-lead-contact-card-icon {
    font-size: 1.25rem;
    color: var(--bb-primary);
}

.create-lead-contact-card-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--bb-dark);
}

.create-lead-contact-card-body {
    padding: 0.65rem 0.85rem;
}

.create-lead-field-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--bb-dark);
}

.create-lead-optional {
    font-weight: 400;
    color: var(--bb-secondary);
}

.create-lead-add-contact {
    padding: 0.5rem 1rem;
}

/* Create lead - Inquiry details card (property type, source) */
.create-lead-inquiry-card {
    background: var(--bb-card-bg);
    border: 1px solid var(--bb-border);
    border-radius: var(--bb-radius-lg);
    box-shadow: var(--bb-shadow-sm);
    overflow: hidden;
    margin-top: 0.65rem;
    border-left: 3px solid var(--bb-success);
    transition: box-shadow 0.2s ease;
}

.create-lead-inquiry-card:hover {
    box-shadow: var(--bb-shadow);
}

.create-lead-inquiry-card-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.85rem;
    background: linear-gradient(180deg, var(--bb-light) 0%, var(--bb-card-bg) 100%);
    border-bottom: 1px solid var(--bb-border);
}

.create-lead-inquiry-card-icon {
    font-size: 1.25rem;
    color: var(--bb-success);
}

.create-lead-inquiry-card-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--bb-dark);
}

.create-lead-inquiry-card-body {
    padding: 0.65rem 0.85rem;
}

@media (max-width: 575.98px) {
    .create-lead-step1-header {
        flex-direction: column;
    }
}

/* Labor on Site - ProjectProgress daily report */
.labor-section {
    background: var(--bb-card-bg);
    border: 1px solid var(--bb-border);
    border-radius: var(--bb-radius-lg);
    padding: 1.25rem 1.5rem;
    box-shadow: var(--bb-shadow-sm);
}
.labor-section-header {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--bb-border);
}
.labor-section-icon {
    font-size: 1.5rem;
    color: var(--bb-primary);
    flex-shrink: 0;
}
.labor-section-title {
    font-weight: 600;
    font-size: 1rem;
    color: var(--bb-dark);
    margin: 0;
    display: block;
}
.labor-section-hint {
    font-size: 0.8rem;
    color: var(--bb-secondary);
    margin: 0.25rem 0 0 0;
}
.labor-table-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}
.labor-table-header {
    display: grid;
    grid-template-columns: 70px 80px 60px 100px 110px 95px 1fr 44px;
    gap: 0.5rem;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: linear-gradient(180deg, var(--bb-light) 0%, #f1f5f9 100%);
    border-radius: var(--bb-radius);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--bb-secondary);
}
.labor-table-row {
    display: grid;
    grid-template-columns: 70px 80px 60px 100px 110px 95px 1fr 44px;
    gap: 0.5rem;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: #fff;
    border: 1px solid var(--bb-border);
    border-radius: var(--bb-radius);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.labor-table-row:hover {
    border-color: var(--bb-primary);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}
.labor-cell {
    min-width: 0;
}
.labor-cell-readonly {
    display: flex;
    align-items: center;
}
.labor-input {
    width: 100%;
    padding: 0.4rem 0.5rem;
    font-size: 0.875rem;
    border: 1px solid var(--bb-border);
    border-radius: 0.375rem;
    transition: border-color 0.2s;
}
.labor-input:focus {
    outline: none;
    border-color: var(--bb-primary);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}
.labor-total-badge {
    display: inline-block;
    padding: 0.35rem 0.6rem;
    background: linear-gradient(135deg, var(--pah-primary-bright) 0%, var(--pah-primary-dark) 100%);
    color: #fff;
    font-weight: 600;
    font-size: 0.875rem;
    border-radius: 0.375rem;
}
.labor-cost-badge {
    display: inline-block;
    padding: 0.35rem 0.6rem;
    background: linear-gradient(135deg, var(--bb-success) 0%, #047857 100%);
    color: #fff;
    font-weight: 600;
    font-size: 0.8rem;
    border-radius: 0.375rem;
}
.labor-remove-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid var(--bb-border);
    background: #fff;
    color: var(--bb-danger);
    border-radius: 0.375rem;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}
.labor-remove-btn:hover {
    background: rgba(220, 38, 38, 0.08);
    border-color: var(--bb-danger);
}
.labor-add-btn {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--bb-primary);
    background: transparent;
    border: 1px dashed var(--bb-primary);
    border-radius: var(--bb-radius);
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}
.labor-add-btn:hover {
    background: rgba(37, 99, 235, 0.08);
    color: var(--bb-primary-dark);
}
.labor-error-msg {
    font-size: 0.8rem;
    color: var(--bb-danger);
    margin-top: 0.5rem;
}

/* Material used today - ProjectProgress daily report */
.material-section {
    background: var(--bb-card-bg);
    border: 1px solid var(--bb-border);
    border-radius: var(--bb-radius-lg);
    padding: 1.25rem 1.5rem;
    box-shadow: var(--bb-shadow-sm);
}
.material-section-header {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--bb-border);
}
.material-section-icon {
    font-size: 1.5rem;
    color: var(--bb-success);
    flex-shrink: 0;
}
.material-section-title {
    font-weight: 600;
    font-size: 1rem;
    color: var(--bb-dark);
    margin: 0;
    display: block;
}
.material-section-hint {
    font-size: 0.8rem;
    color: var(--bb-secondary);
    margin: 0.25rem 0 0 0;
}

/* Leads flow — aligned with Plan A Home brand theme */
.leads-flow-page {
    --leads-primary: var(--pah-primary-bright);
    --leads-primary-dark: var(--pah-primary-dark);
    --leads-accent: var(--bb-warning);
}

.leads-flow-page .page-header {
    padding: 1rem 1.25rem;
    border: 1px solid var(--pah-border);
    border-radius: 14px;
    background: linear-gradient(135deg, var(--pah-surface-tint) 0%, #ffffff 55%, #f0fdf9 100%);
    box-shadow: var(--bb-shadow);
}

.leads-kpi-card {
    border-radius: 12px;
    border: 1px solid var(--pah-border);
    background: linear-gradient(180deg, #ffffff 0%, var(--pah-surface-tint) 100%);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.leads-kpi-card:hover {
    transform: translateY(-2px);
    border-color: rgba(0, 169, 157, 0.35);
    box-shadow: 0 10px 20px rgba(0, 105, 92, 0.12);
}

.leads-kpi-converted {
    background: linear-gradient(180deg, #ffffff 0%, #f0fdf9 100%);
}

.leads-main-card {
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--pah-border);
    box-shadow: var(--bb-shadow-md);
}

.leads-flow-page .card-header {
    background: #fff;
}

.leads-flow-page .form-control:focus,
.leads-flow-page .form-select:focus {
    border-color: var(--pah-primary-bright);
    box-shadow: 0 0 0 0.2rem rgba(0, 169, 157, 0.25);
}

.leads-pipeline-wrap {
    background: linear-gradient(180deg, var(--pah-surface-tint) 0%, #ecfdf8 100%) !important;
}

.leads-pipeline-column {
    border: 1px solid var(--pah-border);
    border-radius: 12px;
    overflow: hidden;
}

.leads-pipeline-column-header {
    background: linear-gradient(90deg, #ffffff 0%, var(--pah-surface-tint) 100%);
    border-bottom: 1px solid var(--pah-border);
}

.leads-pipeline-column .badge {
    background: var(--pah-primary) !important;
}

.leads-pipeline-item {
    border-color: var(--pah-border) !important;
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.leads-pipeline-item:hover {
    transform: translateY(-1px);
    border-color: rgba(0, 169, 157, 0.4) !important;
    box-shadow: 0 8px 16px rgba(0, 105, 92, 0.12);
}

.leads-flow-page .table thead th {
    background: var(--pah-surface-tint);
    border-bottom-color: var(--pah-border);
    color: var(--pah-text-body) !important;
    font-weight: 700;
}

.leads-flow-page .table tbody tr {
    transition: background-color 0.14s ease, box-shadow 0.14s ease;
}

.leads-flow-page .table.table-hover tbody tr:hover {
    background: #f0fdf9;
    box-shadow: inset 3px 0 0 var(--pah-primary-bright);
}

.leads-flow-page .badge.bg-primary {
    background: linear-gradient(135deg, var(--pah-primary-bright) 0%, var(--pah-primary-dark) 100%) !important;
}

.leads-flow-page .badge.bg-success {
    background: linear-gradient(135deg, #15a34a 0%, #0b8f3e 100%) !important;
}

.leads-flow-page .badge.bg-warning {
    background: linear-gradient(135deg, #f59e0b 0%, var(--bb-warning) 100%) !important;
}

.leads-flow-page .btn-primary {
    background: linear-gradient(180deg, var(--bb-primary) 0%, var(--bb-primary-dark) 100%);
    border-color: var(--pah-primary-dark);
}

.leads-flow-page .btn-primary:hover {
    background: linear-gradient(180deg, var(--pah-primary) 0%, var(--pah-primary-dark) 100%);
    border-color: var(--pah-primary-dark);
}

.leads-flow-page .btn-outline-primary {
    border-color: var(--pah-primary);
    color: var(--pah-primary);
}

.leads-flow-page .btn-outline-primary:hover {
    background: var(--pah-primary);
    border-color: var(--pah-primary);
    color: #fff;
}

.leads-mobile-cards {
    padding: 0.75rem;
}

.leads-mobile-card .admin-grid-mobile-card-title {
    color: var(--leads-primary);
}

.leads-mobile-card .admin-grid-mobile-card-title:hover {
    color: var(--leads-primary-dark);
}

@media (max-width: 991.98px) {
    .leads-flow-page .page-header {
        flex-direction: column;
        align-items: stretch !important;
        gap: 0.85rem;
    }

    .leads-flow-page .page-header-content {
        width: 100%;
    }

    .leads-page-actions {
        width: 100%;
    }

    .leads-page-actions .btn {
        flex: 1 1 calc(50% - 0.35rem);
        min-height: 2.5rem;
    }

    .leads-main-card .card-header .row > [class*="col-"] {
        width: 100%;
    }

    .leads-kpi-row .leads-kpi-card .fs-4 {
        font-size: 1.35rem !important;
    }
}

/* Create lead workspace — compact fields & tighter vertical rhythm */
/* Lead wizard — full page (create / edit / view) */
.create-lead-standalone {
    max-width: 1280px;
    margin-left: auto;
    margin-right: auto;
}

.create-lead-standalone-header {
    border-bottom: 1px solid var(--bb-border);
    padding-bottom: 1rem;
}

.create-lead-page--standalone {
    max-width: 100%;
    font-size: 0.875rem;
}

.create-lead-page--standalone .create-lead-card {
    max-width: none;
}

.create-lead-page {
    max-width: 100%;
    font-size: 0.875rem;
}

.create-lead-page .create-lead-card {
    border: 1px solid #e4eaf6;
    border-radius: 14px;
    overflow: hidden;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}

.create-lead-card-body {
    padding: 0.85rem 1rem 1rem 1rem !important;
}

.create-lead-layout-row {
    align-items: flex-start;
}

.create-lead-single-flow {
    max-width: 1180px;
    margin: 0 auto;
}

.create-lead-modules-col {
    position: sticky;
    top: 84px;
    align-self: flex-start;
}

.create-lead-modules-card {
    border: 1px solid var(--pah-border);
    border-radius: 12px;
    overflow: hidden;
}

.create-lead-modules-header {
    background: linear-gradient(90deg, var(--pah-surface-tint) 0%, #ecfdf8 100%) !important;
    border-bottom: 1px solid var(--pah-border) !important;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.create-lead-module-item {
    border: 0 !important;
    border-bottom: 1px solid var(--pah-border) !important;
    min-height: 46px;
    font-size: 0.86rem;
}

.create-lead-module-item.active {
    background: linear-gradient(90deg, var(--pah-primary-bright) 0%, var(--pah-primary-dark) 100%) !important;
    color: #fff !important;
}

.create-lead-module-item.active .bi {
    color: #fff;
}

.create-lead-module-item:not(.active):hover:not(:disabled) {
    background: var(--pah-surface-tint);
}

.create-lead-content-col {
    padding-left: 0.5rem;
}

.create-lead-page .create-lead-contact-card,
.create-lead-page .create-lead-inquiry-card,
.create-lead-page .lead-flow-cta {
    border-radius: 10px;
    margin-bottom: 0.65rem;
}

.create-lead-page .create-lead-contact-card-body,
.create-lead-page .create-lead-inquiry-card-body {
    padding: 0.65rem 0.85rem;
}

.create-lead-page .lead-step-quotation,
.create-lead-page .lead-step-token,
.create-lead-page .lead-step-payment-schedule,
.create-lead-page .lead-step-drawing,
.create-lead-page .lead-step-agreement,
.create-lead-page .lead-step-convert {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px dashed #d8e0f2;
}

.create-lead-single-actions {
    position: sticky;
    bottom: 0;
    background: #fff;
    z-index: 5;
    padding-bottom: 0.5rem;
}

.create-lead-section {
    border: 1px solid #dfe7f7;
    border-radius: 10px;
    background: #fff;
    margin-bottom: 0.75rem;
    padding: 0.65rem 0.75rem;
}

.create-lead-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.45rem;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid #ebf0fb;
}

.create-lead-section-header h5 {
    font-size: 0.92rem;
    font-weight: 700;
    color: #1f3f8a;
}

.create-lead-subsection-title {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #5b6782;
    margin-bottom: 0.35rem;
}

.create-lead-subsection-title.mt-3 {
    margin-top: 0.5rem !important;
}

.create-lead-site-panel {
    background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
    border: 1px solid #e2e8f0;
    border-radius: 0.4rem;
    padding: 0.5rem 0.65rem 0.55rem;
    margin-top: 0.15rem;
}

.create-lead-page .create-lead-compact-row {
    --bs-gutter-y: 0.35rem;
    --bs-gutter-x: 0.55rem;
}

.create-lead-page .create-lead-site-panel .form-control-sm,
.create-lead-page .create-lead-site-panel .form-select-sm {
    min-height: 28px;
    padding: 0.15rem 0.4rem;
    font-size: 0.8rem;
}

.create-lead-page .create-lead-inquiry-card-body .form-select-sm,
.create-lead-page .create-lead-inquiry-card-body .form-control-sm {
    min-height: 28px;
    padding: 0.15rem 0.4rem;
    font-size: 0.8rem;
}

.create-lead-page--readonly .create-lead-readonly-fieldset {
    min-width: 0;
}

.create-lead-page--readonly .create-lead-readonly-fieldset:disabled {
    opacity: 1;
}

.create-lead-page--readonly .create-lead-readonly-fieldset:disabled .form-control,
.create-lead-page--readonly .create-lead-readonly-fieldset:disabled .form-select,
.create-lead-page--readonly .create-lead-readonly-fieldset:disabled textarea {
    background-color: #f8fafc;
    color: #334155;
    border-color: #e2e8f0;
    cursor: default;
}

.create-lead-page--readonly .create-lead-readonly-fieldset:disabled a[href] {
    pointer-events: auto;
}

.create-lead-page .create-lead-field-label,
.create-lead-page .form-label {
    display: block;
    min-height: unset;
    margin-bottom: 0.15rem;
    font-size: 0.75rem;
    line-height: 1.25;
}

.create-lead-page .form-control,
.create-lead-page .form-select {
    min-height: 30px;
    padding: 0.2rem 0.45rem;
    font-size: 0.8125rem;
    line-height: 1.35;
    border-radius: 0.3rem;
}

.create-lead-page textarea.form-control {
    min-height: 48px;
    padding: 0.25rem 0.45rem;
}

.create-lead-page .row {
    --bs-gutter-y: 0.4rem;
    --bs-gutter-x: 0.6rem;
}

.create-lead-page .card.mb-4,
.create-lead-page .card.mb-3 {
    margin-bottom: 0.65rem !important;
}

.create-lead-page .card-body {
    padding: 0.65rem 0.85rem;
}

.create-lead-page .card-header {
    padding: 0.4rem 0.85rem;
    font-size: 0.85rem;
}

.create-lead-page .lead-step-quotation h6,
.create-lead-page .lead-step-token h6,
.create-lead-page .lead-step-drawing h6 {
    font-size: 0.9rem;
    margin-bottom: 0.5rem !important;
    padding-bottom: 0.35rem !important;
}

.create-lead-page .lead-step-subtitle {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 1rem !important;
    padding-bottom: 0.5rem !important;
}

/* Step 3 — Token and payment plan */
.create-lead-page .lead-step-token {
    margin-top: 0.5rem;
    padding-top: 0;
    border-top: none;
}

.create-lead-page .lead-step-token .card {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
    overflow: hidden;
}

.create-lead-page .lead-step-token .card-header {
    background: #f8f9fa;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.85rem;
    font-weight: 700;
    color: #1e293b;
}

.create-lead-page .lead-step-token .card-header strong {
    font-weight: 700;
}

.create-lead-page .lead-token-agreement-card,
.create-lead-page .lead-token-plan-card,
.create-lead-page .lead-token-payment-card {
    margin-bottom: 1rem !important;
}

.create-lead-page .lead-token-summary-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem 1.25rem;
}

.create-lead-page .lead-token-summary-item {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.create-lead-page .lead-token-summary-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #64748b;
}

.create-lead-page .lead-token-summary-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: #0f172a;
    line-height: 1.35;
}

.create-lead-page .lead-token-form-grid {
    --bs-gutter-y: 1rem;
    --bs-gutter-x: 1rem;
}

.create-lead-page .lead-token-field-hint {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.75rem;
    line-height: 1.4;
    color: #64748b;
}

.create-lead-page .lead-step-token .form-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.35rem;
}

.create-lead-page .lead-step-token .form-control,
.create-lead-page .lead-step-token .form-select {
    min-height: 38px;
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    border-radius: 0.375rem;
    border-color: #dee2e6;
    background: #fff;
}

.create-lead-page .lead-step-token .form-control:focus,
.create-lead-page .lead-step-token .form-select:focus {
    border-color: var(--pah-primary-bright);
    box-shadow: 0 0 0 0.2rem rgba(0, 169, 157, 0.25);
}

.create-lead-page .lead-step-token .form-control::placeholder {
    color: #94a3b8;
}

.create-lead-page .lead-step-token .card-body {
    padding: 1rem 1.15rem;
}

.create-lead-page .lead-step-token .alert-warning {
    border-radius: 8px;
    border-color: #fde68a;
    background: #fffbeb;
}

.create-lead-page .create-lead-wizard-footer {
    margin-top: 1.25rem !important;
    padding-top: 1rem !important;
    border-top: 1px solid #e2e8f0 !important;
    background: #fff;
}

.create-lead-page .create-lead-wizard-footer .btn-primary {
    min-width: 5.5rem;
}

/* Step 4 — Payment schedule */
.create-lead-page .lead-step-payment-schedule {
    margin-top: 0.5rem;
    padding-top: 0;
    border-top: none;
}

.create-lead-page .lead-step-payment-schedule .card {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
    overflow: hidden;
}

.create-lead-page .lead-step-payment-schedule .card-header {
    background: #f8f9fa;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.85rem;
    font-weight: 700;
    color: #1e293b;
}

.create-lead-page .lead-step-payment-schedule .card-body {
    padding: 1rem 1.15rem;
}

.create-lead-page .lead-payment-stages-wrap {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}

.create-lead-page .lead-payment-stages-table {
    margin-bottom: 0;
    font-size: 0.8125rem;
}

.create-lead-page .lead-payment-stages-table thead th {
    background: #f8f9fa;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #475569;
    border-bottom: 1px solid #e2e8f0;
    padding: 0.55rem 0.75rem;
    vertical-align: middle;
}

.create-lead-page .lead-payment-stages-table tbody td {
    border-color: #f1f5f9;
    padding: 0.45rem 0.6rem;
    vertical-align: middle;
}

.create-lead-page .lead-payment-stages-table tbody tr:hover td {
    background: #f8fafc;
}

.create-lead-page .lead-payment-th-percent {
    width: 90px;
}

.create-lead-page .lead-payment-th-amount {
    width: 140px;
}

.create-lead-page .lead-payment-th-action {
    width: 48px;
}

.create-lead-page .lead-payment-stage-input {
    min-height: 32px;
    padding: 0.25rem 0.5rem;
    font-size: 0.8125rem;
    border-radius: 0.375rem;
    border-color: #dee2e6;
}

.create-lead-page .lead-payment-stage-input:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.15rem rgba(13, 110, 253, 0.12);
}

.create-lead-page .lead-payment-stage-input--percent {
    max-width: 80px;
    margin-left: auto;
}

.create-lead-page .lead-payment-stage-input--amount {
    max-width: 130px;
    margin-left: auto;
}

.create-lead-page .lead-payment-remove-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: 1px solid #fecaca;
    border-radius: 0.375rem;
    background: #fff;
    color: #dc2626;
    line-height: 1;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.create-lead-page .lead-payment-remove-btn:hover {
    background: #fef2f2;
    border-color: #f87171;
    color: #b91c1c;
}

.create-lead-page .lead-payment-add-stage-btn {
    border-radius: 0.375rem;
    font-weight: 600;
}

.create-lead-page .lead-step-payment-schedule .alert-danger {
    border-radius: 8px;
}

@media (max-width: 991.98px) {
    .create-lead-page .lead-step-payment-schedule .card-body {
        padding: 0.85rem;
    }

    .create-lead-page .lead-step-payment-schedule .card-header {
        flex-direction: column;
        align-items: stretch !important;
        gap: 0.5rem;
    }

    .create-lead-page .lead-step-payment-schedule .card-header .btn {
        width: 100%;
    }

    .create-lead-page .lead-payment-stages-wrap {
        overflow: visible;
        border: none;
        border-radius: 0;
    }

    .create-lead-page .lead-payment-stages-table.rk-mobile-stack-table {
        min-width: 0 !important;
    }

    .create-lead-page .lead-payment-stages-table.rk-mobile-stack-table thead {
        display: none;
    }

    .create-lead-page .lead-payment-stages-table.rk-mobile-stack-table tbody tr {
        display: block;
        margin-bottom: 0.75rem;
        border: 1px solid #e2e8f0;
        border-radius: 0.5rem;
        background: #fff;
        box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
        padding: 0.35rem 0;
    }

    .create-lead-page .lead-payment-stages-table.rk-mobile-stack-table tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 0.75rem;
        padding: 0.45rem 0.75rem;
        border: none;
        border-bottom: 1px solid #f1f5f9;
        text-align: right !important;
    }

    .create-lead-page .lead-payment-stages-table.rk-mobile-stack-table tbody td:last-child {
        border-bottom: none;
    }

    .create-lead-page .lead-payment-stages-table.rk-mobile-stack-table tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        font-size: 0.75rem;
        color: #64748b;
        text-align: left;
        flex: 0 0 38%;
        max-width: 38%;
    }

    .create-lead-page .lead-payment-stages-table.rk-mobile-stack-table tbody td {
        align-items: center;
    }

    .create-lead-page .lead-payment-stages-table.rk-mobile-stack-table tbody td > .lead-payment-stage-input {
        flex: 1 1 auto;
        min-width: 0;
        max-width: none !important;
        margin-left: 0 !important;
        width: 100%;
    }

    .create-lead-page .lead-payment-stages-table.rk-mobile-stack-table tbody td.text-center {
        justify-content: space-between;
    }

    .create-lead-page .lead-payment-stages-table.rk-mobile-stack-table tbody td.text-center .lead-payment-remove-btn {
        min-height: 2.35rem;
        min-width: 2.35rem;
    }

    .create-lead-page .lead-payment-add-stage-btn {
        width: 100%;
        min-height: 2.5rem;
    }

    .create-lead-page .lead-token-summary-row {
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }

    .create-lead-standalone-header.page-header {
        flex-direction: column;
        align-items: stretch !important;
        gap: 0.75rem;
    }

    .create-lead-standalone-header .d-flex.flex-wrap {
        width: 100%;
    }

    .create-lead-standalone-header .d-flex.flex-wrap .btn {
        flex: 1 1 calc(50% - 0.35rem);
        min-height: 2.4rem;
    }

    .create-lead-section-header {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 0.35rem;
    }

    .create-lead-customer-type-group {
        display: flex;
        flex-wrap: wrap;
    }

    .create-lead-customer-type-group .btn {
        flex: 1 1 auto;
        min-height: 2.35rem;
    }

    .create-lead-contact-card-header {
        flex-wrap: wrap;
        gap: 0.35rem;
    }

    .create-lead-wizard-footer {
        flex-direction: column;
        align-items: stretch !important;
        gap: 0.65rem;
    }

    .create-lead-wizard-step-indicator {
        order: -1;
        width: 100%;
        text-align: center;
        padding: 0.35rem 0.5rem;
        background: #f8fafc;
        border: 1px solid #e2e8f0;
        border-radius: 0.5rem;
        font-weight: 600;
        color: #475569 !important;
    }

    .create-lead-wizard-footer .d-flex.flex-wrap.ms-auto {
        margin-left: 0 !important;
        width: 100%;
    }

    .create-lead-wizard-footer .d-flex.flex-wrap.ms-auto .btn,
    .create-lead-wizard-prev {
        flex: 1 1 calc(50% - 0.35rem);
        min-height: 2.5rem;
    }

    .create-lead-page .lead-step-quotation .card-header,
    .create-lead-page .lead-token-agreement-card .card-header,
    .create-lead-page .lead-agreement-actions-card .card-header,
    .package-inclusions-matrix .card-header {
        flex-direction: column;
        align-items: stretch !important;
        gap: 0.5rem;
    }

    .create-lead-page .lead-token-agreement-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 0.4rem;
        width: 100%;
    }

    .create-lead-page .lead-token-agreement-actions .btn,
    .create-lead-page .lead-token-agreement-actions .badge {
        flex: 1 1 auto;
        min-height: 2.35rem;
        white-space: normal;
        text-align: center;
    }

    .create-lead-page .lead-saved-proposals-wrap {
        overflow: visible;
        border: none;
    }

    .create-lead-page .lead-saved-proposals-table.rk-mobile-stack-table {
        min-width: 0 !important;
    }

    .create-lead-page .lead-saved-proposals-table.rk-mobile-stack-table thead {
        display: none;
    }

    .create-lead-page .lead-saved-proposals-table.rk-mobile-stack-table tbody tr {
        display: block;
        margin-bottom: 0.75rem;
        border: 1px solid #e2e8f0;
        border-radius: 0.5rem;
        background: #fff;
        box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
        padding: 0.35rem 0;
    }

    .create-lead-page .lead-saved-proposals-table.rk-mobile-stack-table tbody tr.table-success {
        background: #f0fdf4;
        border-color: #bbf7d0;
    }

    .create-lead-page .lead-saved-proposals-table.rk-mobile-stack-table tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 0.75rem;
        padding: 0.45rem 0.75rem;
        border: none;
        border-bottom: 1px solid #f1f5f9;
        text-align: right !important;
    }

    .create-lead-page .lead-saved-proposals-table.rk-mobile-stack-table tbody td:last-child {
        border-bottom: none;
    }

    .create-lead-page .lead-saved-proposals-table.rk-mobile-stack-table tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        font-size: 0.75rem;
        color: #64748b;
        text-align: left;
        flex: 0 0 38%;
        max-width: 38%;
    }

    .package-inclusions-matrix .card-header .d-flex {
        width: 100%;
    }

    .package-inclusions-search-wrap {
        flex: 1 1 100%;
        min-width: 0 !important;
    }

    .package-inclusions-search {
        min-width: 0 !important;
        width: 100%;
    }

    .package-inclusions-table-wrap {
        overflow: visible;
    }

    .package-inclusions-table--matrix {
        min-width: 0 !important;
    }

    .package-inclusions-table--matrix thead {
        display: none;
    }

    .package-inclusions-table--matrix tbody tr {
        display: block;
        margin-bottom: 0.75rem;
        border: 1px solid #e2e8f0;
        border-radius: 0.5rem;
        background: #fff;
        box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
        overflow: hidden;
    }

    .package-inclusions-table--matrix .pi-td-category-merged {
        display: block;
        min-width: 0;
        max-width: none;
        border: none !important;
        border-bottom: 1px solid #e2e8f0 !important;
        padding: 0.65rem 0.75rem;
        background: #f8fafc !important;
    }

    .package-inclusions-table--matrix .pi-td-package {
        display: block;
        min-width: 0;
        border: none !important;
        border-bottom: 1px dashed #e2e8f0 !important;
        padding: 0.55rem 0.75rem;
    }

    .package-inclusions-table--matrix .pi-td-package:last-child {
        border-bottom: none !important;
    }

    .package-inclusions-table--matrix .pi-td-package::before {
        content: attr(data-label);
        display: block;
        font-weight: 700;
        font-size: 0.75rem;
        color: #1d4ed8;
        margin-bottom: 0.35rem;
    }

    .lead-agreement-view-page .card-body {
        padding: 1rem !important;
    }

    .lead-agreement-view-party-card {
        height: 100%;
        padding: 0.85rem;
        border: 1px solid #e2e8f0;
        border-radius: 0.5rem;
        background: #f8fafc;
    }

    .lead-agreement-view-meta {
        word-break: break-word;
        overflow-wrap: anywhere;
    }

    .lead-activity-timeline-item {
        flex-direction: column;
        align-items: flex-start !important;
    }

    .lead-activity-timeline-date {
        white-space: normal;
    }
}

/* Agreement additional conditions rich text */
.agreement-rich-text-toolbar .btn {
    min-width: 2rem;
}

.agreement-rich-text-editor {
    min-height: 12rem;
    height: 12rem;
    max-height: 24rem;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

.agreement-rich-text-editor:empty::before {
    content: attr(data-placeholder);
    color: #94a3b8;
    pointer-events: none;
}

.agreement-rich-text-editor:focus {
    border-color: var(--pah-primary-bright);
    box-shadow: 0 0 0 0.2rem rgba(0, 169, 157, 0.25);
    outline: 0;
}

.agreement-rich-text--disabled .agreement-rich-text-editor {
    background: #f8fafc;
}

.agreement-additional-readonly {
    font-size: 0.9rem;
    line-height: 1.5;
    color: #334155;
}

.agreement-additional-readonly ul {
    margin-bottom: 0.5rem;
    padding-left: 1.25rem;
}

.lead-agreement-additional-card .card-body {
    padding: 0.85rem 1rem 1rem;
}

/* Step 5 — Agreement and signature */
.create-lead-page .lead-step-agreement {
    margin-top: 0.5rem;
    padding-top: 0;
    border-top: none;
}

.create-lead-page .lead-step-agreement .card {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
    overflow: hidden;
}

.create-lead-page .lead-step-agreement .card-header {
    background: #f8f9fa;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.85rem;
    font-weight: 700;
    color: #1e293b;
}

.create-lead-page .lead-step-agreement .card-body {
    padding: 1rem 1.15rem;
}

.create-lead-page .lead-agreement-preview-body {
    padding-top: 0.85rem !important;
}

.create-lead-page .lead-agreement-preview-section {
    margin-bottom: 1.25rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid #f1f5f9;
}

.create-lead-page .lead-agreement-preview-section:last-child,
.create-lead-page .lead-agreement-preview-section.mb-0 {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.create-lead-page .lead-agreement-section-title {
    font-size: 0.8125rem;
    font-weight: 700;
    color: #1e40af;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 0.65rem;
}

.create-lead-page .lead-agreement-table-wrap {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}

.create-lead-page .lead-agreement-info-table th {
    width: 180px;
    background: #f8f9fa;
    font-size: 0.75rem;
    font-weight: 700;
    color: #475569;
    border-color: #e2e8f0;
    padding: 0.55rem 0.75rem;
    vertical-align: middle;
}

.create-lead-page .lead-agreement-info-table td {
    font-size: 0.8125rem;
    color: #0f172a;
    border-color: #f1f5f9;
    padding: 0.55rem 0.75rem;
    vertical-align: middle;
}

.create-lead-page .lead-agreement-cost-table thead th {
    background: #f8f9fa;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #475569;
    border-bottom: 1px solid #e2e8f0;
    padding: 0.55rem 0.75rem;
    vertical-align: middle;
}

.create-lead-page .lead-agreement-cost-table tbody td {
    font-size: 0.8125rem;
    border-color: #f1f5f9;
    padding: 0.45rem 0.75rem;
    vertical-align: middle;
}

.create-lead-page .lead-agreement-cost-table tbody tr:hover td {
    background: #f8fafc;
}

.create-lead-page .lead-agreement-th-sl {
    width: 48px;
}

.create-lead-page .lead-agreement-th-num {
    width: 110px;
}

.create-lead-page .lead-agreement-cost-totals {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.65rem;
    padding: 0.75rem 0.85rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.create-lead-page .lead-agreement-cost-total-item {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.create-lead-page .lead-agreement-cost-total-item--grand {
    grid-column: 1 / -1;
    padding-top: 0.35rem;
    border-top: 1px dashed #cbd5e1;
    margin-top: 0.15rem;
}

.create-lead-page .lead-agreement-cost-total-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #64748b;
}

.create-lead-page .lead-agreement-cost-total-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: #0f172a;
}

.create-lead-page .lead-agreement-spec-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
    gap: 0.85rem 1.25rem;
}

.create-lead-page .lead-agreement-spec-group {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.65rem 0.85rem;
    min-width: 0;
}

.create-lead-page .lead-agreement-spec-category {
    font-size: 0.78rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.45rem;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid #e2e8f0;
}

.create-lead-page .lead-agreement-spec-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.create-lead-page .lead-agreement-spec-list li {
    font-size: 0.78rem;
    line-height: 1.45;
    color: #334155;
}

.create-lead-page .lead-agreement-spec-item {
    display: block;
    font-weight: 600;
    color: #0f172a;
}

.create-lead-page .lead-agreement-spec-detail {
    display: block;
    margin-top: 0.1rem;
    color: #64748b;
}

.create-lead-page .lead-agreement-terms-toggle {
    font-size: 0.85rem;
}

.create-lead-page .lead-agreement-terms-toggle strong {
    font-weight: 700;
}

.create-lead-page .lead-agreement-terms-input {
    font-size: 0.8125rem;
    border-radius: 0.375rem;
    border-color: #dee2e6;
    min-height: 120px;
}

.create-lead-page .lead-agreement-terms-input:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

/* Step 6 — Upload signed agreement */
.create-lead-page .lead-step-upload .card {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.create-lead-page .lead-step-upload .card-body {
    padding: 1rem 1.15rem;
}

.create-lead-page .lead-step-upload .form-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #334155;
}

.create-lead-page .lead-step-upload .form-control {
    min-height: 38px;
    font-size: 0.875rem;
    border-radius: 0.375rem;
    border-color: #dee2e6;
}

/* Estimation step — match token / payment plan card UI */
.lead-estimation-workspace .package-select-card {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    box-shadow: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.lead-estimation-workspace .package-select-card-accent {
    display: none;
}
.lead-estimation-workspace .package-select-card:hover {
    border-color: #93c5fd;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.08);
    transform: none;
}
.lead-estimation-workspace .package-select-card.is-selected {
    border-color: var(--bb-primary);
    border-width: 2px;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
    background: #f8fbff;
    transform: none;
}
.lead-estimation-workspace .package-select-card.is-compare:not(.is-selected) {
    outline: 2px dashed #94a3b8;
    outline-offset: 2px;
}
.lead-estimation-workspace .package-select-icon-wrap {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 8px;
    background: #eff6ff;
    border: 1px solid #dbeafe;
    margin-bottom: 0.5rem;
}
.lead-estimation-workspace .package-select-icon {
    font-size: 1rem;
    color: var(--bb-primary);
}
.lead-estimation-workspace .package-select-badge {
    background: var(--bb-primary);
    color: #fff;
    box-shadow: none;
}
.lead-estimation-workspace .package-select-card-foot {
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}
.lead-estimation-workspace .package-inclusions-matrix .card-header {
    font-size: 0.85rem;
}
.lead-estimation-workspace .package-inclusions-table thead th {
    background: #f8f9fa !important;
    color: #475569;
    font-size: 0.75rem;
    font-weight: 700;
    border-color: #e2e8f0;
}
.lead-estimation-workspace .package-inclusions-table--matrix thead th.pi-th-package {
    background: #f8f9fa !important;
    color: #1e40af;
    border-bottom: 2px solid #dbeafe;
}
.lead-estimation-workspace .package-inclusions-table {
    border: none;
}
.lead-estimation-workspace .package-inclusions-table tbody td {
    border-color: #e2e8f0;
}
.lead-estimation-workspace .pi-category-label {
    font-weight: 700;
}
.lead-estimation-workspace .cost-summary-card {
    box-shadow: var(--bb-shadow-sm);
    border-radius: 10px;
}
.lead-estimation-workspace .cost-summary-stats {
    gap: 0.45rem;
    margin-bottom: 0.85rem;
}
.lead-estimation-workspace .cost-summary-stat {
    background: #f8fafc;
    border-color: #e2e8f0;
    padding: 0.45rem 0.55rem;
}
.lead-estimation-workspace .cost-summary-stat-package {
    background: #f1f5f9;
    border-color: #cbd5e1;
}
.lead-estimation-workspace .cost-summary-grand {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    padding: 0.65rem 0.85rem;
}
.lead-estimation-workspace .cost-summary-grand-value {
    font-size: 1.1rem;
    color: #047857;
}
.lead-estimation-workspace .cost-estimator-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.85rem;
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
    border-radius: 0;
}
.lead-estimation-workspace .cost-estimator-section {
    border: none;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
}
.lead-estimation-workspace .cost-estimator-section .card-header {
    font-size: 0.85rem;
}
.lead-estimation-workspace .cost-estimator-section-toggle {
    font-size: inherit;
}
.lead-estimation-workspace .cost-estimator-section-toggle strong {
    font-weight: 700;
}
.lead-estimation-workspace .cost-estimator-rate-chip {
    font-size: 0.72rem;
    background: #eff6ff;
    border-color: #dbeafe;
    color: #1d4ed8;
}
.lead-estimation-workspace .cost-estimator-table thead th {
    background: #f8f9fa;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: none;
    letter-spacing: normal;
    color: #475569;
    border-color: #e2e8f0;
}
.lead-estimation-workspace .cost-estimator-table tbody td {
    border-color: #f1f5f9;
    vertical-align: middle;
}
.lead-estimation-workspace .cost-estimator-input {
    border-radius: 0.375rem;
    border-color: #dee2e6;
    font-size: 0.8125rem;
}
.lead-estimation-workspace .cost-estimator-input:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}
.lead-estimation-workspace .cost-estimator-amount {
    color: var(--bb-dark);
    font-weight: 600;
}
.lead-estimation-workspace .cost-estimator-row-active td {
    background: #fffbeb;
}
.lead-estimation-workspace .package-inclusions-search {
    border-radius: 0.375rem;
    min-width: 180px;
    box-shadow: none;
}

/* Step 2 quotation — match token / payment plan step */
.create-lead-page .lead-step-quotation {
    margin-top: 0.5rem;
    padding-top: 0;
    border-top: none;
}

.create-lead-page .lead-step-quotation .lead-proposal-meta-card .form-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.35rem;
}

.create-lead-page .lead-step-quotation .lead-proposal-meta-card .form-control,
.create-lead-page .lead-step-quotation .lead-proposal-meta-card .form-select {
    min-height: 38px;
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    border-radius: 0.375rem;
    border-color: #dee2e6;
}

.create-lead-page .lead-step-quotation .lead-proposal-meta-card .form-control:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

.create-lead-page .lead-step-quotation .lead-proposal-meta-card .card-body {
    padding: 1rem 1.15rem;
}

.create-lead-page .lead-step-quotation .card {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
    overflow: hidden;
}

.create-lead-page .lead-step-quotation .card-header {
    background: #f8f9fa;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.85rem;
    font-weight: 700;
    color: #1e293b;
}

.create-lead-page .lead-saved-proposals-table thead th {
    background: #f8f9fa;
    font-size: 0.75rem;
    font-weight: 700;
    color: #475569;
    border-color: #e2e8f0;
    padding: 0.55rem 0.75rem;
}

.create-lead-page .lead-saved-proposals-table tbody td {
    border-color: #f1f5f9;
    vertical-align: middle;
    font-size: 0.8125rem;
}

.create-lead-page .lead-saved-proposals-table tbody tr:hover td {
    background: #f8fafc;
}

.create-lead-page .lead-proposal-cost-summary {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin: 0;
}

.lead-estimation-workspace .package-inclusions-table-wrap {
    border-top: none;
}

.lead-estimation-workspace .package-inclusions-table--matrix {
    border: none;
}

.lead-estimation-workspace .package-inclusions-table thead th.pi-th-category {
    background: #f8f9fa !important;
    color: #475569;
    border-color: #e2e8f0;
}

.lead-estimation-workspace .package-inclusions-table .pi-td-category-merged {
    background: #f8fafc;
    border-right: 1px solid #e2e8f0;
}

.lead-estimation-workspace .package-inclusions-data-row.inclusion-tone-0 .pi-category-label,
.lead-estimation-workspace .package-inclusions-data-row.inclusion-tone-1 .pi-category-label,
.lead-estimation-workspace .package-inclusions-data-row.inclusion-tone-2 .pi-category-label,
.lead-estimation-workspace .package-inclusions-data-row.inclusion-tone-3 .pi-category-label,
.lead-estimation-workspace .package-inclusions-data-row.inclusion-tone-4 .pi-category-label,
.lead-estimation-workspace .package-inclusions-data-row.inclusion-tone-5 .pi-category-label {
    color: #1e293b;
}

.lead-estimation-workspace .package-inclusions-table .package-inclusions-data-row:hover td {
    background: #f8fafc;
}

.lead-estimation-workspace .cost-summary-stat-package {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.lead-estimation-workspace .cost-estimator-toolbar-card .card-body.cost-estimator-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.85rem;
}

.lead-estimation-workspace > .card > .card-body .quotation-editor-split {
    margin-left: -0.25rem;
    margin-right: -0.25rem;
}

.lead-estimation-workspace .cost-summary-card {
    box-shadow: none;
    border: 1px solid #e2e8f0;
}

.create-lead-page .create-lead-card-title {
    font-size: 1.1rem;
}

.create-lead-page .create-lead-card-subtitle {
    font-size: 0.78rem;
}

.create-lead-page .create-lead-card-header {
    padding: 0.65rem 1rem;
}

.create-lead-page .create-lead-contact-card-body .row > [class*="col-"],
.create-lead-page .create-lead-inquiry-card-body .row > [class*="col-"] {
    display: flex;
    flex-direction: column;
}

@media (min-width: 1400px) {
    .create-lead-page .create-lead-card {
        margin-left: auto;
        margin-right: auto;
    }
    .create-lead-content-col {
        padding-left: 0.85rem;
    }
}

@media (max-width: 991.98px) {
    .create-lead-modules-col {
        position: static;
        top: auto;
    }
    .create-lead-content-col {
        padding-left: 0;
    }
}

/* Sales dashboard polish */
.sales-dashboard-page {
    max-width: 100%;
}

.sales-dashboard-header {
    padding: 1rem 1.2rem;
    border: 1px solid #e5ebf8;
    border-radius: 14px;
    background: linear-gradient(120deg, #f8faff 0%, #ffffff 60%, #f7fbff 100%);
}

.sales-kpi-card {
    border-radius: 12px;
    border: 1px solid #e6ecf8;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.sales-kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(30, 64, 175, 0.13);
}

.sales-insight-card {
    border-radius: 12px;
    border: 1px solid #e4eaf5;
    overflow: hidden;
}

.sales-insight-card .card-header {
    background: linear-gradient(180deg, #f8faff 0%, #f3f7ff 100%) !important;
    border-bottom: 1px solid #e0e8f8;
}

.sales-dashboard-page .table th {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #5b6782;
}

.sales-dashboard-page .table td {
    vertical-align: middle;
}
.material-table-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
    overflow-x: auto;
}
.material-table-row {
    display: grid;
    grid-template-columns: 180px 90px 100px 100px 80px 100px 130px 110px 160px 110px 110px 90px 44px;
    gap: 0.5rem;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: #fff;
    border: 1px solid var(--bb-border);
    border-radius: var(--bb-radius);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.material-table-row:hover {
    border-color: var(--bb-primary);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}
.material-cell {
    min-width: 0;
}
.material-input {
    width: 100%;
    padding: 0.4rem 0.5rem;
    font-size: 0.875rem;
    border: 1px solid var(--bb-border);
    border-radius: 0.375rem;
    transition: border-color 0.2s;
}
.material-input:focus {
    outline: none;
    border-color: var(--bb-primary);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}
.material-remove-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid var(--bb-border);
    background: #fff;
    color: var(--bb-danger);
    border-radius: 0.375rem;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}
.material-remove-btn:hover {
    background: rgba(220, 38, 38, 0.08);
    border-color: var(--bb-danger);
}
.material-add-btn {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--bb-success);
    background: transparent;
    border: 1px dashed var(--bb-success);
    border-radius: var(--bb-radius);
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}
.material-add-btn:hover {
    background: rgba(22, 163, 74, 0.08);
}

/* Equipment used today - ProjectProgress daily report */
.equipment-section {
    background: var(--bb-card-bg);
    border: 1px solid var(--bb-border);
    border-radius: var(--bb-radius-lg);
    padding: 1.25rem 1.5rem;
    box-shadow: var(--bb-shadow-sm);
}
.equipment-section-header {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--bb-border);
}
.equipment-section-icon {
    font-size: 1.5rem;
    color: var(--bb-info, #0ea5e9);
    flex-shrink: 0;
}
.equipment-section-title {
    font-weight: 600;
    font-size: 1rem;
    color: var(--bb-dark);
    margin: 0;
    display: block;
}
.equipment-section-hint {
    font-size: 0.8rem;
    color: var(--bb-secondary);
    margin: 0.25rem 0 0 0;
}
.equipment-table-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}
.equipment-table-row {
    display: grid;
    grid-template-columns: 1fr 100px 110px 44px;
    gap: 0.5rem;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: #fff;
    border: 1px solid var(--bb-border);
    border-radius: var(--bb-radius);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.equipment-table-row:hover {
    border-color: var(--bb-primary);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}
.equipment-cell {
    min-width: 0;
}
.equipment-input {
    width: 100%;
    padding: 0.4rem 0.5rem;
    font-size: 0.875rem;
    border: 1px solid var(--bb-border);
    border-radius: 0.375rem;
    transition: border-color 0.2s;
}
.equipment-input:focus {
    outline: none;
    border-color: var(--bb-primary);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}
.equipment-remove-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid var(--bb-border);
    background: #fff;
    color: var(--bb-danger);
    border-radius: 0.375rem;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}
.equipment-remove-btn:hover {
    background: rgba(220, 38, 38, 0.08);
    border-color: var(--bb-danger);
}
.equipment-add-btn {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--bb-info, #0ea5e9);
    background: transparent;
    border: 1px dashed var(--bb-info, #0ea5e9);
    border-radius: var(--bb-radius);
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}
.equipment-add-btn:hover {
    background: rgba(14, 165, 233, 0.08);
}

/* Photos & Videos - ProjectProgress daily report */
.photos-section {
    background: var(--bb-card-bg);
    border: 1px solid var(--bb-border);
    border-radius: var(--bb-radius-lg);
    padding: 1.25rem 1.5rem;
    box-shadow: var(--bb-shadow-sm);
}
.photos-section-header {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--bb-border);
}
.photos-section-icon {
    font-size: 1.5rem;
    color: var(--bb-primary);
    flex-shrink: 0;
}
.photos-section-title {
    font-weight: 600;
    font-size: 1rem;
    color: var(--bb-dark);
    margin: 0;
    display: block;
}
.photos-section-hint {
    font-size: 0.8rem;
    color: var(--bb-secondary);
    margin: 0.25rem 0 0 0;
    line-height: 1.45;
}
.photos-upload-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 1.25rem;
}
.photos-category-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.photos-category-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--bb-secondary);
    margin: 0;
}
.photos-category-select {
    min-width: 180px;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    border: 1px solid var(--bb-border);
    border-radius: var(--bb-radius);
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.photos-category-select:focus {
    outline: none;
    border-color: var(--bb-primary);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}
.photos-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}
.photos-upload-btn {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--bb-primary);
    background: transparent;
    border: 1px solid var(--bb-primary);
    border-radius: var(--bb-radius);
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}
.photos-upload-btn:hover {
    background: rgba(37, 99, 235, 0.08);
    color: var(--bb-primary-dark);
}
.photos-upload-btn-video {
    color: var(--bb-success);
    border-color: var(--bb-success);
}
.photos-upload-btn-video:hover {
    background: rgba(22, 163, 74, 0.08);
}
.photos-pending-msg {
    margin-top: 1rem;
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
    color: var(--bb-success);
    background: rgba(22, 163, 74, 0.08);
    border-radius: var(--bb-radius);
    display: inline-flex;
    align-items: center;
}

@media (max-width: 768px) {
    .material-table-row {
        grid-template-columns: 1fr;
    }
    .material-cell-name {
        grid-column: 1;
    }
    .equipment-table-row {
        grid-template-columns: 1fr 1fr 44px;
    }
    .equipment-cell-name {
        grid-column: 1 / -1;
    }
    .photos-upload-bar {
        flex-direction: column;
        align-items: stretch;
    }
    .photos-category-select {
        min-width: 100%;
    }
}

/* Issue / Risk - ProjectProgress daily report */
.issue-risk-section {
    background: var(--bb-card-bg);
    border: 1px solid var(--bb-border);
    border-radius: var(--bb-radius-lg);
    padding: 1.25rem 1.5rem;
    box-shadow: var(--bb-shadow-sm);
}

.issue-risk-header {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--bb-border);
}

.issue-risk-icon {
    font-size: 1.5rem;
    color: var(--bb-warning);
    flex-shrink: 0;
}

.issue-risk-title {
    font-weight: 600;
    font-size: 1rem;
    color: var(--bb-dark);
    margin: 0;
    display: block;
}

.issue-risk-hint {
    font-size: 0.8rem;
    color: var(--bb-secondary);
    margin: 0.25rem 0 0 0;
    line-height: 1.4;
}

.issue-risk-form {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 1.25rem;
    align-items: start;
}

.issue-risk-type-wrap,
.issue-risk-desc-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    align-self: stretch;
}

.issue-risk-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--bb-secondary);
    margin: 0;
    min-height: 1.1rem;
}

.issue-risk-select {
    border-radius: var(--bb-radius);
    border: 1px solid var(--bb-border);
    min-height: 38px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.issue-risk-select:focus {
    border-color: var(--bb-primary);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.issue-risk-textarea {
    border-radius: var(--bb-radius);
    border: 1px solid var(--bb-border);
    resize: vertical;
    min-height: 96px;
    line-height: 1.45;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.issue-risk-textarea:focus {
    border-color: var(--bb-primary);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.issue-risk-textarea::placeholder {
    color: #94a3b8;
}

@media (max-width: 768px) {
    .issue-risk-form {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}
@media (max-width: 992px) {
    .labor-table-header,
    .labor-table-row {
        grid-template-columns: 1fr 1fr 70px 1fr 1fr 90px 1fr 44px;
    }
}
@media (max-width: 768px) {
    .labor-table-header { display: none; }
    .labor-table-row {
        grid-template-columns: 1fr;
        gap: 0.75rem;
        padding: 1rem;
    }
    .labor-table-row .labor-cell::before {
        content: attr(data-label);
        font-size: 0.7rem;
        font-weight: 600;
        color: var(--bb-secondary);
        display: block;
        margin-bottom: 0.25rem;
    }
    .labor-cell-action { grid-column: 1; }
}

/* ========== Project Progress page (/project/{id}/progress) ========== */
.progress-page {
    padding: 1.25rem 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.progress-page-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.progress-back-btn {
    flex-shrink: 0;
    font-weight: 500;
}

.progress-page-title-wrap {
    flex: 1;
    min-width: 0;
}

.progress-page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--bb-dark);
    margin: 0 0 0.25rem 0;
    letter-spacing: -0.02em;
}

.progress-page-subtitle {
    font-size: 0.9rem;
    color: var(--bb-secondary);
    margin: 0;
}

/* ========== App loading indicator (PageLoadingIndicator — all pages) ========== */
.progress-loading,
.app-loading {
    --app-loading-primary: var(--pah-primary-bright, #00a99d);
    --app-loading-primary-deep: var(--pah-primary, #00897b);
    --app-loading-primary-dark: var(--pah-primary-dark, #00695c);
    --app-loading-surface: var(--pah-surface-tint, #f4feff);
    --app-loading-track: rgba(0, 137, 123, 0.12);
    --app-loading-progress: 35%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 2.75rem 1.75rem;
    min-height: 10rem;
    text-align: center;
    color: var(--pah-text-body, #334155);
    font-family: var(--bb-font, 'Poppins', sans-serif);
}

.app-loading--compact {
    gap: 0.75rem;
    padding: 2rem 1.25rem;
    min-height: 8rem;
}

.app-loading--inline {
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    text-align: left;
    gap: 1rem;
    padding: 1.25rem 1rem;
    min-height: 0;
}

.app-loading--minimal {
    gap: 0.5rem;
    padding: 1rem;
    min-height: 0;
}

.app-loading--minimal .app-loading__visual {
    width: 2.5rem;
    height: 2.5rem;
}

.app-loading--minimal .app-loading__ring {
    width: 2.5rem;
    height: 2.5rem;
}

.app-loading--minimal .app-loading__icon {
    font-size: 1.1rem;
}

.app-loading--minimal .app-loading__track {
    max-width: 10rem;
}

.app-loading__visual {
    position: relative;
    width: 4.25rem;
    height: 4.25rem;
    flex-shrink: 0;
}

.app-loading__ring {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 4.25rem;
    height: 4.25rem;
    border-radius: 50%;
    background: linear-gradient(145deg, #ffffff 0%, var(--app-loading-surface) 100%);
    box-shadow:
        0 8px 24px rgba(0, 105, 92, 0.14),
        0 0 0 1px rgba(0, 137, 123, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.app-loading__orbit {
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: conic-gradient(
        from 0deg,
        transparent 0deg,
        var(--app-loading-primary) 90deg,
        var(--app-loading-primary-bright, #00a99d) 180deg,
        transparent 270deg
    );
    animation: app-loading-orbit 1.1s linear infinite;
    opacity: 0.85;
}

.app-loading__icon {
    font-size: 1.65rem;
    color: var(--app-loading-primary-deep);
    animation: app-loading-icon-pulse 1.4s ease-in-out infinite;
}

.app-loading__content {
    width: min(100%, 22rem);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: stretch;
}

.app-loading--inline .app-loading__content {
    flex: 1;
    min-width: 0;
    width: auto;
}

.app-loading__message {
    margin: 0;
    font-family: var(--bb-font-display, 'Mulish', sans-serif);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--app-loading-primary-dark);
    line-height: 1.35;
}

.app-loading--compact .app-loading__message,
.app-loading--minimal .app-loading__message {
    font-size: 0.9rem;
}

.app-loading__track {
    position: relative;
    width: 100%;
    height: 0.45rem;
    border-radius: 999px;
    background: var(--app-loading-track);
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(0, 73, 64, 0.08);
}

.app-loading__bar {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(
        90deg,
        var(--app-loading-primary-dark) 0%,
        var(--app-loading-primary) 45%,
        var(--app-loading-primary-bright) 100%
    );
    box-shadow: 0 0 12px rgba(0, 169, 157, 0.35);
}

.app-loading__bar--indeterminate {
    width: 42%;
    animation: app-loading-bar-slide 1.35s cubic-bezier(0.45, 0.05, 0.35, 0.95) infinite;
}

.app-loading__bar--determinate {
    width: var(--app-loading-progress, 0%);
    transition: width 0.35s ease;
}

.app-loading__subtext {
    margin: 0;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--pah-text-muted, #64748b);
    letter-spacing: 0.02em;
}

@keyframes app-loading-orbit {
    to { transform: rotate(360deg); }
}

@keyframes app-loading-icon-pulse {
    0%, 100% { opacity: 0.75; transform: scale(0.94); }
    50% { opacity: 1; transform: scale(1); }
}

@keyframes app-loading-bar-slide {
    0% { transform: translateX(-120%); }
    100% { transform: translateX(320%); }
}

@media (prefers-reduced-motion: reduce) {
    .app-loading__orbit,
    .app-loading__bar--indeterminate,
    .app-loading__icon {
        animation: none;
    }
    .app-loading__bar--indeterminate {
        width: 55%;
        margin: 0 auto;
    }
}

/* Legacy hook — hide old bootstrap spinner if any page still references it */
.progress-loading-spinner {
    display: none !important;
}

.progress-tabs-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-bottom: 1.5rem;
    padding: 0.25rem;
    background: var(--bb-light);
    border-radius: var(--bb-radius-lg);
    border: 1px solid var(--bb-border);
}

.progress-tab {
    display: inline-flex;
    align-items: center;
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--bb-secondary);
    background: transparent;
    border: none;
    border-radius: var(--bb-radius);
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.progress-tab:hover {
    color: var(--bb-primary);
    background: rgba(37, 99, 235, 0.08);
}

.progress-tab.active {
    color: #fff;
    background: linear-gradient(135deg, var(--bb-primary) 0%, var(--bb-primary-dark) 100%);
    box-shadow: var(--bb-shadow-sm);
}

.progress-card {
    border-radius: var(--bb-radius-lg);
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.progress-card-header {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid var(--bb-border);
    padding: 1rem 1.25rem;
    font-size: 1rem;
    color: var(--bb-dark);
}

.progress-card-header .bi {
    color: var(--bb-primary);
}

.progress-card-subtitle {
    font-size: 0.8rem;
    color: var(--bb-secondary);
    margin: 0.5rem 0 0 0;
    line-height: 1.4;
}

.progress-card .card-body {
    padding: 1.25rem 1.5rem;
}

.progress-page-intro {
    background: #f8fafc;
    border: 1px solid var(--bb-border);
    border-radius: var(--bb-radius);
    padding: 0.65rem 0.85rem;
}

.progress-kpi-card {
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    border-color: #dbe3ef !important;
    min-height: 88px;
}

.milestone-update-row {
    border: 1px solid #dbe3ef;
    border-radius: 10px;
    background: #f8fafc;
    padding: 0.65rem;
    margin-left: 0;
    margin-right: 0;
}

.milestone-work-textarea {
    resize: vertical;
    min-height: 96px;
    line-height: 1.45;
}

.milestone-update-remove {
    min-height: 38px;
}

.milestone-field-col .form-label {
    margin-bottom: 0.35rem;
    min-height: 1.15rem;
}

.milestone-field-col select.form-select-sm {
    min-height: 38px;
}

.milestone-action-col {
    display: flex;
    align-items: flex-end;
}

/* Simplified Site ERP / Store / HR */
.erp-simple-page .erp-simple-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
}

.erp-site-select {
    max-width: 280px;
    min-width: 180px;
}

.erp-tab-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 0;
}

.erp-tab {
    border: none;
    background: transparent;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #64748b;
    border-radius: 8px 8px 0 0;
    margin-bottom: -2px;
    border-bottom: 2px solid transparent;
}

.erp-tab:hover {
    color: var(--bb-primary);
    background: #f1f5f9;
}

.erp-tab.active {
    color: var(--bb-primary);
    border-bottom-color: var(--bb-primary);
    background: #fff;
}

.erp-tab-badge {
    display: inline-block;
    min-width: 1.1rem;
    padding: 0 0.35rem;
    margin-left: 0.25rem;
    font-size: 0.7rem;
    line-height: 1.2rem;
    border-radius: 999px;
    background: var(--bb-primary);
    color: #fff;
}

.erp-pill {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.erp-pill-ok { background: #d1fae5; color: #065f46; }
.erp-pill-warn { background: #fef3c7; color: #92400e; }
.erp-pill-bad { background: #fee2e2; color: #991b1b; }

.erp-stat-row .erp-stat-card {
    background: #fff;
    border-radius: 10px;
    padding: 0.75rem 1rem;
    box-shadow: var(--bb-shadow-sm);
    border: 1px solid #e2e8f0;
}

.erp-stat-value {
    font-size: 1.35rem;
    font-weight: 700;
    color: #0f172a;
}

.erp-stat-label {
    font-size: 0.75rem;
    color: #64748b;
}

.erp-stat-warn .erp-stat-value {
    color: var(--bb-warning);
}

.erp-track-table th {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #64748b;
    font-weight: 600;
}

.erp-setup-details summary {
    cursor: pointer;
    user-select: none;
}

.site-flow-stepper {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    padding: 0.5rem 0;
}

.site-flow-step {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.65rem;
    border-radius: 8px;
    font-size: 0.8rem;
    text-decoration: none;
    color: #64748b;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
}

.site-flow-step.active {
    background: #eff6ff;
    border-color: var(--bb-primary);
    color: var(--bb-primary);
    font-weight: 600;
}

.site-flow-step.done {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #065f46;
}

.site-flow-step-num {
    display: inline-flex;
    width: 1.25rem;
    height: 1.25rem;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 0.7rem;
    background: #fff;
}

.site-flow-checklist .site-flow-check-icon {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #e2e8f0;
    font-weight: 700;
    flex-shrink: 0;
}

.site-flow-checklist .site-flow-check-icon.done {
    background: #d1fae5;
    color: #065f46;
}

.site-flow-role-card:hover {
    box-shadow: var(--bb-shadow-md);
    transform: translateY(-2px);
    transition: 0.15s ease;
}

/* Recreated Construction Progress UI */
.progress-suite-page .card,
.progress-mgmt-page .card {
    border-radius: 12px;
}

.progress-suite-header {
    margin-bottom: 1rem;
}

.progress-suite-page .card-header,
.progress-mgmt-page .card-header {
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%) !important;
}

.daily-progress-card .card-body {
    padding: 1rem 1.1rem;
}

.daily-progress-card .form-control,
.daily-progress-card .form-select {
    min-height: 38px;
}

.material-entry-card {
    border: 1px solid #dbe3ef;
    border-radius: 10px;
    background: #f8fafc;
    padding: 0.65rem;
}

.material-entry-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 0.5rem;
}

.material-cell {
    grid-column: span 2;
    min-width: 0;
}

.material-cell-material { grid-column: span 3; }
.material-cell-vendor { grid-column: span 3; }
.material-cell-datetime { grid-column: span 3; }
.material-cell-site { grid-column: span 3; }
.material-cell-remove { grid-column: span 1; }

.material-entry-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 0.2rem;
}

@media (max-width: 992px) {
    .material-entry-grid {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
    .material-cell,
    .material-cell-material,
    .material-cell-vendor,
    .material-cell-datetime,
    .material-cell-site {
        grid-column: span 3;
    }
    .material-cell-remove {
        grid-column: span 6;
    }
}

@media (max-width: 576px) {
    .material-entry-grid {
        grid-template-columns: 1fr;
    }
    .material-cell,
    .material-cell-material,
    .material-cell-vendor,
    .material-cell-datetime,
    .material-cell-site,
    .material-cell-remove {
        grid-column: 1;
    }
}

.entry-card {
    border: 1px solid #dbe3ef;
    border-radius: 10px;
    background: #f8fafc;
    padding: 0.55rem;
}

.entry-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 0.2rem;
}

.request-entry-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 0.5rem;
}

.request-cell {
    grid-column: span 2;
    min-width: 0;
}

.request-cell-type { grid-column: span 2; }
.request-cell-item { grid-column: span 4; }
.request-cell-reason { grid-column: span 4; }

@media (max-width: 992px) {
    .request-entry-grid {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
    .request-cell,
    .request-cell-type,
    .request-cell-item,
    .request-cell-reason {
        grid-column: span 3;
    }
}

@media (max-width: 576px) {
    .request-entry-grid {
        grid-template-columns: 1fr;
    }
    .request-cell,
    .request-cell-type,
    .request-cell-item,
    .request-cell-reason {
        grid-column: 1;
    }
}

/* Media for Customer tab - date-wise layout */
.media-customer-card .progress-card-subtitle {
    margin-top: 0.35rem;
}

.media-date-group {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--bb-border);
}

.media-date-group:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.media-date-header {
    font-size: 1rem;
    font-weight: 600;
    color: var(--bb-dark);
    margin: 0 0 1rem 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.media-date-header .bi {
    color: var(--bb-primary);
}

.media-photos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

@media (min-width: 576px) {
    .media-photos-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }
}

@media (min-width: 768px) {
    .media-photos-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 1.25rem;
    }
}

.media-photo-card {
    background: var(--bb-card-bg);
    border: 1px solid var(--bb-border);
    border-radius: var(--bb-radius);
    overflow: hidden;
    transition: box-shadow 0.2s, border-color 0.2s;
}

.media-photo-card:hover {
    box-shadow: var(--bb-shadow);
    border-color: var(--bb-primary);
}

.media-photo-link {
    display: block;
    aspect-ratio: 4/3;
    background: var(--bb-light);
}

.media-photo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.media-photo-info {
    padding: 0.5rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.media-photo-caption {
    font-size: 0.8rem;
    color: var(--bb-secondary);
    max-width: 100%;
    display: block;
}

.media-share-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    cursor: pointer;
    user-select: none;
}

.media-share-toggle input[type="checkbox"] {
    cursor: pointer;
    width: 1rem;
    height: 1rem;
}

.media-share-label {
    color: var(--bb-secondary);
}

.media-videos-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.media-video-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--bb-card-bg);
    border: 1px solid var(--bb-border);
    border-radius: var(--bb-radius);
}

.media-video-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.media-video-info {
    min-width: 0;
}

.media-video-link {
    color: var(--bb-primary);
    text-decoration: none;
    font-size: 0.9rem;
}

.media-video-link:hover {
    text-decoration: underline;
}

.media-empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--bb-secondary);
}

.media-empty-icon {
    display: block;
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Milestones tab - ProjectProgress */
.milestones-tab .milestones-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.5rem 1.75rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid var(--bb-border);
}

.milestones-header-left {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.milestones-icon {
    font-size: 2rem;
    color: var(--bb-primary);
    flex-shrink: 0;
}

.milestones-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--bb-dark);
    margin: 0 0 0.25rem 0;
    letter-spacing: -0.02em;
}

.milestones-subtitle {
    font-size: 0.875rem;
    color: var(--bb-secondary);
    margin: 0;
}

.milestones-seed-btn {
    padding: 0.5rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, var(--bb-primary) 0%, var(--bb-primary-dark) 100%);
    border: none;
    border-radius: var(--bb-radius);
    box-shadow: var(--bb-shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s;
}

.milestones-seed-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.milestones-body {
    padding: 1.5rem 1.75rem;
}

.milestones-empty-state {
    text-align: center;
    padding: 3rem 2rem;
    background: var(--bb-card-bg);
    border: 1px dashed var(--bb-border);
    border-radius: var(--bb-radius-lg);
}

.milestones-empty-setup {
    border-color: rgba(37, 99, 235, 0.3);
    background: linear-gradient(180deg, rgba(37, 99, 235, 0.04) 0%, var(--bb-card-bg) 100%);
}

.milestones-empty-seed {
    border-color: rgba(22, 163, 74, 0.3);
    background: linear-gradient(180deg, rgba(22, 163, 74, 0.04) 0%, var(--bb-card-bg) 100%);
}

.milestones-empty-icon {
    display: block;
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.8;
}

.milestones-empty-setup .milestones-empty-icon {
    color: var(--bb-primary);
}

.milestones-empty-seed .milestones-empty-icon {
    color: var(--bb-success);
}

.milestones-empty-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--bb-dark);
    margin: 0 0 0.5rem 0;
}

.milestones-empty-desc {
    font-size: 0.9rem;
    color: var(--bb-secondary);
    margin: 0 0 1.5rem 0;
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.5;
}

.milestones-action-btn {
    padding: 0.6rem 1.5rem;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, var(--bb-primary) 0%, var(--bb-primary-dark) 100%);
    border: none;
    border-radius: var(--bb-radius);
    box-shadow: var(--bb-shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s;
}

.milestones-empty-seed .milestones-action-btn {
    background: linear-gradient(135deg, var(--bb-success) 0%, #047857 100%);
}

.milestones-action-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.milestones-empty-seed .milestones-action-btn:hover:not(:disabled) {
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.3);
}

.milestones-hint {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.875rem 1rem;
    margin-bottom: 1.25rem;
    font-size: 0.85rem;
    color: var(--bb-secondary);
    background: rgba(37, 99, 235, 0.06);
    border: 1px solid rgba(37, 99, 235, 0.15);
    border-radius: var(--bb-radius);
    line-height: 1.5;
}

.milestones-hint .bi {
    color: var(--bb-primary);
    flex-shrink: 0;
    margin-top: 0.15rem;
}

.milestones-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--bb-border);
    border-radius: var(--bb-radius-lg);
}

.milestones-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.milestones-table thead {
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
}

.milestones-table th {
    padding: 0.875rem 1rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--bb-secondary);
    text-align: left;
    border-bottom: 1px solid var(--bb-border);
}

.milestones-table th:first-child {
    padding-left: 1.25rem;
}

.milestones-table th:last-child {
    padding-right: 1.25rem;
}

.milestones-table tbody tr {
    transition: background 0.15s;
}

.milestones-table tbody tr:hover {
    background: rgba(37, 99, 235, 0.04);
}

.milestones-table tbody tr + tr {
    border-top: 1px solid var(--bb-border-light);
}

.milestones-table td {
    padding: 0.875rem 1rem;
    vertical-align: middle;
}

.milestones-table td:first-child {
    padding-left: 1.25rem;
}

.milestones-table td:last-child {
    padding-right: 1.25rem;
}

.milestones-col-num {
    width: 44px;
    font-weight: 500;
    color: var(--bb-secondary);
}

.milestones-col-name {
    min-width: 180px;
}

.milestone-name {
    font-weight: 500;
    color: var(--bb-dark);
}

.milestones-col-date {
    white-space: nowrap;
    color: var(--bb-secondary);
    font-size: 0.85rem;
}

.milestones-col-budget {
    font-weight: 500;
    color: var(--bb-dark);
}

.milestone-progress-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 160px;
}

.milestone-progress-track {
    flex: 1;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.milestone-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--pah-primary) 0%, var(--pah-primary-bright) 100%);
    border-radius: 4px;
    transition: width 0.35s ease;
}

.milestone-progress-cell.high .milestone-progress-fill {
    background: linear-gradient(90deg, #0ea5e9 0%, #06b6d4 100%);
}

.milestone-progress-cell.complete .milestone-progress-fill {
    background: linear-gradient(90deg, var(--bb-success) 0%, #10b981 100%);
}

.milestone-progress-pct {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--bb-dark);
    min-width: 38px;
    text-align: right;
}

.milestone-progress-cell.complete .milestone-progress-pct {
    color: var(--bb-success);
}

.milestones-col-action {
    width: 50px;
    text-align: center;
}

.milestones-timeline-config {
    padding: 1rem 1.25rem;
    background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
    border: 1px solid var(--bb-border);
    border-radius: var(--bb-radius);
}

.milestones-timeline-header {
    font-size: 0.95rem;
    color: var(--bb-dark);
    margin-bottom: 0.25rem;
}

.milestones-timeline-hint {
    font-size: 0.85rem;
    color: var(--bb-secondary);
    margin: 0;
}

.milestones-edit-btn {
    padding: 0.25rem 0.5rem;
}

.milestone-status-badge {
    display: inline-block;
    margin-left: 0.5rem;
    padding: 0.15rem 0.5rem;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-radius: 0.25rem;
}

.milestone-status-complete {
    background: rgba(22, 163, 74, 0.15);
    color: var(--bb-success);
}

.milestone-status-on-track {
    background: rgba(37, 99, 235, 0.12);
    color: var(--bb-primary);
}

.milestone-status-at-risk {
    background: rgba(234, 179, 8, 0.2);
    color: #b45309;
}

.milestone-status-behind-schedule {
    background: rgba(220, 38, 38, 0.12);
    color: var(--bb-danger);
}

.milestone-schedule-col {
    white-space: nowrap;
    font-size: 0.75rem;
    min-width: 80px;
}
.milestone-schedule-cell {
    font-size: 0.8rem;
    padding: 0.5rem 0.4rem !important;
}
.milestone-schedule-badge {
    display: inline-block;
    padding: 0.15rem 0.4rem;
    font-size: 0.65rem;
    font-weight: 600;
    border-radius: 4px;
}
.milestone-schedule-badge.milestone-ontime {
    background: rgba(22, 163, 74, 0.15);
    color: var(--bb-success);
}
.milestone-schedule-badge.milestone-delayed {
    background: rgba(220, 38, 38, 0.12);
    color: var(--bb-danger);
}

@media (max-width: 768px) {
    .milestones-header {
        flex-direction: column;
        align-items: stretch;
    }
    .milestones-header-left {
        flex-direction: column;
    }
    .milestones-icon {
        font-size: 1.5rem;
    }
    .milestones-table th,
    .milestones-table td {
        padding: 0.65rem 0.75rem;
    }
}

.progress-history-table thead th {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--bb-secondary);
    padding: 0.75rem 1rem;
}

.progress-history-table tbody td {
    padding: 0.75rem 1rem;
    vertical-align: middle;
}

.progress-history-table .badge {
    font-weight: 500;
}

.progress-page .modal-content {
    border-radius: var(--bb-radius-lg);
    border: none;
    box-shadow: var(--bb-shadow-lg);
}

.progress-page .modal-header {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid var(--bb-border);
    padding: 1rem 1.25rem;
}

.progress-page .modal-title {
    font-weight: 600;
    font-size: 1rem;
    color: var(--bb-dark);
}

.progress-page .modal-body {
    padding: 1.25rem;
}

.progress-page .modal-footer {
    border-top: 1px solid var(--bb-border);
    padding: 1rem 1.25rem;
}

.progress-save-actions {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--bb-border);
}

.progress-report-detail-row td {
    border-top: none !important;
}

.progress-report-detail-box {
    background: #fff;
    border-radius: var(--bb-radius);
    padding: 1rem 1.25rem;
    border: 1px solid var(--bb-border);
}

@media (max-width: 768px) {
    .progress-page {
        padding: 1rem;
    }
    .progress-tabs-nav {
        flex-direction: column;
    }
    .progress-tab {
        justify-content: flex-start;
    }
}

/* Step 5: Formal agreement document view */
.agreement-document-card {
    background: #fefefe;
    border: 1px solid #e5e7eb;
}
.agreement-document-body {
    background: linear-gradient(to bottom, #fff 0%, #fafafa 100%);
}
.agreement-pre {
    word-wrap: break-word;
}

/* Progress Dashboard - stat cards stay on one line */
.progress-dashboard-cards {
    flex-wrap: nowrap;
}
.progress-dashboard-card-col {
    flex: 1 1 0;
    min-width: 0;
}
@media (max-width: 900px) {
    .progress-dashboard-cards {
        overflow-x: auto;
        flex-wrap: nowrap;
    }
    .progress-dashboard-card-col {
        flex: 0 0 180px;
        min-width: 180px;
    }
}

/* Add / Edit project — workflow role staff: compact dropdown + checkboxes, two columns on md+ */
.workflow-role-multiselect-toggle {
    min-height: auto;
    line-height: 1.25;
    font-size: 0.8125rem;
    background: #fff !important;
}
.workflow-role-multiselect-chevron {
    font-size: 0.75rem;
}
.workflow-role-multiselect-panel {
    position: relative;
    z-index: 2;
    max-height: 240px;
}
.workflow-role-multiselect-list {
    max-height: 180px;
    overflow-y: auto;
}

/* Add / Edit project — searchable company name dropdown */
.company-search-select .company-search-panel {
    position: absolute;
    left: 0;
    right: 0;
    z-index: 1050;
    max-height: 260px;
    overflow-y: auto;
}
.company-search-option:hover,
.company-search-option:focus {
    background-color: #f8f9fa;
}
.company-search-option-add {
    background-color: #e8f4fd;
    color: #0d6efd;
}
.company-search-option-add:hover,
.company-search-option-add:focus {
    background-color: #d0e8fc;
}

/* Create lead — package picker & inclusions (colorful card tones) */
.package-tone-0 { --tone-accent: var(--pah-primary-bright); --tone-accent-dark: var(--pah-primary-dark); --tone-bg: linear-gradient(145deg, #f4feff 0%, #ccfbf1 45%, #fff 100%); --tone-soft: rgba(0, 169, 157, 0.12); --tone-border: rgba(0, 137, 123, 0.28); }
.package-tone-1 { --tone-accent: #7c3aed; --tone-accent-dark: #6d28d9; --tone-bg: linear-gradient(145deg, #f5f3ff 0%, #ede9fe 45%, #fff 100%); --tone-soft: rgba(124, 58, 237, 0.12); --tone-border: rgba(124, 58, 237, 0.28); }
.package-tone-2 { --tone-accent: #059669; --tone-accent-dark: #047857; --tone-bg: linear-gradient(145deg, #ecfdf5 0%, #d1fae5 45%, #fff 100%); --tone-soft: rgba(5, 150, 105, 0.12); --tone-border: rgba(5, 150, 105, 0.28); }
.package-tone-3 { --tone-accent: #d97706; --tone-accent-dark: #b45309; --tone-bg: linear-gradient(145deg, #fffbeb 0%, #fef3c7 45%, #fff 100%); --tone-soft: rgba(217, 119, 6, 0.14); --tone-border: rgba(217, 119, 6, 0.3); }
.package-tone-4 { --tone-accent: #db2777; --tone-accent-dark: #be185d; --tone-bg: linear-gradient(145deg, #fdf2f8 0%, #fce7f3 45%, #fff 100%); --tone-soft: rgba(219, 39, 119, 0.12); --tone-border: rgba(219, 39, 119, 0.28); }
.package-tone-5 { --tone-accent: #0891b2; --tone-accent-dark: #0e7490; --tone-bg: linear-gradient(145deg, #ecfeff 0%, #cffafe 45%, #fff 100%); --tone-soft: rgba(8, 145, 178, 0.12); --tone-border: rgba(8, 145, 178, 0.28); }

.inclusion-tone-0 { --tone-accent: var(--pah-primary-bright); --tone-accent-dark: var(--pah-primary-dark); --tone-bg: linear-gradient(135deg, #f4feff 0%, #f8fafc 100%); --tone-soft: rgba(0, 169, 157, 0.14); --tone-border: rgba(0, 137, 123, 0.22); }
.inclusion-tone-1 { --tone-accent: #7c3aed; --tone-accent-dark: #6d28d9; --tone-bg: linear-gradient(135deg, #f5f3ff 0%, #faf5ff 100%); --tone-soft: rgba(124, 58, 237, 0.14); --tone-border: rgba(124, 58, 237, 0.22); }
.inclusion-tone-2 { --tone-accent: #059669; --tone-accent-dark: #047857; --tone-bg: linear-gradient(135deg, #ecfdf5 0%, #f0fdf4 100%); --tone-soft: rgba(5, 150, 105, 0.14); --tone-border: rgba(5, 150, 105, 0.22); }
.inclusion-tone-3 { --tone-accent: #d97706; --tone-accent-dark: #b45309; --tone-bg: linear-gradient(135deg, #fffbeb 0%, #fff7ed 100%); --tone-soft: rgba(217, 119, 6, 0.16); --tone-border: rgba(217, 119, 6, 0.24); }
.inclusion-tone-4 { --tone-accent: #db2777; --tone-accent-dark: #be185d; --tone-bg: linear-gradient(135deg, #fdf2f8 0%, #fff1f2 100%); --tone-soft: rgba(219, 39, 119, 0.14); --tone-border: rgba(219, 39, 119, 0.22); }
.inclusion-tone-5 { --tone-accent: #0891b2; --tone-accent-dark: #0e7490; --tone-bg: linear-gradient(135deg, #ecfeff 0%, #f0fdfa 100%); --tone-soft: rgba(8, 145, 178, 0.14); --tone-border: rgba(8, 145, 178, 0.22); }

.package-picker-card {
    border-radius: var(--bb-radius-xl);
    overflow: hidden;
    border: 1px solid var(--bb-border);
}
.package-picker-header {
    background: linear-gradient(135deg, #eff6ff 0%, #f8fafc 55%, #fff 100%);
    border-bottom: 1px solid var(--bb-border);
}
.package-picker-header-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--bb-radius-lg);
    background: linear-gradient(135deg, var(--pah-primary-bright), var(--pah-primary));
    color: #fff;
    font-size: 1.15rem;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}
.package-picker-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--bb-dark);
    letter-spacing: -0.02em;
}
.package-picker-subtitle {
    font-size: 0.8125rem;
    color: var(--bb-secondary);
    line-height: 1.45;
    max-width: 42rem;
}

/* Package selection cards */
.package-select-card {
    position: relative;
    display: flex;
    flex-direction: column;
    border: 2px solid var(--tone-border);
    border-radius: var(--bb-radius-xl);
    background: var(--tone-bg);
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.18s ease;
    overflow: hidden;
}
.package-select-card-accent {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--tone-accent), var(--tone-accent-dark));
}
.package-select-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
    border-color: var(--tone-accent);
}
.package-select-card.is-selected {
    border-color: var(--tone-accent);
    box-shadow: 0 0 0 3px var(--tone-soft), 0 14px 32px rgba(15, 23, 42, 0.14);
    transform: translateY(-2px);
}
.package-select-card.is-compare:not(.is-selected) {
    outline: 2px dashed var(--tone-accent);
    outline-offset: 2px;
}
.package-select-card-top {
    padding: 1.15rem 1rem 0.85rem;
    flex: 1;
}
.package-select-icon-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 14px;
    background: var(--tone-soft);
    border: 1px solid var(--tone-border);
    margin-bottom: 0.65rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}
.package-select-icon {
    font-size: 1.25rem;
    color: var(--tone-accent-dark);
}
.package-select-badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #fff;
    background: linear-gradient(135deg, var(--tone-accent), var(--tone-accent-dark));
    border-radius: 999px;
    padding: 0.25rem 0.6rem;
    margin-bottom: 0.5rem;
    box-shadow: 0 2px 8px var(--tone-soft);
}
.package-select-name {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--bb-dark);
    line-height: 1.25;
    letter-spacing: -0.03em;
}
.package-select-rates {
    margin-top: 0.55rem;
    font-size: 0.75rem;
    color: var(--bb-secondary);
    line-height: 1.5;
}
.package-select-rate-dot {
    margin: 0 0.15rem;
    opacity: 0.45;
}
.package-select-estimate {
    margin-top: 0.4rem;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}
.package-select-estimate-label {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--tone-text-muted, #64748b);
}
.package-select-estimate-value {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--tone-accent-dark);
}
.package-select-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.7rem 1rem;
    border-top: 1px solid var(--tone-border);
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(6px);
}
.package-select-count {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--tone-accent-dark);
}
.package-compare-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin: 0;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--bb-dark);
    cursor: pointer;
    background: #fff;
    border: 1px solid var(--tone-border);
    border-radius: 999px;
    padding: 0.2rem 0.55rem;
}
.package-compare-toggle .form-check-input {
    margin: 0;
    cursor: pointer;
}
.package-compare-toggle .form-check-input:checked {
    background-color: var(--tone-accent);
    border-color: var(--tone-accent);
}

/* Inclusions panel */
.package-inclusions-panel {
    border: 1px solid var(--bb-border);
    border-radius: var(--bb-radius-xl);
    background: #f8fafc;
    box-shadow: var(--bb-shadow-sm);
    overflow: hidden;
}
.package-inclusions-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.1rem 1.35rem;
    background: linear-gradient(135deg, #fff 0%, #f8fafc 100%);
    border-bottom: 1px solid var(--bb-border);
}
.package-inclusions-title {
    font-size: 1rem;
    font-weight: 800;
    color: var(--bb-dark);
    letter-spacing: -0.02em;
}
.package-inclusions-hint {
    font-size: 0.8125rem;
    color: var(--bb-secondary);
    margin-top: 0.3rem;
    line-height: 1.45;
}
.package-inclusions-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.5rem;
    padding: 0.15rem 0.5rem;
    margin-right: 0.3rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, var(--pah-primary-bright), var(--pah-primary));
    border-radius: 999px;
    vertical-align: middle;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.35);
}
.package-inclusions-search-wrap {
    position: relative;
    min-width: min(100%, 220px);
    flex: 0 1 260px;
}
.package-inclusions-search-icon {
    position: absolute;
    left: 0.65rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.8rem;
    color: var(--bb-secondary);
    pointer-events: none;
    z-index: 1;
}
.package-inclusions-search {
    padding-left: 2rem;
    border-radius: 999px;
    border-color: var(--bb-border);
    background: #fff;
    box-shadow: var(--bb-shadow-sm);
}
.package-inclusions-search:focus {
    border-color: var(--bb-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.package-inclusions-empty,
.package-inclusions-empty-state {
    text-align: center;
    padding: 2rem 1.25rem;
    color: var(--bb-secondary);
}
.package-inclusions-empty .bi {
    font-size: 1.5rem;
    display: block;
    margin-bottom: 0.5rem;
    opacity: 0.5;
}

/* Compare toolbar */
.package-inclusions-compare .package-inclusions-toolbar {
    flex-direction: column;
    align-items: stretch;
}
.package-inclusions-compare-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.package-inclusions-chip {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--tone-accent-dark);
    background: var(--tone-soft);
    border: 1px solid var(--tone-border);
    border-radius: 999px;
    padding: 0.3rem 0.85rem;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.05);
}

/* Inclusions matrix — Category | Package1 | Package2 | … */
.package-inclusions-table-wrap {
    margin: 0;
    padding: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    background: #fff;
    border-top: 1px solid #cbd5e1;
}
.package-inclusions-table {
    width: 100%;
    min-width: 480px;
    border-collapse: collapse;
    font-size: 0.8125rem;
    margin: 0;
    table-layout: auto;
}
.package-inclusions-table--matrix {
    border: 1px solid #cbd5e1;
}
.package-inclusions-table thead {
    position: sticky;
    top: 0;
    z-index: 3;
}
.package-inclusions-table thead th {
    padding: 0.7rem 1rem;
    font-size: 0.75rem;
    font-weight: 800;
    text-align: left;
    color: #1e293b;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    white-space: nowrap;
}
.package-inclusions-table thead th.pi-th-category {
    min-width: 140px;
    max-width: 200px;
    background: #e2e8f0;
}
.package-inclusions-table--matrix thead th.pi-th-package {
    text-align: left;
    min-width: 160px;
    color: var(--tone-accent-dark);
    background: var(--tone-bg);
    border-color: var(--tone-border);
}
.package-inclusions-table .package-inclusions-data-row td {
    padding: 0.6rem 1rem;
    vertical-align: top;
    border: 1px solid #e2e8f0;
    background: #fff;
}
.package-inclusions-table .package-inclusions-data-row:hover td {
    background: #f8fafc;
}
.package-inclusions-table .pi-td-category {
    min-width: 130px;
    max-width: 220px;
    background: #fafafa;
    border-right: 2px solid #e2e8f0;
}
.package-inclusions-table .pi-td-category-merged {
    vertical-align: middle;
    text-align: left;
    background: #f8fafc;
    border-right: 2px solid #cbd5e1;
}
.package-inclusions-table tr.pi-category-group-first .pi-td-category-merged {
    border-top: 1px solid #e2e8f0;
}
.package-inclusions-table tr.pi-category-group-last td {
    border-bottom: 1px solid #cbd5e1;
}
.package-inclusions-table tr.pi-category-group-last .pi-td-category-merged {
    border-bottom: 1px solid #cbd5e1;
}
.package-inclusions-table .pi-category-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 800;
    line-height: 1.35;
    color: var(--tone-accent-dark);
    letter-spacing: -0.01em;
}
.package-inclusions-data-row.inclusion-tone-0 .pi-category-label { color: #1d4ed8; }
.package-inclusions-data-row.inclusion-tone-1 .pi-category-label { color: #6d28d9; }
.package-inclusions-data-row.inclusion-tone-2 .pi-category-label { color: #047857; }
.package-inclusions-data-row.inclusion-tone-3 .pi-category-label { color: #b45309; }
.package-inclusions-data-row.inclusion-tone-4 .pi-category-label { color: #be185d; }
.package-inclusions-data-row.inclusion-tone-5 .pi-category-label { color: #0e7490; }
.package-inclusions-table .pi-td-package {
    min-width: 150px;
    text-align: left;
    vertical-align: top;
    background: #fff;
}
.package-inclusions-table .pi-td-package-list {
    padding: 0.65rem 0.85rem;
}
.package-inclusions-table .pi-package-item-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}
.package-inclusions-table .pi-package-item-list-entry {
    padding-bottom: 0.5rem;
    border-bottom: 1px dashed #e2e8f0;
}
.package-inclusions-table .pi-package-item-list-entry:last-child {
    padding-bottom: 0;
    border-bottom: none;
}
.package-inclusions-table .pi-package-feature {
    display: block;
    font-size: 0.8125rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.4;
}
.package-inclusions-table .pi-package-spec {
    display: block;
    margin-top: 0.2rem;
    font-size: 0.72rem;
    font-weight: 500;
    color: #64748b;
    line-height: 1.35;
}
.package-inclusions-table tr.package-inclusions-category-block td {
    vertical-align: top;
}
.package-inclusions-table .pi-td-category-merged {
    vertical-align: middle;
}
.package-inclusions-table-wrap::-webkit-scrollbar {
    height: 6px;
}
.package-inclusions-table-wrap::-webkit-scrollbar-thumb {
    background: rgba(100, 116, 139, 0.35);
    border-radius: 999px;
}

@media (max-width: 575.98px) {
    .package-inclusions-toolbar {
        padding: 0.85rem 1rem;
    }
    .package-inclusions-search-wrap {
        flex: 1 1 100%;
    }
    .package-inclusions-table thead th,
    .package-inclusions-table .package-inclusions-data-row td,
    .package-inclusions-table .package-inclusions-category-row td {
        padding-left: 0.65rem;
        padding-right: 0.65rem;
    }

    .create-lead-page .lead-token-summary-row {
        grid-template-columns: 1fr;
    }

    .create-lead-wizard-footer .d-flex.flex-wrap.ms-auto .btn,
    .create-lead-wizard-prev {
        flex: 1 1 100%;
    }
}

/* Construction tracking (site engineer daily updates) */
.construction-tracking-page .construction-tracking-project-card {
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.construction-tracking-page .construction-tracking-project-card:hover {
    box-shadow: var(--bb-shadow-md);
    transform: translateY(-2px);
}

.construction-tracking-tabs .nav-link {
    cursor: pointer;
    font-size: 0.9rem;
}

.construction-cost-card-total {
    background: linear-gradient(135deg, #eff6ff 0%, #f8fafc 100%);
    border-left: 3px solid var(--bb-primary);
}

.construction-tracking-grid-card {
    border-radius: 12px;
}

.construction-tracking-grid thead th {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #64748b;
    white-space: nowrap;
}

.construction-tracking-grid tbody td {
    font-size: 0.9rem;
    vertical-align: middle;
}

.construction-progress-bar .progress-bar {
    font-size: 0.7rem;
    font-weight: 600;
}

.construction-tracking-modal .modal-body {
    max-height: calc(100vh - 12rem);
    overflow-y: auto;
}

.construction-tracking-stat-card {
    cursor: pointer;
    transition: box-shadow 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
    border: 2px solid transparent !important;
}

.construction-tracking-stat-card:hover {
    box-shadow: 0 0.35rem 1rem rgba(0, 0, 0, 0.08) !important;
    transform: translateY(-1px);
}

.construction-tracking-stat-card-active {
    border-color: var(--bs-primary) !important;
    box-shadow: 0 0.25rem 0.75rem rgba(13, 110, 253, 0.15) !important;
}

.construction-tracking-stat-card-active {
    border-color: var(--bs-primary) !important;
    box-shadow: 0 0.25rem 0.75rem rgba(13, 110, 253, 0.15) !important;
}

/* Daily update page */
.construction-daily-page {
    max-width: 1200px;
    margin: 0 auto;
}

.construction-daily-back {
    color: #64748b;
}

.construction-daily-back:hover {
    color: var(--bb-primary, #0d6efd);
}

.construction-daily-date-picker {
    min-width: 11rem;
}

.construction-daily-date-picker .form-control {
    border-radius: 8px;
    border-color: #cbd5e1;
}

.construction-daily-kpi {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1rem 1.1rem;
    height: 100%;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.construction-daily-kpi-total {
    background: linear-gradient(135deg, #eff6ff 0%, #f8fafc 100%);
    border-color: #bfdbfe;
}

.construction-daily-kpi-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    margin-bottom: 0.25rem;
}

.construction-daily-kpi-value {
    font-size: 1.35rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.2;
}

.construction-daily-panel {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
    overflow: hidden;
}

.construction-daily-panel .card-header {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.9rem;
    padding: 0.75rem 1rem;
}

.construction-daily-add-panel .card-header {
    background: #fff;
}

.construction-daily-table thead th {
    background: #f1f5f9;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    border-bottom: 1px solid #e2e8f0;
    white-space: nowrap;
}

.construction-daily-table tbody td {
    vertical-align: middle;
    border-color: #f1f5f9;
}

.construction-daily-section-heading {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.85rem;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    color: #0f172a;
}

.construction-daily-section-heading-received {
    background: #ecfdf5;
    color: #047857;
}

.construction-daily-section-heading-used {
    background: #fff7ed;
    color: #c2410c;
}

.construction-daily-section-heading-machinery {
    background: #fefce8;
    color: #a16207;
}

.construction-daily-section-heading-labour {
    background: #eff6ff;
    color: #1d4ed8;
}

.construction-material-section-received .construction-daily-add-panel {
    border-left: 3px solid #10b981;
}

.construction-material-section-used .construction-daily-add-panel {
    border-left: 3px solid #f97316;
}

.construction-daily-info {
    background: #f8fafc;
}

.construction-daily-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    position: sticky;
    bottom: 0;
    z-index: 5;
    margin-top: 1.5rem;
    padding: 1rem 0;
    background: linear-gradient(to top, #fff 70%, rgba(255, 255, 255, 0));
}

.construction-tracking-stat-expense .h4 {
    font-weight: 700;
}

.construction-tracking-stat-summary {
    background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
}

.construction-tracking-stat-profit {
    border-left: 3px solid #10b981 !important;
}

.construction-tracking-stat-loss {
    border-left: 3px solid #ef4444 !important;
}

.admin-dashboard-type-section {
    border-left: 4px solid var(--bs-primary);
}

.admin-dashboard-type-section.dashboard-type-architectural {
    border-left-color: #6f42c1;
}

.admin-dashboard-type-section.dashboard-type-structural {
    border-left-color: #0d6efd;
}

.admin-dashboard-type-section.dashboard-type-construction {
    border-left-color: #fd7e14;
}

.construction-dashboard-finance {
    border-radius: 12px;
}

.construction-dashboard-kpi {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 0.85rem 1rem;
    height: 100%;
}

.construction-dashboard-kpi-profit {
    background: #ecfdf5;
    border-color: #a7f3d0;
}

.construction-dashboard-kpi-loss {
    background: #fef2f2;
    border-color: #fecaca;
}

.construction-daily-section-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    padding-bottom: 0.35rem;
    border-bottom: 2px solid var(--bs-primary);
    color: var(--bs-body-color);
}

.construction-daily-actions {
    margin-top: 1rem;
    position: sticky;
    bottom: 0;
    z-index: 2;
}

.construction-tracking-view-modal .construction-tracking-grid-card {
    border-radius: 12px;
}

.construction-tracking-view-modal .grid-pagination .page-link {
    cursor: pointer;
}

/* ========== Login page (global styles in head for cross-browser reliability) ========== */
.login-layout {
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    grid-template-columns: 1fr;
    position: relative;
    overflow: hidden;
    background-color: var(--pah-primary-dark, #00695c);
}

.login-brand-panel {
    display: block;
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.login-brand-photo,
.login-panel-photo {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.login-brand-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(
        145deg,
        rgba(0, 73, 64, 0.82) 0%,
        rgba(0, 105, 92, 0.68) 42%,
        rgba(0, 137, 123, 0.58) 100%
    );
}

.login-brand-glow {
    position: absolute;
    z-index: 2;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.28;
    pointer-events: none;
}

.login-brand-glow--1 {
    width: min(420px, 55vw);
    height: min(420px, 55vw);
    top: -8%;
    left: -6%;
    background: rgba(255, 255, 255, 0.22);
}

.login-brand-glow--2 {
    width: min(360px, 48vw);
    height: min(360px, 48vw);
    bottom: -10%;
    right: 8%;
    background: rgba(0, 169, 157, 0.35);
}

.login-brand-grid {
    position: absolute;
    inset: 0;
    z-index: 2;
    opacity: 0.1;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.35) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.35) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.9) 0%, transparent 85%);
}

.login-panel-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.login-panel-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(
        180deg,
        rgba(244, 254, 255, 0.94) 0%,
        rgba(240, 249, 248, 0.9) 55%,
        rgba(236, 253, 250, 0.88) 100%
    );
}

.login-container {
    width: 100%;
    max-width: 480px;
    position: relative;
    z-index: 2;
    margin: auto;
    padding: 1.5rem;
    animation: login-fade-in 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.login-container > .login-card {
    position: relative;
    z-index: 1;
}

@media (min-width: 992px) {
    .login-layout {
        grid-template-columns: minmax(0, 1.15fr) minmax(380px, 1fr);
        grid-template-rows: minmax(100dvh, 1fr);
        align-items: stretch;
        background: #f0f9f8;
    }

    .login-brand-panel {
        position: relative;
        inset: auto;
        grid-column: 1;
        grid-row: 1;
        min-height: 100dvh;
        overflow: hidden;
    }

    .login-brand-overlay {
        background: linear-gradient(
            120deg,
            rgba(0, 73, 64, 0.78) 0%,
            rgba(0, 105, 92, 0.62) 50%,
            rgba(0, 137, 123, 0.52) 100%
        );
    }

    .login-container {
        grid-column: 2;
        grid-row: 1;
        max-width: none;
        margin: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 2.5rem 2rem;
        background: transparent;
        box-shadow: -8px 0 32px rgba(0, 105, 92, 0.12);
    }

    .login-panel-overlay {
        background: linear-gradient(
            105deg,
            rgba(244, 254, 255, 0.92) 0%,
            rgba(240, 249, 248, 0.86) 40%,
            rgba(236, 253, 250, 0.82) 100%
        );
    }

    .login-card {
        width: 100%;
        max-width: 520px;
        box-shadow: 0 20px 40px rgba(0, 105, 92, 0.12), 0 8px 16px rgba(15, 23, 42, 0.06);
    }

    .login-brand-hero {
        min-height: 0;
        padding: 1rem 1.25rem 0.5rem;
    }

    .login-logo {
        width: min(100%, 500px);
    }
}

@keyframes login-fade-in {
    from { opacity: 0; transform: translateY(-16px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.login-card {
    background: #ffffff;
    border-radius: 1.25rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35), 0 12px 24px -8px rgba(0, 0, 0, 0.15), 0 1px 0 rgba(255, 255, 255, 0.95) inset;
    border: 1px solid rgba(0, 0, 0, 0.06);
    overflow: hidden;
    transition: box-shadow 0.35s ease;
}

.login-card:hover {
    box-shadow: 0 32px 64px -12px rgba(0, 0, 0, 0.4), 0 1px 0 rgba(255, 255, 255, 0.95) inset;
}

.login-header {
    background: #ffffff;
    color: var(--pah-primary);
    padding: 2.5rem 1.5rem 1.5rem;
    text-align: center;
    border-bottom: 3px solid var(--pah-primary-bright);
}

.login-header--brand-focus {
    padding: 1.5rem 0.85rem 1.1rem;
}

.login-brand-hero {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin: 0 auto 0.4rem;
    padding: 0.65rem 0.35rem 0.15rem;
}

.login-logo {
    display: block;
    width: min(100%, 420px);
    height: auto;
    max-width: 100%;
    margin: 0 auto;
    object-fit: contain;
    object-position: center;
    border: 0;
    background: transparent;
    -webkit-user-select: none;
    user-select: none;
}

.login-header-title {
    color: var(--pah-primary);
    font-family: var(--bb-font-display);
    font-weight: 800;
    font-size: 1.5rem;
    margin: 0;
    letter-spacing: -0.02em;
    text-align: center;
}

.login-header-subtitle {
    color: var(--pah-primary);
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    letter-spacing: 0.01em;
}

.login-body {
    padding: 2rem 1.75rem;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.login-card .form-label {
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.login-card .form-control {
    border-radius: 0.625rem;
    border: 1px solid #cbd5e1;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    background: #fff;
}

.login-card .form-control::placeholder {
    color: #94a3b8;
}

.login-card .form-control:focus {
    border-color: var(--pah-primary-bright);
    box-shadow: 0 0 0 3px rgba(0, 169, 157, 0.22);
    outline: none;
}

.login-card .form-control:focus-visible {
    outline: 2px solid var(--pah-primary-bright);
    outline-offset: 2px;
}

.login-card .btn-primary {
    background: linear-gradient(135deg, var(--pah-primary-bright) 0%, var(--pah-primary) 100%);
    border: none;
    border-radius: 0.625rem;
    padding: 0.875rem 1.25rem;
    font-family: var(--bb-font-display);
    font-weight: 700;
    font-size: 1rem;
    color: #fff;
    box-shadow: 0 4px 14px rgba(0, 169, 157, 0.4), 0 1px 0 rgba(255, 255, 255, 0.2) inset;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.login-card .btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 137, 123, 0.45), 0 1px 0 rgba(255, 255, 255, 0.2) inset;
}

.login-card .btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.login-card .alert-danger {
    border-radius: 0.625rem;
    border: 1px solid #fecaca;
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    color: #991b1b;
    padding: 0.875rem 1rem;
    font-weight: 500;
}

.login-card .alert-success {
    border-radius: 0.625rem;
    border: 1px solid #bbf7d0;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    color: #166534;
    padding: 0.875rem 1rem;
    font-weight: 500;
}

.login-card .validation-summary-errors {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem 0;
    color: #dc2626;
    font-size: 0.875rem;
    font-weight: 500;
}

.login-card .validation-message,
.login-card .text-danger {
    color: #dc2626;
    font-size: 0.8125rem;
    margin-top: 0.25rem;
    display: block;
}

.login-card .spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.15em;
}

.login-card .d-grid {
    margin-top: 1.5rem;
}

@media (max-width: 991px) {
    .login-container {
        min-height: 100dvh;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .login-container { padding: 1rem; }
    .login-body { padding: 1.5rem 1.25rem; }
    .login-header { padding: 1.35rem 0.65rem 0.95rem; }
    .login-logo {
        width: min(100%, 360px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .login-container {
        animation: none;
    }
}

/* ========== Vendor master ========== */
.vendor-master-page {
    max-width: 1400px;
    margin: 0 auto;
    padding-bottom: 2.5rem;
    background: linear-gradient(180deg, var(--pah-surface-tint, #f4feff) 0%, var(--bb-body-bg, #f0f9f8) 120px, transparent 320px);
}

.vendor-master-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.vendor-master-header-text {
    flex: 1 1 280px;
}

.vendor-master-title {
    font-size: 1.65rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #0f172a;
    margin: 0 0 0.35rem 0;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.vendor-master-subtitle {
    font-size: 0.9rem;
    color: #64748b;
    margin: 0 0 0.75rem 0;
    max-width: 42rem;
    line-height: 1.5;
}

.vendor-master-header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.vendor-master-btn-add {
    font-weight: 600;
    border-radius: 10px;
    padding: 0.45rem 1rem;
    background: linear-gradient(135deg, var(--pah-primary-bright, #00a99d) 0%, var(--pah-primary, #00897b) 100%);
    border: none;
    box-shadow: 0 2px 10px rgba(0, 137, 123, 0.28);
}

.vendor-master-page .btn-primary:not(.vendor-grid-btn-edit) {
    background: linear-gradient(135deg, var(--pah-primary-bright, #00a99d) 0%, var(--pah-primary, #00897b) 100%);
    border-color: var(--pah-primary, #00897b);
}

.vendor-master-page .btn-primary:not(.vendor-grid-btn-edit):hover {
    background: linear-gradient(135deg, var(--pah-primary, #00897b) 0%, var(--pah-primary-dark, #00695c) 100%);
    border-color: var(--pah-primary-dark, #00695c);
}

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

.vendor-master-kpi-inline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
}

.vendor-kpi-chip {
    display: inline-flex;
    align-items: baseline;
    gap: 0.25rem;
    font-size: 0.72rem;
    font-weight: 600;
    color: #64748b;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    white-space: nowrap;
}

.vendor-kpi-chip-value {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--bb-dark);
}

.vendor-kpi-chip-total { border-left: 2px solid var(--bb-primary); }
.vendor-kpi-chip-active { border-left: 2px solid var(--bb-success); }
.vendor-kpi-chip-services { border-left: 2px solid #8b5cf6; }

.vendor-master-hero-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--pah-primary-bright) 0%, var(--pah-primary-dark) 100%);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
    flex-shrink: 0;
}

.vendor-form-card {
    background: #fff;
    border: 1px solid #dbe4f0;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(15, 23, 42, 0.08);
    overflow: visible;
    margin-bottom: 1.25rem;
}

.vendor-form-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, #e0f2f1 0%, #f0fdfa 50%, #ffffff 100%);
    border-bottom: 1px solid rgba(0, 137, 123, 0.12);
    border-radius: 16px 16px 0 0;
}

.vendor-form-card-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0;
    color: #1e293b;
    display: flex;
    align-items: center;
}

.vendor-form-card-header .badge {
    font-weight: 600;
    font-size: 0.7rem;
    padding: 0.35em 0.65em;
}

.vendor-form-body {
    padding: 1.15rem 1.25rem 1.25rem;
}

.vendor-form-section {
    margin-bottom: 1.15rem;
}

.vendor-form-section--details {
    padding: 1rem 1.1rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}

.vendor-form-section--rates {
    padding: 0;
    background: transparent;
    border: none;
}

.vendor-form-section:last-child {
    margin-bottom: 0;
}

.vendor-form-section-title {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--bb-secondary);
    margin-bottom: 0.85rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.vendor-form-section-title .bi {
    font-size: 0.95rem;
    color: var(--bb-primary);
}

.vendor-form-panel {
    background: #fff;
    border: 1px solid #c7d2fe;
    border-radius: 12px;
    padding: 1rem 1.15rem;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.vendor-form-panel--rates {
    background: linear-gradient(180deg, #ffffff 0%, #f0fdfa 100%);
    border-color: rgba(0, 137, 123, 0.2);
}

.vendor-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding-top: 1rem;
    margin-top: 0.5rem;
    border-top: 1px solid #e2e8f0;
}

.vendor-form-btn-save {
    font-weight: 600;
    border-radius: 10px;
    padding: 0.5rem 1.25rem;
    box-shadow: 0 2px 10px rgba(37, 99, 235, 0.3);
}

.vendor-master-input {
    border-radius: 8px;
    border-color: #cbd5e1;
}

.vendor-master-input:focus {
    border-color: var(--bb-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.vendor-master-page .form-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 0.35rem;
}

.vendor-master-page .form-control,
.vendor-master-page .form-select {
    border-color: #cbd5e1;
    border-radius: var(--bb-radius);
    font-size: 0.9rem;
}

.vendor-master-page .form-control:focus,
.vendor-master-page .form-select:focus {
    border-color: var(--bb-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.vendor-spec-multi .vendor-spec-group {
    background: #fff;
    border: 1px solid #e2e8f0 !important;
    border-radius: var(--bb-radius) !important;
    padding: 0.85rem 1rem !important;
    margin-bottom: 0.65rem !important;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.vendor-spec-multi .vendor-spec-group:hover {
    border-color: #cbd5e1 !important;
    box-shadow: var(--bb-shadow-sm);
}

.vendor-spec-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.65rem;
}

.vendor-spec-group-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--bb-dark);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.vendor-spec-group-actions .btn-link {
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: none;
    padding: 0 0.35rem;
}

.vendor-spec-check-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem 0.75rem;
}

.vendor-spec-check-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.65rem;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    font-size: 0.8rem;
    color: var(--bb-dark);
    cursor: pointer;
    margin: 0;
    transition: background 0.12s ease, border-color 0.12s ease;
}

.vendor-spec-check-item:hover {
    background: #e2e8f0;
    border-color: #cbd5e1;
}

.vendor-spec-check-item:has(input:checked) {
    background: #eff6ff;
    border-color: #93c5fd;
    color: #1e40af;
}

.vendor-spec-check-item input {
    margin: 0;
}

.vendor-spec-selected-summary {
    margin-top: 1rem;
    padding: 0.85rem 1rem;
    background: #fff;
    border: 1px dashed #cbd5e1;
    border-radius: var(--bb-radius);
}

.vendor-cat-badge {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.2em 0.55em;
    border-radius: 4px;
    margin-right: 0.35rem;
    vertical-align: middle;
}

.vendor-cat-material { background: #dbeafe; color: #1e40af; }
.vendor-cat-labour { background: #ffedd5; color: #9a3412; }
.vendor-cat-machinery { background: #ede9fe; color: #5b21b6; }
.vendor-cat-drawings { background: #ccfbf1; color: #0f766e; }

.vendor-spec-pill {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.2em 0.55em;
    margin: 0.15rem 0.2rem 0.15rem 0;
    border-radius: 999px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #334155;
}

.vendor-grid-card {
    background: #fff;
    border: 1px solid #dbe4f0;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(15, 23, 42, 0.08);
    overflow: hidden;
}

.vendor-grid-card .admin-grid-filter-bar {
    background: linear-gradient(135deg, #f0f7ff 0%, #f8fafc 55%, #ffffff 100%);
    border-bottom: 1px solid #dbe4f0;
}

.vendor-grid-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem !important;
}

.vendor-grid-search {
    max-width: 320px;
    min-width: 200px;
    flex: 1 1 200px;
}

.vendor-grid-search .form-control {
    border-radius: 10px;
    border-color: #cbd5e1;
}

.vendor-grid-search .input-group-text {
    border-radius: 10px 0 0 10px;
    background: #fff;
    border-color: #cbd5e1;
}

.vendor-master-table {
    border-collapse: separate;
    border-spacing: 0;
}

.vendor-master-table thead th {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #1e3a5f;
    padding: 0.85rem 1rem !important;
    background: linear-gradient(180deg, #e8f0fe 0%, #f1f5f9 100%) !important;
    border-bottom: 2px solid #c7d7f5 !important;
    white-space: nowrap;
}

.vendor-master-table tbody td {
    padding: 0.85rem 1rem !important;
    font-size: 0.9rem;
    vertical-align: middle;
    border-color: #e8eef5 !important;
}

.vendor-master-table tbody tr {
    transition: background 0.15s ease;
}

.vendor-master-table tbody tr:hover {
    background: #f8fafc !important;
}

.vendor-master-page .vendor-empty-state {
    padding: 1.25rem 1rem;
}

.vendor-master-page .vendor-empty-state .bi {
    font-size: 1.75rem;
    margin-bottom: 0.35rem;
}

.vendor-grid-card .table {
    margin-bottom: 0;
}

.vendor-grid-card .table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
}

.vendor-row-editing {
    background: linear-gradient(90deg, #eff6ff 0%, #f8fafc 100%) !important;
    box-shadow: inset 3px 0 0 var(--bb-primary);
}

.vendor-row-inactive {
    opacity: 0.72;
}

.vendor-name-cell {
    font-weight: 600;
    color: var(--bb-dark);
}

.vendor-contact-muted {
    font-size: 0.8rem;
    color: var(--bb-secondary);
}

.vendor-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25em 0.65em;
    border-radius: 999px;
}

.vendor-status-active {
    background: #d1fae5;
    color: #065f46;
}

.vendor-status-inactive {
    background: #f1f5f9;
    color: #64748b;
}

.vendor-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.vendor-empty-state {
    text-align: center;
    padding: 2.5rem 1.5rem;
    color: var(--bb-secondary);
}

.vendor-empty-state .bi {
    font-size: 2.5rem;
    opacity: 0.35;
    display: block;
    margin-bottom: 0.75rem;
}

.vendor-service-library .vendor-service-card {
    border: 1px solid var(--bs-border-color, #dee2e6);
    border-radius: 0.5rem;
    padding: 1rem 1.1rem;
    margin-bottom: 0.75rem;
    background: #fff;
}

.vendor-service-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.65rem;
}

.vendor-service-selected-label {
    margin-bottom: 0.35rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-size: 0.68rem;
}

.vendor-service-selected-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 1rem;
}

.vendor-service-selected-list li {
    font-size: 0.9rem;
}

.vendor-service-empty {
    padding: 0.35rem 0;
}

.vendor-bulk-add-backdrop {
    background: rgba(15, 23, 42, 0.52);
    backdrop-filter: blur(4px);
    z-index: 1060;
}

.vendor-bulk-add-dialog {
    max-width: 720px;
}

.vendor-bulk-add-modal {
    border: none;
    border-radius: 16px;
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.2), 0 8px 16px rgba(0, 105, 92, 0.08);
    overflow: hidden;
}

.vendor-bulk-add-modal-header {
    padding: 1.1rem 1.35rem;
    background: linear-gradient(135deg, #e0f2f1 0%, #f0fdfa 45%, #ffffff 100%);
    border-bottom: 1px solid rgba(0, 137, 123, 0.15);
}

.vendor-bulk-add-modal-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.02em;
}

.vendor-bulk-add-modal-subtitle {
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 0.2rem;
}

.vendor-bulk-add-modal-body {
    padding: 1.15rem 1.35rem 1.25rem;
    background: #fafcfd;
}

.vendor-bulk-add-search-wrap {
    position: relative;
    margin-bottom: 1rem;
}

.vendor-bulk-add-search-icon {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 0.95rem;
    pointer-events: none;
    z-index: 1;
}

.vendor-bulk-add-search {
    padding: 0.55rem 0.85rem 0.55rem 2.35rem;
    border-radius: 10px;
    border: 1px solid #cbd5e1;
    font-size: 0.9rem;
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.vendor-bulk-add-search:focus {
    border-color: var(--pah-primary-bright, #00a99d);
    box-shadow: 0 0 0 3px rgba(0, 169, 157, 0.18);
}

.vendor-bulk-add-empty {
    text-align: center;
    padding: 2rem 1rem;
    color: #64748b;
    font-size: 0.88rem;
    background: #fff;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
}

.vendor-bulk-add-empty-icon {
    display: block;
    font-size: 1.75rem;
    opacity: 0.4;
    margin-bottom: 0.5rem;
}

/* Add-services modal — structured checkbox grid */
.vendor-services-modal-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.5rem;
    max-height: min(52vh, 420px);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.15rem 0.25rem 0.15rem 0;
    margin: 0;
}

.vendor-services-modal-list::-webkit-scrollbar {
    width: 8px;
}

.vendor-services-modal-list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 999px;
}

.vendor-services-modal-row {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    margin: 0;
    padding: 0.65rem 0.75rem;
    min-height: 2.75rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
    user-select: none;
}

.vendor-services-modal-row:hover {
    border-color: rgba(0, 169, 157, 0.35);
    background: #f0fdfa;
    box-shadow: 0 2px 8px rgba(0, 105, 92, 0.08);
}

.vendor-services-modal-row.is-selected {
    border-color: var(--pah-primary-bright, #00a99d);
    background: linear-gradient(135deg, #ecfdf5 0%, #f0fdfa 100%);
    box-shadow: 0 0 0 1px rgba(0, 169, 157, 0.2);
}

.vendor-services-modal-checkbox {
    width: 1.05rem;
    height: 1.05rem;
    margin: 0.15rem 0 0 0;
    flex-shrink: 0;
    accent-color: var(--pah-primary, #00897b);
    cursor: pointer;
}

.vendor-services-modal-name {
    flex: 1;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.4;
    color: #334155;
    word-break: break-word;
}

.vendor-services-modal-row.is-selected .vendor-services-modal-name {
    color: #0f766e;
    font-weight: 600;
}

.vendor-bulk-add-modal-footer {
    padding: 0.9rem 1.35rem;
    background: #fff;
    border-top: 1px solid #e2e8f0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.vendor-bulk-add-selected-count {
    font-size: 0.85rem;
    color: #64748b;
}

.vendor-bulk-add-selected-count strong {
    color: var(--pah-primary-dark, #00695c);
    font-weight: 700;
}

.vendor-bulk-add-modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.vendor-bulk-add-confirm-btn {
    font-weight: 600;
    border-radius: 10px;
    padding: 0.45rem 1.1rem;
    background: linear-gradient(135deg, var(--pah-primary-bright, #00a99d) 0%, var(--pah-primary, #00897b) 100%);
    border: none;
    box-shadow: 0 2px 10px rgba(0, 137, 123, 0.28);
}

.vendor-bulk-add-confirm-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--pah-primary, #00897b) 0%, var(--pah-primary-dark, #00695c) 100%);
    box-shadow: 0 4px 14px rgba(0, 105, 92, 0.32);
}

.vendor-bulk-add-confirm-btn:disabled {
    opacity: 0.55;
}

.vendor-bulk-add-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    max-height: 50vh;
    overflow-y: auto;
}

.vendor-bulk-add-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.55rem;
    border-radius: 0.35rem;
    border: 1px solid transparent;
    cursor: pointer;
    margin: 0;
}

.vendor-bulk-add-item:hover {
    background: rgba(0, 169, 157, 0.06);
    border-color: rgba(0, 169, 157, 0.15);
}

.vendor-mgmt-tabs {
    border-bottom: 2px solid #e2e8f0;
    gap: 0.25rem;
}

.vendor-mgmt-tabs .nav-link {
    font-size: 0.88rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    color: #64748b;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    border-radius: 8px 8px 0 0;
    background: transparent;
}

.vendor-mgmt-tabs .nav-link:hover {
    color: var(--bb-primary);
    background: #f1f5f9;
}

.vendor-mgmt-tabs .nav-link.active {
    color: var(--bb-primary);
    background: #eff6ff;
    border-bottom-color: var(--bb-primary);
}

.vendor-rate-group-title {
    margin-bottom: 0.5rem;
}

.vendor-service-rate-table input.form-control-sm {
    min-width: 4.5rem;
}

.vendor-service-rate-table .table-primary-subtle {
    --bs-table-bg: rgba(13, 110, 253, 0.06);
}

/* Services & rates picker — tabbed, scrollable */
.vendor-service-rate-picker {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

/* Services picker (vendor form) */
.vendor-services-picker {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.vendor-services-picker-loading {
    min-height: 4rem;
}

.vendor-services-picker-tabs {
    padding: 0.35rem;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}

.vendor-rate-cat-tabs {
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0 !important;
    border-bottom: none;
    padding-bottom: 0;
}

.vendor-rate-cat-tabs .nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.4rem 0.85rem;
    border-radius: 999px;
    color: #475569;
    border: 1px solid transparent;
    background: transparent;
    transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.vendor-rate-cat-tabs .nav-link:hover {
    background: #fff;
    color: var(--pah-primary-dark, #00695c);
    border-color: rgba(0, 137, 123, 0.12);
}

.vendor-rate-cat-tabs .nav-link.active {
    background: linear-gradient(135deg, var(--pah-primary-bright, #00a99d) 0%, var(--pah-primary, #00897b) 100%);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 2px 10px rgba(0, 137, 123, 0.28);
}

.vendor-rate-tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.35rem;
    height: 1.35rem;
    padding: 0 0.35rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    background: rgba(15, 23, 42, 0.08);
    color: inherit;
}

.vendor-rate-cat-tabs .nav-link.active .vendor-rate-tab-count {
    background: rgba(255, 255, 255, 0.25);
}

.vendor-rate-tab-count.has-items {
    background: rgba(37, 99, 235, 0.12);
}

.vendor-rate-cat-tabs .nav-link.active .vendor-rate-tab-count.has-items {
    background: rgba(255, 255, 255, 0.3);
}

.vendor-service-card--focused {
    border: 1px solid rgba(0, 137, 123, 0.18);
    border-radius: 14px;
    padding: 1rem 1.15rem;
    background: linear-gradient(180deg, #ffffff 0%, #f8fffe 100%);
    box-shadow: 0 2px 12px rgba(0, 105, 92, 0.06);
}

.vendor-service-card-header {
    margin-bottom: 0.65rem !important;
    gap: 0.65rem !important;
    padding-bottom: 0.65rem;
    border-bottom: 1px solid #e8eef5;
}

.vendor-service-add-btn {
    font-weight: 600;
    border-radius: 8px;
    padding: 0.35rem 0.75rem;
    white-space: nowrap;
}

.vendor-service-empty-inline {
    font-size: 0.85rem;
    color: #64748b;
    padding: 0.75rem 0.5rem;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px dashed #cbd5e1;
    text-align: center;
}

/* Rate tables: no inner vertical scroll — page scrolls instead */
.vendor-rate-table-wrap {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    overflow-x: auto;
    overflow-y: visible;
}

.vendor-rate-table-wrap--modal {
    max-width: 100%;
}

.vendor-rate-table-wrap thead th {
    background: linear-gradient(180deg, #f1f5f9 0%, #f8fafc 100%);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #475569;
    white-space: nowrap;
    padding: 0.55rem 0.65rem;
    border-bottom: 1px solid #e2e8f0;
}

/* Legacy alias — same as wrap, no max-height */
.vendor-rate-table-scroll {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    overflow-x: auto;
    overflow-y: visible;
    max-height: none;
}

.vendor-rate-table-scroll--modal {
    max-height: none;
}

.vendor-rate-table-scroll thead th {
    background: #f1f5f9;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #475569;
    white-space: nowrap;
}

.vendor-service-rate-table {
    margin-bottom: 0;
    font-size: 0.85rem;
}

.vendor-service-rate-table td,
.vendor-service-rate-table th {
    padding: 0.55rem 0.65rem;
    vertical-align: middle;
}

.vendor-rate-col-name {
    min-width: 8rem;
    max-width: 14rem;
}

.vendor-rate-col-unit { width: 5.5rem; }
.vendor-rate-col-rate { width: 6.5rem; }
.vendor-rate-col-gst { width: 5rem; }
.vendor-rate-col-date { width: 9.5rem; }
.vendor-rate-col-action { width: 2.75rem; }

.vendor-service-rate-table input.form-control-sm,
.vendor-service-rate-table .form-control-sm {
    min-width: 0;
    padding: 0.2rem 0.4rem;
    font-size: 0.82rem;
}

.vendor-rate-row-selected {
    --bs-table-bg: rgba(37, 99, 235, 0.06);
}

.vendor-master-page .vendor-form-actions {
    margin-left: 0;
    margin-right: 0;
    margin-bottom: 0;
    padding: 1rem 0 0;
    background: transparent;
}

/* Vendor grid — compact services column */
.vendor-col-services {
    min-width: 11rem;
    width: 14%;
}

.vendor-services-cell {
    font-size: 0.82rem;
    line-height: 1.35;
}

.vendor-services-summary {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    margin-bottom: 0.25rem;
}

.vendor-services-summary--inline {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 0.35rem;
    margin-bottom: 0;
}

.vendor-services-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
}

.vendor-services-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.vendor-services-chip-item {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.65rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    font-size: 0.82rem;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.vendor-services-chip-item:hover {
    border-color: rgba(0, 169, 157, 0.25);
    box-shadow: 0 2px 6px rgba(0, 105, 92, 0.08);
}

.vendor-services-chip-name {
    font-weight: 500;
    color: #334155;
}

.vendor-services-summary-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.vendor-services-count {
    font-size: 0.75rem;
    font-weight: 700;
    color: #64748b;
    background: #f1f5f9;
    border-radius: 999px;
    padding: 0.1rem 0.45rem;
    line-height: 1.3;
}

.vendor-services-view-btn {
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.vendor-services-view-btn:hover {
    text-decoration: underline;
}

.vendor-services-modal-backdrop {
    background: rgba(15, 23, 42, 0.45);
    z-index: 1060;
}

.vendor-services-modal-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
}

.vendor-services-modal-stat {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: #475569;
}

.vendor-services-modal-group {
    margin-bottom: 1rem;
}

.vendor-services-modal-group:last-child {
    margin-bottom: 0;
}

.vendor-services-modal-group-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
}

.vendor-services-modal-table {
    font-size: 0.82rem;
}

.vendor-services-modal-table th {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #64748b;
}

.vendor-row-editing {
    --bs-table-bg: rgba(37, 99, 235, 0.06) !important;
    box-shadow: inset 3px 0 0 var(--bb-primary);
}

.vendor-grid-btn-edit {
    font-weight: 600;
    border-radius: 8px;
    border-color: #a5b4fc;
    color: #4338ca;
    background: #eef2ff;
}

.vendor-grid-btn-edit:hover {
    background: #e0e7ff;
    color: #3730a3;
}

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

@media (max-width: 768px) {
    .vendor-form-body { padding: 0.85rem 1rem; }
    .vendor-master-header { flex-direction: column; }
    .vendor-master-kpi-inline { width: 100%; }
    .vendor-rate-col-date { min-width: 8.5rem; }
    .vendor-services-modal-list {
        grid-template-columns: 1fr;
        max-height: min(58vh, 380px);
    }
    .vendor-bulk-add-modal-footer {
        flex-direction: column;
        align-items: stretch;
    }
    .vendor-bulk-add-modal-actions {
        justify-content: stretch;
    }
    .vendor-bulk-add-modal-actions .btn {
        flex: 1;
    }
}

/* Site cost modal — mobile-friendly site tracking */
.pc-site-cost-modal .modal-body {
    padding: 1rem;
}

.pc-touch-input,
.pc-site-cost-modal .pc-touch-input {
    min-height: 2.75rem;
    font-size: 1rem;
}

.pc-touch-btn {
    min-height: 2.25rem;
    min-width: 2.25rem;
}

.pc-site-entry-form {
    border-radius: var(--bb-radius-lg);
}

.pc-site-table-scroll {
    -webkit-overflow-scrolling: touch;
}

.pc-daily-summary {
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-radius: var(--bb-radius-lg);
    padding: 1rem 1.15rem;
}

.pc-summary-tile {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: var(--bb-radius);
    padding: 0.65rem 0.75rem;
    height: 100%;
}

.pc-summary-tile-total {
    border-color: #93c5fd;
    background: #eff6ff;
}

.pc-summary-label {
    display: block;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    margin-bottom: 0.2rem;
}

.pc-site-cost-backdrop {
    background: rgba(0, 0, 0, 0.45);
}

.pc-site-cost-submodal {
    z-index: 1065;
    background: rgba(0, 0, 0, 0.35);
}

.site-cost-card-list {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.site-cost-entry-card {
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 0.85rem 1rem;
    background: #fff;
}

.site-cost-entry-card-warn {
    border-color: #fcd34d;
    background: #fffbeb;
}

.site-cost-card-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    text-align: center;
}

.site-cost-card-label {
    display: block;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    margin-bottom: 0.15rem;
}

@media (max-width: 576px) {
    .pc-site-cost-modal .modal-footer .btn {
        flex: 1 1 45%;
        min-height: 2.75rem;
    }
}

/* Global loading overlay — PageLoadingIndicator for navigation + RequestProcessing.RunAsync */
body.rk-request-processing .app-wrapper {
    pointer-events: none;
    user-select: none;
}

body.rk-request-processing .global-page-loading-overlay {
    pointer-events: auto;
}

.request-processing-overlay,
.global-page-loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: rgba(15, 23, 42, 0.28);
    backdrop-filter: blur(3px);
}

.global-page-loading {
    width: min(100%, 26rem);
    min-height: 11rem;
    margin: 0;
    border-radius: var(--bb-radius-lg, 0.75rem);
    background: linear-gradient(180deg, var(--pah-surface-tint, #f4feff) 0%, rgba(240, 249, 248, 0.92) 100%);
    border: 1px solid rgba(0, 137, 123, 0.1);
    box-shadow:
        0 16px 48px rgba(15, 23, 42, 0.14),
        0 0 0 1px rgba(255, 255, 255, 0.65) inset;
}

/* ========== Revenue report ========== */
.revenue-report-page {
    padding-bottom: 1rem;
}

.revenue-report-filters .filter-section-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--bb-dark, #0f172a);
}

.revenue-report-filter-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: stretch;
}

.revenue-report-filter-actions .btn {
    min-height: 2.35rem;
}

.revenue-kpi-card {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.85rem 0.9rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: var(--bb-radius-lg, 0.75rem);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.revenue-kpi-card:hover {
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.revenue-kpi-card__icon {
    flex: 0 0 2.25rem;
    width: 2.25rem;
    height: 2.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.55rem;
    font-size: 1.05rem;
}

.revenue-kpi-card__body {
    min-width: 0;
    flex: 1;
}

.revenue-kpi-card__label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    margin-bottom: 0.2rem;
}

.revenue-kpi-card__value {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
    word-break: break-word;
}

.revenue-kpi-card__hint {
    font-size: 0.68rem;
    color: #94a3b8;
    margin-top: 0.25rem;
    line-height: 1.35;
}

.revenue-kpi-card--revenue {
    border-left: 4px solid #059669;
}

.revenue-kpi-card--revenue .revenue-kpi-card__icon {
    background: #ecfdf5;
    color: #059669;
}

.revenue-kpi-card--expense {
    border-left: 4px solid #dc2626;
}

.revenue-kpi-card--expense .revenue-kpi-card__icon {
    background: #fef2f2;
    color: #dc2626;
}

.revenue-kpi-card--paid {
    border-left: 4px solid #2563eb;
}

.revenue-kpi-card--paid .revenue-kpi-card__icon {
    background: #eff6ff;
    color: #2563eb;
}

.revenue-kpi-card--balance {
    border-left: 4px solid #64748b;
}

.revenue-kpi-card--balance-due {
    border-left-color: #dc2626;
}

.revenue-kpi-card--balance-due .revenue-kpi-card__icon {
    background: #fef2f2;
    color: #dc2626;
}

.revenue-kpi-card--balance-clear {
    border-left-color: #059669;
}

.revenue-kpi-card--balance-clear .revenue-kpi-card__icon {
    background: #ecfdf5;
    color: #059669;
}

.revenue-kpi-card--estimate {
    border-left: 3px solid #0ea5e9;
}

.revenue-kpi-card--estimate .revenue-kpi-card__icon {
    background: #e0f2fe;
    color: #0284c7;
}

.revenue-kpi-card--pl-profit {
    border-left: 3px solid #10b981;
}

.revenue-kpi-card--pl-profit .revenue-kpi-card__icon {
    background: #ecfdf5;
    color: #059669;
}

.revenue-kpi-card--pl-loss {
    border-left: 3px solid #ef4444;
}

.revenue-kpi-card--pl-loss .revenue-kpi-card__icon {
    background: #fef2f2;
    color: #dc2626;
}

.revenue-ledger-card {
    border-radius: var(--bb-radius-lg, 0.75rem);
    overflow: hidden;
}

.revenue-ledger-card__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid #e2e8f0;
}

.revenue-ledger-desc-cell {
    min-width: 280px;
    max-width: 420px;
}

.revenue-ledger-table thead th {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    white-space: nowrap;
}

.revenue-ledger-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-top: 1px solid #e2e8f0;
    background: #fafbfc;
}

.revenue-ledger-mobile {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    padding: 0.75rem;
}

.revenue-ledger-entry {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.65rem;
    padding: 0.8rem 0.85rem;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}

.revenue-ledger-entry--received {
    border-left: 3px solid #059669;
    background: linear-gradient(90deg, #f0fdf4 0%, #fff 28%);
}

.revenue-ledger-entry--vendor-paid {
    border-left: 3px solid #2563eb;
    background: linear-gradient(90deg, #eff6ff 0%, #fff 28%);
}

.revenue-ledger-entry--vendor-due {
    border-left: 3px solid #f59e0b;
}

.revenue-ledger-entry--site-expense {
    border-left: 3px solid #64748b;
}

.revenue-ledger-entry__head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.45rem;
}

.revenue-ledger-entry__date {
    font-size: 0.78rem;
    font-weight: 600;
    color: #334155;
}

.revenue-ledger-entry__head .badge {
    font-size: 0.62rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: normal;
    text-align: right;
    line-height: 1.25;
    max-width: 48%;
}

.revenue-ledger-entry__project {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    margin-bottom: 0.35rem;
}

.revenue-ledger-entry__project strong {
    font-size: 0.88rem;
    color: #0f172a;
    line-height: 1.3;
}

.revenue-ledger-entry__project .text-muted {
    font-size: 0.75rem;
}

.revenue-ledger-entry__ref,
.revenue-ledger-entry__vendor {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    color: #64748b;
    margin-bottom: 0.3rem;
}

.revenue-ledger-entry__desc {
    font-size: 0.8rem;
    line-height: 1.45;
    color: #334155;
    word-break: break-word;
    margin-bottom: 0.55rem;
}

.revenue-ledger-entry__amounts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem;
    padding-top: 0.55rem;
    border-top: 1px dashed #e2e8f0;
}

.revenue-ledger-amount {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    padding: 0.45rem 0.5rem;
    border-radius: 0.45rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    min-width: 0;
}

.revenue-ledger-amount span {
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
}

.revenue-ledger-amount strong {
    font-size: 0.82rem;
    font-weight: 700;
    word-break: break-word;
}

.revenue-ledger-amount--received {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.revenue-ledger-amount--received strong {
    color: #059669;
}

.revenue-ledger-amount--expense,
.revenue-ledger-amount--due {
    background: #fef2f2;
    border-color: #fecaca;
}

.revenue-ledger-amount--expense strong,
.revenue-ledger-amount--due strong {
    color: #dc2626;
}

.revenue-ledger-amount--paid {
    background: #eff6ff;
    border-color: #bfdbfe;
}

.revenue-ledger-amount--paid strong {
    color: #2563eb;
}

.revenue-ledger-amount--balance {
    grid-column: 1 / -1;
    background: #f8fafc;
}

.revenue-ledger-amount--balance.is-due {
    background: #fff7ed;
    border-color: #fed7aa;
}

.revenue-ledger-amount--balance.is-due strong {
    color: #c2410c;
}

.revenue-ledger-amount--balance:not(.is-due) strong {
    color: #059669;
}

.revenue-ledger-mobile-totals {
    margin-top: 0.25rem;
    padding: 0.85rem;
    border-radius: 0.65rem;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #e2e8f0;
}

.revenue-ledger-mobile-totals__title {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #94a3b8;
    margin-bottom: 0.55rem;
}

.revenue-ledger-mobile-totals__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem 0.75rem;
}

.revenue-ledger-mobile-totals__grid > div {
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
    min-width: 0;
}

.revenue-ledger-mobile-totals__grid span {
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #94a3b8;
}

.revenue-ledger-mobile-totals__grid strong {
    font-size: 0.88rem;
    color: #f8fafc;
}

.revenue-ledger-mobile-totals__wide {
    grid-column: 1 / -1;
    padding-top: 0.45rem;
    margin-top: 0.15rem;
    border-top: 1px solid rgba(148, 163, 184, 0.35);
}

@media (min-width: 992px) {
    .revenue-kpi-card__value {
        font-size: 1.25rem;
    }
}

@media (min-width: 1200px) {
    .revenue-kpi-card {
        padding: 1rem 1.1rem;
    }

    .revenue-kpi-card__value {
        font-size: 1.35rem;
    }
}
