.dragging {
    opacity: 0.7;
    outline: 2px dashed #6c757d;
}

.saving-container {
    position: relative;
}

.saving-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.spinner {
    width: 1.5rem;
    height: 1.5rem;
    border: 2px solid #c7c7c7;
    border-top-color: #555;
    border-radius: 50%;
    animation: spin .6s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0); }
    to { transform: rotate(360deg); }
}

/* Narrow table layout for Job entries */
.table-narrow .col-handle { width: 32px; }
.table-narrow .col-ord { width: 64px; }
.table-narrow .col-num { width: 90px; }
.table-narrow .col-product { width: 180px; }
.table-narrow .col-price { width: 100px; }
.table-narrow .col-tax { width: 80px; }
.table-narrow .col-planned { width: 180px; }
.table-narrow .col-maint { width: 160px; }
.table-narrow .col-actions { width: 200px; }
.table-narrow .col-desc { width: auto; }

/* Extra small tables for compact sections */
.table-xxs {
    font-size: 0.75rem;
}
.table-xxs th, .table-xxs td {
    padding: 0.25rem 0.5rem;
    vertical-align: middle;
}
.table-xxs .btn-xxs {
    padding: 0.125rem 0.25rem;
    font-size: 0.7rem;
    line-height: 1.2;
}

/* Maintenance Matrix styles */
.maintenance-matrix {
    border: 2px solid #dee2e6;
    border-collapse: separate;
    border-spacing: 0;
    background-color: #f8f9fa;
    width: 100%;
}

.maintenance-matrix thead th {
    background-color: #f8f9fa;
    position: sticky;
    top: 0;
    z-index: 10;
    vertical-align: middle;
    font-size: 0.85rem;
    padding: 0.75rem 0.5rem;
    border: 1px solid #dee2e6;
    white-space: nowrap;
    text-align: center;
}

.maintenance-matrix thead th:first-child {
    text-align: left;
    min-width: 160px;
    max-width: 160px;
}

.maintenance-matrix tbody td {
    vertical-align: middle;
    padding: 0;
    border: 1px solid #dee2e6;
    height: 60px;
}

.maintenance-matrix tbody td:first-child {
    padding: 0.5rem;
    text-align: left;
    min-width: 160px;
    max-width: 160px;
    word-wrap: break-word;
}

.matrix-cell {
    width: 100%;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    background-color: white;
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
    min-width: 100px;
    position: relative;
}

.matrix-cell:hover {
    background-color: rgba(0, 123, 255, 0.1) !important;
    transform: scale(0.98);
    box-shadow: inset 0 0 0 2px rgba(0, 123, 255, 0.3);
}

.matrix-cell i {
    font-size: 1.5rem;
    margin-bottom: 2px;
}

.matrix-cell .bi-check-circle-fill {
    color: #198754;
}

.matrix-cell .bi-circle {
    color: #6c757d;
    opacity: 0.4;
}

.matrix-cell:hover .bi-circle {
    opacity: 0.8;
    color: #0d6efd;
}

.matrix-cell small {
    font-size: 0.7rem;
    line-height: 1;
    font-weight: 500;
}

/* Background colors for completed states */
.matrix-cell.bg-success-subtle {
    background-color: rgba(25, 135, 84, 0.1) !important;
}

.matrix-cell.bg-warning-subtle {
    background-color: rgba(255, 193, 7, 0.1) !important;
}

/* Matrix modal adjustments */
.maintenance-matrix .table-responsive {
    max-height: 65vh;
    overflow: auto;
    border-radius: 0.375rem;
}

.maintenance-matrix .table-responsive::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.maintenance-matrix .table-responsive::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.maintenance-matrix .table-responsive::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.maintenance-matrix .table-responsive::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.input-ord { max-width: 4.5rem; text-align: right; }
.input-num { max-width: 6.5rem; text-align: right; }
.input-planned { max-width: 12rem; }
.input-maint { max-width: 11rem; }
.input-desc { min-width: 18rem; }
html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

/* Drag and drop styling for time tracking */
.time-record-card {
    transition: all 0.2s ease;
}

.time-record-card:hover {
    background-color: rgba(0, 123, 255, 0.1);
}

.time-record-card[draggable="true"]:active {
    opacity: 0.5;
}

.invoice-entry-card.drag-over {
    background-color: rgba(40, 167, 69, 0.1) !important;
    border-left: 4px solid #28a745;
}

.time-record-card.dragging {
    opacity: 0.6;
    transform: scale(0.95);
}

a, .btn-link {
    color: #006bb7;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.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 #258cfb;
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* Job Entry Details Styling - Maximum Space Efficiency */
.job-entry-row {
    background: #e3f2fd;
    border-bottom: 1px solid #bbdefb;
    transition: background-color 0.15s ease;
}

.job-entry-row td {
    background: #e3f2fd !important;
    transition: background-color 0.15s ease;
}

/* Alternate row colors for better visual separation */
.job-entry-row:nth-child(even) {
    background: #d1ecf1;
}

.job-entry-row:nth-child(even) td {
    background: #d1ecf1 !important;
}

.job-entry-row:hover {
    background: #bbdefb;
}

.job-entry-row:hover td {
    background: #bbdefb !important;
}

.entry-details-row {
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

.entry-details-container {
    padding: 0 !important;
}

.entry-details-compact {
    padding: 0.5rem 0.75rem;
    background: #f8f9fa;
    line-height: 1.2;
}

/* Compact Sections - Space Optimized */
.compact-section {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.compact-header {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    color: white;
    padding: 0.4rem 0.6rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8rem;
}

.compact-header i {
    margin-right: 0.3rem;
    font-size: 0.9rem;
}

.compact-actions {
    display: flex;
    gap: 0.25rem;
}

.compact-body {
    padding: 0.3rem 0.5rem;
}

/* Extra small buttons for compact layout */
.btn-xs {
    padding: 0.125rem 0.375rem;
    font-size: 0.7rem;
    line-height: 1.2;
    border-radius: 0.2rem;
}

/* Extra extra small buttons for tables */
.btn-xxs {
    padding: 0.1rem 0.25rem;
    font-size: 0.65rem;
    line-height: 1.1;
    border-radius: 0.2rem;
}

/* Make outline buttons more visible in compact sections */
.compact-section .btn-outline-success,
.compact-section .btn-outline-primary,
.compact-section .btn-outline-info {
    background-color: rgba(255,255,255,0.9);
    font-weight: 500;
}

.compact-section .btn-outline-success:hover {
    background-color: #28a745;
}

.compact-section .btn-outline-primary:hover {
    background-color: #007bff;
}

.compact-section .btn-outline-info:hover {
    background-color: #17a2b8;
}

/* Compact table styling */
.compact-section .table-sm th,
.compact-section .table-sm td {
    padding: 0.2rem 0.4rem;
    vertical-align: middle;
}

/* Compact comments styling */
.compact-section .form-control,
.compact-section .form-control-sm {
    padding: 0.2rem 0.4rem;
    font-size: 0.8rem;
    line-height: 1.2;
}

/* Reduce form spacing in compact sections */
.compact-section .row {
    margin-bottom: 0.15rem;
}

.compact-section .mb-2 {
    margin-bottom: 0.3rem !important;
}

/* Link visibility improvements */
.compact-section input[type="text"].form-control {
    background-color: #f8f9fa;
    border: 1px solid #ced4da;
}

.compact-section .text-muted {
    color: #495057 !important;
}

/* Compact comment and attachment improvements */
.compact-section textarea {
    min-height: 1.8rem !important;
    line-height: 1.2;
    resize: vertical;
}

.compact-section .form-control:focus {
    box-shadow: 0 0 0 0.1rem rgba(0,123,255,.25);
}

/* Better visibility for text inputs in compact sections */
.compact-section input[type="text"],
.compact-section input[type="url"] {
    background-color: white;
    border: 1px solid #ced4da;
    color: #495057;
}

/* Compact spacing for form rows */
.compact-section .row {
    margin-bottom: 0.15rem;
}

.compact-section .row:last-child {
    margin-bottom: 0;
}

/* Reduce line height for better space utilization */
.compact-section {
    line-height: 1.2;
}

.compact-section small {
    line-height: 1.1;
}

/* Comment and attachment line spacing */
.compact-section .d-flex {
    align-items: center;
    min-height: 1.3rem;
    margin-bottom: 0.1rem;
}

.compact-section .d-flex:last-child {
    margin-bottom: 0;
}

/* Database refresh button styling */
.db-refresh-btn {
    padding: 0.1rem 0.3rem;
    font-size: 0.6rem;
    line-height: 1;
    border-radius: 0.2rem;
    margin-left: 0.3rem;
}

/* Compact attachment styling */
.attachment-line {
    padding: 0.1rem 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.8rem;
    line-height: 1.1;
    min-height: 1.2rem;
}

.attachment-line:last-child {
    border-bottom: none;
}

.attachment-link {
    font-size: 0.75rem;
    color: #6c757d;
    text-decoration: none;
}

.attachment-link:hover {
    color: #495057;
    text-decoration: underline;
}

/* Comment list styling */
.comment-list {
    font-size: 0.8rem;
}

.comment-list .border-bottom {
    border-bottom: 1px solid #f0f0f0 !important;
    padding: 0.1rem 0;
    line-height: 1.1;
    min-height: 1.2rem;
}

.comment-list .border-bottom:last-child {
    border-bottom: none !important;
}

/* Override Bootstrap spacing in compact sections */
.compact-section .list-group-item {
    padding: 0.1rem 0.2rem;
}

.compact-section .d-flex.gap-1 {
    gap: 0.125rem !important;
}

.compact-section .py-1 {
    padding-top: 0.1rem !important;
    padding-bottom: 0.1rem !important;
}

/* Make attachment and comment lists ultra compact */
.attachment-list,
.comment-list {
    margin: 0;
}

.attachment-list > div,
.comment-list > div {
    margin-bottom: 0.05rem;
}

.attachment-list > div:last-child,
.comment-list > div:last-child {
    margin-bottom: 0;
}

/* Jobs table compact styling */
.jobs-table {
    font-size: 0.85rem;
}

.jobs-table th,
.jobs-table td {
    padding: 0.3rem 0.5rem;
    vertical-align: middle;
    line-height: 1.2;
}

.jobs-table thead th {
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.4rem 0.5rem;
}

.jobs-table .badge {
    font-size: 0.65rem;
    padding: 0.25rem 0.4rem;
}

/* Jobs page form styling */
h1 + .text-muted + form .form-control-sm,
h1 + .text-muted + form .form-select-sm {
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
    line-height: 1.2;
}

/* Reduce page header spacing */
h1 + .text-muted {
    margin-bottom: 0.5rem !important;
}

/* Jobs page specific optimizations */
.jobs-table tbody tr:hover {
    background-color: rgba(0,123,255,0.05);
}

.jobs-table .badge {
    min-width: 60px;
    text-align: center;
}

/* Make numbers more readable */
.jobs-table .text-end {
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
}

/* Action column optimization */
.jobs-table td:last-child {
    width: 120px;
    padding: 0.2rem 0.4rem;
}

/* Compact form row for jobs filter */
.mb-2 .row.g-1 {
    align-items: end;
}

/* Status badge styling with improved contrast and visibility */
.jobs-table .badge {
    font-weight: 500;
    letter-spacing: 0.02em;
    border: 1px solid;
}

/* Ensure good contrast for all status colors */
.jobs-table .badge.bg-danger {
    background-color: #dc3545 !important;
    border-color: #b02a37 !important;
}

.jobs-table .badge.bg-warning.text-white {
    background-color: #fd7e14 !important;
    border-color: #fd6815 !important;
}

.jobs-table .badge.bg-warning.text-dark {
    background-color: #ffc107 !important;
    border-color: #ffca2c !important;
    color: #212529 !important;
}

.jobs-table .badge.bg-success {
    background-color: #28a745 !important;
    border-color: #34ce57 !important;
}

.jobs-table .badge.bg-secondary {
    background-color: #6c757d !important;
    border-color: #868e96 !important;
}

/* Status-specific hover effects */
.jobs-table tbody tr:hover .badge {
    opacity: 0.9;
    transform: scale(1.02);
    transition: all 0.15s ease;
}

/* Job header form compact styling */
.job-header-form {
    background-color: #f8f9fa;
    padding: 0.75rem;
    border-radius: 0.375rem;
    border: 1px solid #dee2e6;
    margin-bottom: 0.5rem;
}

.job-header-form .form-label {
    margin-bottom: 0.25rem;
    font-weight: 500;
    color: #495057;
}

.job-header-form .form-control-sm,
.job-header-form .form-select-sm {
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
    line-height: 1.2;
}

.job-header-form .col-12 .form-control-sm {
    min-height: 2.2rem;
}

/* Job header title with status badge */
.job-header-title .badge {
    font-size: 0.7rem;
    padding: 0.3rem 0.6rem;
    border: 1px solid;
}

/* Tilaus TBD styling */
.jobs-table td strong:contains("TBD"),
.job-header-title h2:contains("TBD") {
    color: #6c757d;
    font-style: italic;
}

/* Special styling for TBD Tilaus values */
.tilaus-tbd {
    color: #6c757d !important;
    font-style: italic;
    font-weight: normal !important;
}

/* Detail Cards - Kept for backward compatibility but optimized */
.detail-card {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    margin-bottom: 0.5rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.detail-card-header {
    background: linear-gradient(135deg, #6f42c1 0%, #5a2d91 100%);
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 3px 3px 0 0;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.85rem;
}

.detail-card-header i {
    margin-right: 0.4rem;
    font-size: 0.9rem;
}

.detail-card-actions {
    display: flex;
    gap: 0.25rem;
}

.detail-card-body {
    padding: 0.5rem;
}

/* Sub Cards (for forms within detail cards) - Compact */
.sub-card {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 0.25rem;
}

.sub-card-header {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    color: white;
    padding: 0.3rem 0.5rem;
    font-weight: 500;
    font-size: 0.75rem;
}

.sub-card-header i {
    margin-right: 0.25rem;
}

.sub-card-body {
    padding: 0.5rem;
}

/* Color coding for different detail card types */
.detail-card:has(.detail-card-header i.bi-currency-euro) .detail-card-header {
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
}

.detail-card:has(.detail-card-header i.bi-plus-square) .detail-card-header {
    background: linear-gradient(135deg, #fd7e14 0%, #e55a00 100%);
}

.detail-card:has(.detail-card-header i.bi-calendar-range) .detail-card-header {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
}

.detail-card:has(.detail-card-header i.bi-chat-left-text) .detail-card-header {
    background: linear-gradient(135deg, #6c757d 0%, #545b62 100%);
}

.detail-card:has(.detail-card-header i.bi-paperclip) .detail-card-header {
    background: linear-gradient(135deg, #20c997 0%, #17a2b8 100%);
}

/* Empty state styling - Compact */
.text-muted.text-center {
    padding: 0.5rem;
    font-style: italic;
}

.text-muted.text-center i {
    font-size: 1rem;
    margin-right: 0.3rem;
    opacity: 0.6;
}

/* Table improvements within cards - Compact */
.compact-section .table-hover tbody tr:hover,
.detail-card .table-hover tbody tr:hover {
    background-color: rgba(0,0,0,.02);
}

.compact-section .table-responsive,
.detail-card .table-responsive {
    border-radius: 3px;
    overflow: hidden;
}

.compact-section .table-sm,
.detail-card .table-sm {
    font-size: 0.8rem;
}

.compact-section .table-sm th,
.compact-section .table-sm td {
    padding: 0.25rem 0.5rem;
}

/* Time Tracking UI Styles */
.time-record-card {
    border: 1px solid #dee2e6;
    transition: all 0.15s ease;
    cursor: grab;
}

.time-record-card:hover {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-color: #007bff;
}

.time-record-card.border-primary {
    border-color: #007bff !important;
    background-color: rgba(0, 123, 255, 0.05);
}

.time-record-card:active {
    cursor: grabbing;
}

.invoice-entry-card {
    border: 1px solid #dee2e6;
    transition: all 0.15s ease;
    min-height: 60px;
}

.invoice-entry-card:hover {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-color: #28a745;
}

.invoice-entry-card.drag-over {
    border-color: #007bff !important;
    background-color: rgba(0, 123, 255, 0.1) !important;
    border-style: dashed !important;
}

.time-records-list {
    max-height: 500px;
    overflow-y: auto;
}

.time-records-list::-webkit-scrollbar {
    width: 6px;
}

.time-records-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.time-records-list::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.time-records-list::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Status indicators */
.badge.bg-warning.text-dark {
    background-color: #ffc107 !important;
    color: #212529 !important;
}

/* Responsive adjustments for split view */
@media (max-width: 991.98px) {
    .time-tracking-split .col-lg-6 {
        margin-bottom: 1rem;
    }
    
    .time-records-list {
        max-height: 300px;
    }
}

/* Unlink buttons - clear trash icon styling */
.btn-sm.btn-danger {
    border-radius: 4px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
    transition: all 0.15s ease !important;
    min-width: 24px !important;
    height: 20px !important;
}

.btn-sm.btn-danger:hover {
    background-color: #b02a37 !important;
    border-color: #b02a37 !important;
    transform: scale(1.05);
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.3);
}

.btn-sm.btn-danger i {
    font-size: 11px !important;
}

/* Tree Line Debug Styling */
.tree-line {
    /* Base styling for all tree lines - keeps original functionality */
    transition: opacity 0.2s ease;
}

/* Debug hover effects to help identify different line types */
.tree-line:hover {
    opacity: 0.7;
}

/* Different line type styling when debugging is enabled */
body.tree-debug .tree-parent-continuation {
    background: #e74c3c !important; /* Red for parent continuations */
}

body.tree-debug .tree-vertical-full {
    background: #3498db !important; /* Blue for T-shape vertical */
}

body.tree-debug .tree-vertical-half {
    background: #2ecc71 !important; /* Green for L-shape vertical */
}

body.tree-debug .tree-horizontal {
    background: #f39c12 !important; /* Orange for horizontal connectors */
}

body.tree-debug .tree-instance-parent-continuation {
    background: #e67e22 !important; /* Dark orange for instance parent continuations */
}

body.tree-debug .tree-instance-current-level {
    background: #9b59b6 !important; /* Purple for instance current level */
}

body.tree-debug .tree-instance-vertical {
    background: #1abc9c !important; /* Teal for instance vertical lines */
}

body.tree-debug .tree-instance-horizontal {
    background: #34495e !important; /* Dark gray for instance horizontal lines */
}

/* Debug tooltip styling */
body.tree-debug .tree-line::after {
    content: attr(data-line-type);
    position: absolute;
    top: -20px;
    left: 0;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 2px 5px;
    font-size: 9px;
    border-radius: 3px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    z-index: 1000;
    transition: opacity 0.2s ease;
}

body.tree-debug .tree-line:hover::after {
    opacity: 1;
}