/* Estimate create/edit — full-width layout + line items */

.estimateboard-estimate-page {
    --estimateboard-btn-bg: var(--primary-600);
    --estimateboard-btn-bg-hover: var(--primary-700);
    --estimateboard-btn-fg: #fff;
}

/* Estimate header — override Filament h1 text-2xl/3xl */
body.estimateboard-estimate-page .fi-header-heading,
.estimateboard-estimate-page .fi-header-heading {
    font-size: 13px !important;
    font-weight: 600 !important;
    letter-spacing: normal !important;
    line-height: 1.35 !important;
}

.estimateboard-edit-page-title {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    font-size: 13px;
    font-weight: 600;
    gap: 0.5rem;
    line-height: 1.35;
}

.estimateboard-edit-title-sep {
    color: var(--gray-500);
    font-weight: 400;
}

.dark .estimateboard-edit-title-sep {
    color: var(--gray-400);
}

/* Edit estimate header — Send for Approval / Send to Client */
.fi-header-actions .estimateboard-header-btn.fi-btn,
.fi-header-actions .estimateboard-header-btn-approval.fi-btn,
.fi-header-actions .estimateboard-header-btn-client.fi-btn {
    border: none !important;
    border-radius: 6px !important;
    box-shadow: none !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    gap: 6px !important;
    padding: 8px 16px !important;
}

.fi-header-actions .estimateboard-header-btn-approval.fi-btn {
    background-color: #8b5cf6 !important;
    color: #fff !important;
}

.fi-header-actions .estimateboard-header-btn-approval.fi-btn:hover {
    background-color: #7c3aed !important;
}

.fi-header-actions .estimateboard-header-btn-client.fi-btn {
    background-color: #f59e0b !important;
    color: #fff !important;
}

.fi-header-actions .estimateboard-header-btn-client.fi-btn:hover {
    background-color: #d97706 !important;
}

.fi-header-actions .estimateboard-header-btn.fi-btn svg,
.fi-header-actions .estimateboard-header-btn.fi-btn .fi-icon {
    color: #fff !important;
}

/* Header actions (Xero, QB, PDF, mail) — visible spinner on colored buttons */
.fi-header-actions .estimateboard-header-btn.fi-btn .fi-loading-indicator,
.fi-header-actions .estimateboard-header-btn.fi-btn .fi-loading-indicator svg {
    color: #fff !important;
    height: 1.125rem !important;
    opacity: 1 !important;
    stroke: #fff !important;
    stroke-width: 2.5;
    width: 1.125rem !important;
    filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.55));
}

.fi-header-actions .estimateboard-header-btn.fi-btn[disabled] .fi-loading-indicator,
.fi-header-actions .estimateboard-header-btn.fi-btn[disabled] .fi-loading-indicator svg {
    opacity: 1 !important;
}

.fi-header-actions .estimateboard-header-btn-pdf.fi-btn .fi-loading-indicator,
.fi-header-actions .estimateboard-header-btn-pdf.fi-btn .fi-loading-indicator svg {
    color: #fff !important;
    stroke: #fff !important;
}

/* Send email modals submit (#28a8e2) */
.fi-modal-window .estimateboard-modal-submit.fi-btn {
    background: #28a8e2 !important;
    border-color: #28a8e2 !important;
    color: #fff !important;
}

.fi-modal-window .estimateboard-modal-submit.fi-btn:hover {
    background: #1f9fd9 !important;
    border-color: #1f9fd9 !important;
}

.dark .estimateboard-estimate-page {
    --estimateboard-btn-bg: var(--primary-500);
    --estimateboard-btn-bg-hover: var(--primary-400);
    --estimateboard-btn-fg: #fff;
}

.estimateboard-estimate-page .fi-main {
    max-width: none;
}

.estimateboard-estimate-page .fi-page-main {
    max-width: none;
}

.estimateboard-estimate-page .fi-section:not(.estimateboard-line-items-section) {
    margin-bottom: 0.5rem;
}

.estimateboard-line-items-section > .fi-section-header-ctn {
    display: none;
}

.estimateboard-line-items-section .fi-section-content-ctn {
    padding-top: 0;
}

/* Line items — grid repeater inside one bordered box (gallery under description) */
.estimateboard-line-items-table-wrap {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    /* clip (not hidden): hidden makes a scroll container and breaks the sticky drag handle */
    overflow: clip;
    width: 100%;
}

.estimateboard-line-items-header {
    align-items: center;
    background: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    color: #495057;
    display: grid;
    font-size: 0.875rem;
    font-weight: 600;
    grid-template-columns: 48px minmax(0, 1fr) 150px 44px;
    padding: 0.75rem 0;
}

/* Drag column is on the left of each row */
.estimateboard-line-items-header-actions {
    order: -1;
}

.estimateboard-line-items-header-desc {
    padding-right: 0.5rem;
    text-align: left;
}

.estimateboard-line-items-header-qty,
.estimateboard-line-items-header-price,
.estimateboard-line-items-header-amount {
    border-left: 1px solid #dee2e6;
    padding: 0 0.5rem;
    text-align: center;
}

.estimateboard-line-items-table-wrap .estimateboard-line-items-repeater > ul {
    gap: 0;
}

.estimateboard-line-items-table-wrap .estimateboard-line-items-repeater .fi-fo-repeater-item {
    border: none;
    border-bottom: 1px solid #dee2e6;
    border-radius: 0;
    box-shadow: none;
    margin: 0;
}

.estimateboard-line-items-table-wrap .estimateboard-line-items-repeater .fi-fo-repeater-item:last-child {
    border-bottom: none;
}

.estimateboard-line-items-table-wrap .estimateboard-line-items-repeater .fi-fo-repeater-item:hover {
    background: #f8f9fa;
}

/* Repeater row — drag + delete column on the LEFT, sticky while scrolling a tall row */
.estimateboard-line-items-table-wrap .estimateboard-line-items-repeater .fi-fo-repeater-item {
    display: flex;
    flex-direction: row;
}

.estimateboard-line-items-table-wrap .estimateboard-line-items-repeater .fi-fo-repeater-item-content {
    border-left: 1px solid #dee2e6;
    flex: 1 1 auto;
    min-width: 0;
    order: 1;
}

.estimateboard-line-items-table-wrap .estimateboard-line-items-repeater .fi-fo-repeater-item-header {
    align-items: center;
    align-self: stretch;
    background: transparent;
    flex: 0 0 48px;
    flex-direction: column;
    gap: 6px;
    order: 0;
    padding: 12px 6px;
    /* full height = drag handle; icons are sticky (estimate-form-styles.blade.php) */
}

.estimateboard-line-items-table-wrap .estimateboard-line-items-repeater .fi-fo-repeater-item-header-end-actions {
    margin-top: 0.35rem;
}

.estimateboard-line-items-table-wrap .estimateboard-line-items-repeater .estimateboard-line-item-flex.fi-sc-flex {
    align-items: flex-start !important;
    display: flex !important;
    flex-direction: row !important;
    gap: 0 !important;
    width: 100%;
}

.estimateboard-line-items-table-wrap .estimateboard-line-items-repeater .estimateboard-line-item-flex.fi-sc-flex > .fi-growable {
    flex: 1 1 auto;
    min-width: 0;
    width: auto !important;
}

.estimateboard-line-items-table-wrap .estimateboard-line-items-repeater .estimateboard-line-item-flex.fi-sc-flex > div:nth-child(2),
.estimateboard-line-items-table-wrap .estimateboard-line-items-repeater .estimateboard-line-item-flex.fi-sc-flex > div:nth-child(3),
.estimateboard-line-items-table-wrap .estimateboard-line-items-repeater .estimateboard-line-item-flex.fi-sc-flex > div:nth-child(4) {
    align-items: flex-start;
    align-self: flex-start;
    border-left: 1px solid #dee2e6;
    box-sizing: border-box;
    display: flex;
    flex: 0 0 150px;
    justify-content: center;
    max-width: 150px;
    padding: 0 0.5rem;
    width: 150px;
}

.estimateboard-line-items-table-wrap .estimateboard-line-items-repeater .estimateboard-line-item-qty,
.estimateboard-line-items-table-wrap .estimateboard-line-items-repeater .estimateboard-line-item-price,
.estimateboard-line-items-table-wrap .estimateboard-line-items-repeater .estimateboard-line-item-amount {
    margin: 0 auto;
    width: 100%;
}

.estimateboard-line-items-table-wrap .estimateboard-line-items-repeater .estimateboard-line-item-qty .fi-input-wrp,
.estimateboard-line-items-table-wrap .estimateboard-line-items-repeater .estimateboard-line-item-price .fi-input-wrp,
.estimateboard-line-items-table-wrap .estimateboard-line-items-repeater .estimateboard-line-item-amount .fi-input-wrp {
    margin: 0 auto;
    max-width: 5.75rem;
    width: 100%;
}

.estimateboard-line-items-table-wrap .estimateboard-line-items-repeater .fi-fo-repeater-add {
    border-top: 1px solid #dee2e6;
    justify-content: flex-start;
    margin-top: 0;
    padding: 0.75rem;
}

.estimateboard-line-items-table-wrap .estimateboard-line-items-repeater .fi-fo-rich-editor {
    min-height: 12rem;
}

.estimateboard-line-items-table-wrap .estimateboard-line-items-repeater .fi-fo-rich-editor-content {
    min-height: 10rem;
}

.estimateboard-insert-newbox-btn.fi-ac-btn-action {
    background: #6c757d !important;
    border: none !important;
    border-radius: 4px !important;
    box-shadow: none !important;
    color: #fff !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    margin-top: 6px;
    padding: 4px 10px !important;
}

.estimateboard-line-items-table-wrap .estimateboard-line-items-repeater .fi-fo-repeater-add .fi-btn {
    background: var(--estimateboard-btn-bg);
    border-color: var(--estimateboard-btn-bg);
    color: var(--estimateboard-btn-fg);
}

.estimateboard-line-items-table-wrap .estimateboard-line-items-repeater .fi-fo-repeater-add .fi-btn:hover {
    background: var(--estimateboard-btn-bg-hover);
    border-color: var(--estimateboard-btn-bg-hover);
}

/* Address image + gallery uploads: cosmetic overrides only (FilePond positions its own internals). */
.estimateboard-address-image-field {
    margin-bottom: 0.75rem;
    max-width: 100%;
}

.estimateboard-address-image-field .fi-fo-field-label {
    color: rgba(0, 0, 0, 0.75);
    font-size: 0.875rem;
    font-weight: 700;
}

.estimateboard-address-image-upload .filepond--root {
    margin: 0;
    max-width: 220px;
}

.estimateboard-address-image-upload .filepond--panel-root {
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
}

.estimateboard-address-image-upload .filepond--drop-label {
    color: #495057;
    cursor: pointer;
    font-size: 0.875rem;
}

.estimateboard-address-image-upload .filepond--image-preview {
    background: #fff;
}

.estimateboard-gallery-field {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    box-sizing: border-box;
    margin-top: 0.75rem;
    padding: 0.75rem;
    width: 100%;
}

.estimateboard-gallery-field .estimateboard-gallery-header-title {
    color: #495057;
    font-size: 0.75rem;
    font-weight: 600;
}

.estimateboard-gallery-field .estimateboard-gallery-upload-wrap .fi-fo-field-label-col {
    display: none;
}

.estimateboard-gallery-upload .filepond--root {
    margin: 0;
}

.estimateboard-gallery-upload .filepond--panel-root {
    background: transparent;
    border: none;
}

/* Drop label = just the "Add Images" button */
.estimateboard-gallery-upload .filepond--drop-label {
    justify-content: flex-start;
    min-height: 2.25rem;
}

.estimateboard-gallery-upload .filepond--drop-label label {
    padding: 0.25rem 0;
}

.estimateboard-gallery-upload .filepond--label-action {
    align-items: center;
    background: var(--estimateboard-btn-bg, #2563eb);
    border-radius: 4px;
    color: var(--estimateboard-btn-fg, #fff) !important;
    display: inline-flex;
    font-size: 11px;
    font-weight: 600;
    gap: 4px;
    line-height: normal;
    padding: 6px 12px;
    text-decoration: none !important;
}

.estimateboard-gallery-upload .filepond--label-action:hover {
    background: var(--estimateboard-btn-bg-hover, #1d4ed8);
}

/* FilePond grid: fixed item width, FilePond wraps the rows itself */
.estimateboard-gallery-upload .filepond--item {
    width: 80px;
}

.estimateboard-gallery-upload .filepond--image-preview {
    background: #fff;
}

/* No inner white box inside the gray gallery panel */
.estimateboard-gallery-upload.fi-fo-file-upload,
.estimateboard-gallery-upload .fi-fo-file-upload,
.estimateboard-gallery-upload .filepond--root {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
}

.estimateboard-gallery-upload .filepond--item {
    margin: 4px;
}

/* Thumbs: fill the tile (cover) — no letterbox bars or panel corners showing.
   Only the preview internals are touched, never FilePond's item/list positioning. */
.estimateboard-address-image-upload .filepond--item-panel,
.estimateboard-gallery-upload .filepond--item-panel {
    background: transparent !important;
}

.estimateboard-address-image-upload .filepond--image-preview-wrapper,
.estimateboard-gallery-upload .filepond--image-preview-wrapper {
    border-radius: 6px;
    overflow: hidden;
}

.estimateboard-address-image-upload .filepond--image-preview,
.estimateboard-gallery-upload .filepond--image-preview {
    background: #f1f3f5 !important;
}

.estimateboard-address-image-upload .filepond--image-clip,
.estimateboard-gallery-upload .filepond--image-clip {
    height: 100% !important;
    margin: 0 !important;
    width: 100% !important;
}

.estimateboard-address-image-upload .filepond--image-canvas-wrapper,
.estimateboard-address-image-upload .filepond--image-bitmap,
.estimateboard-gallery-upload .filepond--image-canvas-wrapper,
.estimateboard-gallery-upload .filepond--image-bitmap {
    height: 100% !important;
    transform: none !important;
    width: 100% !important;
}

.estimateboard-address-image-upload .filepond--image-bitmap canvas,
.estimateboard-gallery-upload .filepond--image-bitmap canvas {
    display: block;
    height: 100% !important;
    object-fit: cover;
    width: 100% !important;
}

.estimateboard-address-image-upload .filepond--image-preview-overlay,
.estimateboard-address-image-upload .filepond--file-info,
.estimateboard-gallery-upload .filepond--image-preview-overlay,
.estimateboard-gallery-upload .filepond--file-info {
    display: none;
}

/* Upload status text ("Uploading… / Upload complete") does not fit a thumb tile */
.estimateboard-address-image-upload .filepond--file-status,
.estimateboard-address-image-upload .filepond--processing-complete-indicator,
.estimateboard-gallery-upload .filepond--file-status,
.estimateboard-gallery-upload .filepond--processing-complete-indicator {
    display: none !important;
}

/* No dark status band over the photo while/after uploading */
.estimateboard-address-image-upload .filepond--item-panel,
.estimateboard-gallery-upload .filepond--item-panel,
.estimateboard-address-image-upload [data-filepond-item-state] .filepond--item-panel,
.estimateboard-gallery-upload [data-filepond-item-state] .filepond--item-panel {
    background-color: transparent !important;
}

.estimateboard-address-image-upload .filepond--action-remove-item,
.estimateboard-address-image-upload .filepond--action-revert-item-processing,
.estimateboard-gallery-upload .filepond--action-revert-item-processing,
.estimateboard-gallery-upload .filepond--action-remove-item {
    background: rgba(220, 53, 69, 0.9);
    color: #fff;
}

.estimateboard-line-items-table-wrap .estimateboard-line-items-repeater .estimateboard-line-item-qty .fi-input-wrp input,
.estimateboard-line-items-table-wrap .estimateboard-line-items-repeater .estimateboard-line-item-price .fi-input-wrp input,
.estimateboard-line-items-table-wrap .estimateboard-line-items-repeater .estimateboard-line-item-amount .fi-input-wrp input {
    text-align: center;
}

/* Import Template — blue button top-right of description editor */
.estimateboard-line-items-table-wrap .estimateboard-line-description-editor.fi-fo-rich-editor,
.estimateboard-line-items-table-wrap .fi-fo-rich-editor.estimateboard-line-description-editor {
    position: relative;
}

.estimateboard-line-items-table-wrap .estimateboard-line-description-editor .fi-fo-rich-editor-toolbar {
    padding-right: 8.75rem;
}

.estimateboard-line-items-table-wrap button.estimateboard-import-template-tool {
    align-items: center;
    background: var(--estimateboard-btn-bg) !important;
    border: none !important;
    border-radius: 4px !important;
    box-shadow: none !important;
    color: var(--estimateboard-btn-fg) !important;
    cursor: pointer;
    display: inline-flex !important;
    gap: 4px !important;
    height: auto !important;
    min-height: unset !important;
    min-width: unset !important;
    padding: 4px 8px !important;
    position: absolute !important;
    right: 4px;
    top: 4px;
    width: auto !important;
    z-index: 2;
}

.estimateboard-line-items-table-wrap button.estimateboard-import-template-tool:hover {
    background: var(--estimateboard-btn-bg-hover) !important;
}

.estimateboard-line-items-table-wrap button.estimateboard-import-template-tool svg {
    color: #fff !important;
    flex-shrink: 0;
    height: 14px !important;
    width: 14px !important;
}

.estimateboard-line-items-table-wrap .estimateboard-import-template-tool-label {
    color: #fff !important;
    font-size: 11px !important;
    font-weight: 600 !important;
}

.estimateboard-line-items-table-wrap .fi-fo-rich-editor-tool:not(.estimateboard-import-template-tool) {
    /* default Filament tools */
}

.estimateboard-line-items-table-wrap .fi-fo-rich-editor-toolbar-group:has(.estimateboard-import-template-tool) {
    height: 0;
    margin: 0;
    overflow: visible;
    padding: 0;
    width: 0;
}

/* Quill-style text / fill color swatch dropdowns */
.fi-fo-rich-editor-toolbar {
    overflow: visible;
}

.fi-fo-rich-editor-toolbar-group:has(.estimateboard-quill-color-tool) {
    overflow: visible;
}

.estimateboard-quill-color-tool {
    flex: 0 0 auto;
    height: auto;
    min-width: 0;
    position: relative;
    display: inline-flex;
    padding: 0;
    width: auto;
}

.estimateboard-line-items-table-wrap .estimateboard-line-description-editor .fi-fo-rich-editor-toolbar-group:has(.estimateboard-quill-color-tool) {
    flex: 0 0 auto;
    width: auto;
}

.estimateboard-quill-color-trigger {
    align-items: center;
    background: transparent;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
    display: inline-flex;
    height: 2rem;
    justify-content: center;
    padding: 0.25rem 0.375rem;
    width: 2rem;
}

.estimateboard-quill-color-trigger:hover {
    background: rgba(0, 0, 0, 0.05);
}

.dark .estimateboard-quill-color-trigger:hover {
    background: rgba(255, 255, 255, 0.08);
}

.estimateboard-quill-color-trigger.fi-active {
    background: rgba(59, 130, 246, 0.12);
}

.estimateboard-quill-color-icon {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    line-height: 1;
    position: relative;
}

.estimateboard-quill-color-icon-letter {
    font-size: 0.875rem;
    font-weight: 700;
    line-height: 1;
}

.estimateboard-quill-color-icon--text .estimateboard-quill-color-icon-bar {
    background: #e60000;
    border-radius: 1px;
    height: 3px;
    margin-top: 1px;
    width: 1rem;
}

.estimateboard-quill-color-icon--fill .estimateboard-quill-color-icon-fill-bg {
    background-color: #ffff00;
    background-image:
        linear-gradient(45deg, #ccc 25%, transparent 25%),
        linear-gradient(-45deg, #ccc 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #ccc 75%),
        linear-gradient(-45deg, transparent 75%, #ccc 75%);
    background-position: 0 0, 0 3px, 3px -3px, -3px 0;
    background-size: 6px 6px;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 1px;
    height: 0.875rem;
    left: 50%;
    position: absolute;
    top: 50%;
    transform: translate(-50%, -45%);
    width: 0.875rem;
    z-index: 0;
}

.estimateboard-quill-color-icon--fill .estimateboard-quill-color-icon-letter {
    position: relative;
    z-index: 1;
}

.estimateboard-quill-color-picker {
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    box-sizing: border-box;
    display: none;
    gap: 2px;
    grid-template-columns: repeat(7, 1.25rem);
    left: 0;
    padding: 6px;
    position: absolute;
    top: calc(100% + 4px);
    width: max-content;
    z-index: 100;
}

.dark .estimateboard-quill-color-picker {
    background: rgb(31, 41, 55);
    border-color: rgb(75, 85, 99);
}

.estimateboard-quill-color-swatch {
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 2px;
    box-sizing: border-box;
    cursor: pointer;
    height: 1.25rem;
    padding: 0;
    width: 1.25rem;
}

.estimateboard-quill-color-swatch:hover {
    outline: 2px solid #0066cc;
    outline-offset: 1px;
}

/* Totals */
.estimateboard-totals-wrap {
    margin-top: 1rem;
    width: 100%;
}

.estimateboard-totals-box {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-sizing: border-box;
    padding: 1.25rem;
    width: 100%;
}

.estimateboard-totals-box .estimateboard-totals-row {
    align-items: center;
    color: #495057;
    display: flex;
    font-size: 0.875rem;
    justify-content: space-between;
    padding: 0.5rem 0;
}

.estimateboard-totals-box .estimateboard-totals-row--discount {
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 0.75rem;
}

.estimateboard-totals-box .estimateboard-totals-row--total {
    color: #333;
    font-size: 1rem;
    font-weight: 700;
    padding-bottom: 0;
    padding-top: 0.75rem;
}

.estimateboard-totals-box .estimateboard-totals-label {
    flex: 1 1 auto;
}

.estimateboard-totals-box .estimateboard-totals-value {
    flex: 0 0 auto;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

/* Dark mode */
.dark .estimateboard-line-items-repeater .fi-fo-repeater-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.dark .estimateboard-line-items-table-wrap,
.dark .estimateboard-line-items-header,
.dark .estimateboard-line-items-table-wrap .estimateboard-line-items-repeater .fi-fo-repeater-item,
.dark .estimateboard-line-items-table-wrap .estimateboard-line-items-repeater .fi-fo-repeater-item-content > .fi-sc-component > .grid > *:nth-child(n + 2) {
    border-color: rgba(255, 255, 255, 0.1);
}

.dark .estimateboard-line-items-header {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.85);
}

.dark .estimateboard-gallery-upload.fi-fo-file-upload {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

.dark .estimateboard-totals-box {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

.dark .estimateboard-totals-box .estimateboard-totals-row {
    color: rgba(255, 255, 255, 0.85);
}

.dark .estimateboard-totals-box .estimateboard-totals-row--discount {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

.dark .estimateboard-totals-box .estimateboard-totals-row--total {
    color: #fff;
}

/* Templates list */
.fi-page.estimateboard-templates-page .fi-main-ctn {
    max-width: none;
}

.estimateboard-templates-hidden-table {
    display: none !important;
    height: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
    padding: 0 !important;
    visibility: hidden !important;
}

.estimateboard-templates-shell {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    padding: 20px;
    width: 100%;
}

.dark .estimateboard-templates-shell {
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}

.estimateboard-templates-wrap {
    width: 100%;
}

.estimateboard-templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.estimateboard-template-card {
    background: #fff;
    border: 2px solid transparent;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.estimateboard-template-card:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    transform: translateY(-4px);
}

.estimateboard-template-card--active {
    border-color: #28a745;
}

.estimateboard-template-card--inactive {
    border-color: #6c757d;
    opacity: 0.85;
}

.estimateboard-template-card__header {
    align-items: flex-start;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    padding: 20px 20px 15px;
}

.estimateboard-template-card__title {
    color: #333;
    flex: 1;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.3;
    margin: 0;
}

.estimateboard-template-card__badge {
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    padding: 4px 12px;
    text-transform: uppercase;
    white-space: nowrap;
}

.estimateboard-template-card__badge--active {
    background: #d4edda;
    color: #155724;
}

.estimateboard-template-card__badge--inactive {
    background: #e2e3e5;
    color: #6c757d;
}

.estimateboard-template-card__body {
    flex: 1;
    padding: 20px;
}

.estimateboard-template-card__content {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    color: #333;
    font-size: 14px;
    line-height: 1.6;
    max-height: 200px;
    overflow-x: hidden;
    overflow-y: auto;
    overflow-wrap: anywhere;
    padding: 10px;
    word-break: break-word;
}

.estimateboard-template-card__content img,
.estimateboard-template-card__content table {
    max-width: 100%;
}

.estimateboard-template-card__content h1,
.estimateboard-template-card__content h2,
.estimateboard-template-card__content h3,
.estimateboard-template-card__content h4,
.estimateboard-template-card__content h5,
.estimateboard-template-card__content h6 {
    color: #333;
    font-weight: 600;
    margin: 0 0 10px;
}

.estimateboard-template-card__content p {
    color: #555;
    margin: 0 0 8px;
}

.estimateboard-template-card__content ul,
.estimateboard-template-card__content ol {
    margin: 0 0 8px;
    padding-left: 20px;
}

.estimateboard-template-card__content li {
    margin-bottom: 4px;
}

.estimateboard-template-card__content blockquote {
    border-left: 4px solid #2dccfd;
    color: #6c757d;
    font-style: italic;
    margin: 8px 0;
    padding-left: 12px;
}

.estimateboard-template-card__content a {
    color: #2dccfd;
    text-decoration: none;
}

.estimateboard-template-card__content a:hover {
    text-decoration: underline;
}

.estimateboard-template-card__content img {
    border-radius: 4px;
    height: auto;
    margin: 4px 0;
    max-width: 100%;
}

.estimateboard-template-card__actions {
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    padding: 15px 20px;
}

.estimateboard-template-card__btn {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    color: #6c757d;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    padding: 6px 12px;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.estimateboard-template-card__btn:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.estimateboard-template-card__btn--view:hover {
    background: #2dccfd;
    border-color: #2dccfd;
    color: #fff;
}

.estimateboard-template-card__btn--edit:hover {
    background: #28a745;
    border-color: #28a745;
    color: #fff;
}

.estimateboard-template-card__btn--delete:hover {
    background: #dc3545;
    border-color: #dc3545;
    color: #fff;
}

.estimateboard-templates-empty {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    padding: 60px 20px;
    text-align: center;
}

.estimateboard-templates-empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.estimateboard-templates-empty h4 {
    color: #333;
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 10px;
}

.estimateboard-templates-empty p {
    color: #6c757d;
    font-size: 16px;
    margin: 0;
}

.estimateboard-template-preview {
    color: #333;
    font-size: 14px;
    line-height: 1.6;
    max-height: 70vh;
    overflow-y: auto;
    padding: 4px;
}

.estimateboard-template-preview h1,
.estimateboard-template-preview h2,
.estimateboard-template-preview h3,
.estimateboard-template-preview h4 {
    font-weight: 600;
    margin: 0 0 10px;
}

.estimateboard-template-preview p {
    margin: 0 0 8px;
}

.dark .estimateboard-template-card {
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}

.dark .estimateboard-template-card__header,
.dark .estimateboard-template-card__actions {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.1);
}

.dark .estimateboard-template-card__title,
.dark .estimateboard-template-card__content {
    color: rgba(255, 255, 255, 0.9);
}

.dark .estimateboard-template-card__content {
    background: rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.1);
}

.dark .estimateboard-template-card__btn {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.85);
}

@media (max-width: 768px) {
    .estimateboard-templates-grid {
        gap: 15px;
        grid-template-columns: 1fr;
    }

    .estimateboard-template-card__header {
        flex-direction: column;
        gap: 10px;
    }

    .estimateboard-template-card__title {
        text-align: center;
    }

    .estimateboard-template-card__badge {
        align-self: center;
    }
}

/* Qty / Price / Amount stacked in one column */
.estimateboard-line-items-header-pricing {
    border-left: 1px solid #dee2e6;
    padding: 0 8px;
    text-align: center;
}
.estimateboard-line-item-pricing {
    gap: 6px !important;
}
.estimateboard-line-item-pricing .fi-fo-field-label-content,
.estimateboard-line-item-pricing .fi-fo-field-wrp-label span {
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
}
.estimateboard-line-item-pricing .fi-input-wrp {
    max-width: none !important;
}

/* Compact "Add images" boxes */
.estimateboard-gallery-field {
    margin-top: 8px !important;
    padding: 8px 10px !important;
}
.estimateboard-gallery-field,
.estimateboard-gallery-field > .fi-sc,
.estimateboard-gallery-field .fi-sc-component,
.estimateboard-exhibit-images-col,
.estimateboard-exhibit-images-col > .fi-sc {
    gap: 6px !important;
    row-gap: 6px !important;
}
.estimateboard-gallery-upload .filepond--root,
.estimateboard-gallery-upload .filepond--list-scroller {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}
.estimateboard-gallery-upload .filepond--drop-label {
    min-height: 2rem !important;
}
.estimateboard-gallery-upload .filepond--drop-label label {
    padding: 0 !important;
}
.estimateboard-gallery-upload .filepond--label-action svg {
    flex: none;
}
.estimateboard-exhibit-images-col .estimateboard-gallery-field {
    margin-top: 0 !important;
}

/* Exhibit row redesign: header bar, drop zone, one clean editor, link-style add */
.estimateboard-exhibit-head {
    align-items: center;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    gap: 8px;
    padding-bottom: 10px;
}
.estimateboard-exhibit-head .estimateboard-exhibit-letter {
    margin: 0 !important;
}
.estimateboard-exhibit-summary {
    color: #6b7280;
    font-size: 12px;
    font-weight: 400;
}
.estimateboard-exhibit-col-label {
    color: #6b7280 !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    margin-bottom: 0 !important;
}
.estimateboard-exhibit-images-col > .fi-sc,
.estimateboard-exhibit-text-col > .fi-sc {
    gap: 6px !important;
    row-gap: 6px !important;
}
.estimateboard-exhibit-gallery-field {
    background: #fff !important;
    border: 1.5px dashed #cbd5e1 !important;
    border-radius: 8px !important;
    margin-top: 0 !important;
    padding: 10px !important;
}
.estimateboard-exhibit-gallery-field:hover {
    border-color: #2563eb !important;
}
.estimateboard-exhibit-gallery-field .filepond--drop-label {
    justify-content: center !important;
    min-height: 2.75rem !important;
}
.estimateboard-exhibit-gallery-field .filepond--label-action {
    background: transparent !important;
    color: #2563eb !important;
    font-size: 13px !important;
    gap: 6px !important;
    padding: 4px 0 !important;
}
.estimateboard-exhibit-gallery-field .estimateboard-dropzone-or {
    color: #6b7280;
    font-weight: 400;
}
.estimateboard-exhibit-textareas-repeater .fi-fo-repeater-item {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}
.estimateboard-exhibit-textareas-repeater .fi-fo-repeater-item-header {
    border: 0 !important;
    min-height: 0 !important;
    padding: 0 0 4px 0 !important;
}
.estimateboard-exhibit-textareas-repeater .fi-fo-repeater-item:only-child .fi-fo-repeater-item-header {
    display: none !important;
}
.estimateboard-exhibit-textareas-repeater .fi-fo-repeater-item-content {
    border: 0 !important;
    padding: 0 !important;
}
.estimateboard-exhibit-textareas-repeater .fi-fo-repeater-items {
    gap: 10px !important;
}
.estimateboard-exhibit-textareas-repeater,
.estimateboard-exhibit-textareas-repeater.fi-fo-repeater {
    gap: 6px !important;
    row-gap: 6px !important;
}
.estimateboard-exhibit-textareas-repeater .fi-fo-repeater-add {
    justify-content: flex-start !important;
    margin-top: 0 !important;
}
.estimateboard-exhibit-textareas-repeater .fi-fo-repeater-add .fi-btn {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    color: #2563eb !important;
    font-weight: 600 !important;
    padding: 2px 0 !important;
}
.dark .estimateboard-exhibit-gallery-field {
    background: transparent !important;
    border-color: #4b5563 !important;
}
.dark .estimateboard-exhibit-head {
    border-bottom-color: #374151;
}

/* Exhibit header: letter + name field; no purple side bar */
.estimateboard-exhibit-row {
    border-left: 0 !important;
}
.estimateboard-exhibit-name {
    margin-top: -14px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e5e7eb;
}
.dark .estimateboard-exhibit-name {
    border-bottom-color: #374151;
}

/* Variable chips: every {{key}} visible, compact */
.estimateboard-var-chips .fi-ac {
    flex-wrap: wrap !important;
    gap: 6px !important;
}
.estimateboard-var-chip.fi-btn {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    padding: 3px 8px !important;
}
/* "Add row" + "Add Exhibit" in one row */
.estimateboard-add-row-actions {
    border-top: 1px solid #dee2e6;
    padding: 10px 12px !important;
}
.estimateboard-add-row-actions .fi-ac {
    gap: 8px !important;
}

/* Gallery drop label drawn by CSS: always "Add images", whatever text FilePond sets. */
.estimateboard-gallery-upload .filepond--drop-label label {
    font-size: 0 !important;
}
.estimateboard-gallery-upload .filepond--drop-label label {
    white-space: nowrap;
}
.estimateboard-gallery-upload .filepond--drop-label .filepond--label-action {
    font-size: 0 !important;
}
.estimateboard-gallery-upload .filepond--drop-label .filepond--label-action > * {
    display: none !important;
}
.estimateboard-gallery-upload .filepond--drop-label .filepond--label-action::before {
    background-color: currentColor;
    content: "";
    display: inline-block;
    flex: none;
    height: 14px;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.5' stroke='black'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='m2.25 15.75 5.159-5.159a2.25 2.25 0 0 1 3.182 0l5.159 5.159m-1.5-1.5 1.409-1.409a2.25 2.25 0 0 1 3.182 0l2.909 2.909m-18 3.75h16.5a1.5 1.5 0 0 0 1.5-1.5V6a1.5 1.5 0 0 0-1.5-1.5H3.75A1.5 1.5 0 0 0 2.25 6v12a1.5 1.5 0 0 0 1.5 1.5Zm10.5-11.25h.008v.008h-.008V8.25Zm.375 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Z'/%3E%3C/svg%3E") no-repeat center / contain;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.5' stroke='black'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='m2.25 15.75 5.159-5.159a2.25 2.25 0 0 1 3.182 0l5.159 5.159m-1.5-1.5 1.409-1.409a2.25 2.25 0 0 1 3.182 0l2.909 2.909m-18 3.75h16.5a1.5 1.5 0 0 0 1.5-1.5V6a1.5 1.5 0 0 0-1.5-1.5H3.75A1.5 1.5 0 0 0 2.25 6v12a1.5 1.5 0 0 0 1.5 1.5Zm10.5-11.25h.008v.008h-.008V8.25Zm.375 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Z'/%3E%3C/svg%3E") no-repeat center / contain;
    width: 14px;
}
.estimateboard-gallery-upload .filepond--drop-label .filepond--label-action::after {
    content: "Add images";
    font-size: 11px;
}
.estimateboard-exhibit-gallery-field .filepond--drop-label .filepond--label-action::before {
    height: 18px;
    width: 18px;
}
.estimateboard-exhibit-gallery-field .filepond--drop-label .filepond--label-action::after {
    content: "Add images";
    font-size: 13px;
}
.estimateboard-exhibit-gallery-field .filepond--drop-label label::after {
    color: #6b7280;
    content: "or drop here";
    font-size: 13px;
    margin-left: 4px;
}

/* Variable chips: only the first 3 show until "+N more" */
.estimateboard-var-chip-hidden {
    display: none !important;
}
.estimateboard-var-toggle.fi-link {
    font-size: 12px !important;
    font-weight: 600 !important;
}

/* Design pass */
/* 1) Chosen lead: name only — the address line shows in the open list */
.estimateboard-lead-select .fi-select-input-value-label > div + div {
    display: none !important;
}
/* 5) "Add Exhibit" outlined, "+" visible */
.estimateboard-add-exhibit-btn.fi-btn {
    background: #fff !important;
    border: 1px solid var(--estimateboard-btn-bg, #2563eb) !important;
    color: var(--estimateboard-btn-bg, #2563eb) !important;
}
.estimateboard-add-exhibit-btn.fi-btn .fi-icon {
    color: inherit !important;
}
/* 9) Phone: "Add images or drop here" may wrap instead of being cut off */
@media (max-width: 640px) {
    .estimateboard-gallery-upload .filepond--drop-label label {
        white-space: normal !important;
        text-align: center;
        line-height: 1.3;
    }
}

/* Phone: line item stacks — description full width, then Quantity / Price / Amount in one row */
@media (max-width: 768px) {
    .estimateboard-line-items-table-wrap .estimateboard-line-items-repeater .estimateboard-line-item-flex.fi-sc-flex {
        flex-direction: column !important;
        gap: 10px !important;
    }
    .estimateboard-line-items-table-wrap .estimateboard-line-items-repeater .estimateboard-line-item-flex.fi-sc-flex > .fi-growable {
        width: 100% !important;
    }
    .estimateboard-line-items-table-wrap .estimateboard-line-items-repeater .estimateboard-line-item-flex.fi-sc-flex > div:nth-child(2) {
        border-left: 0 !important;
        border-top: 1px solid #dee2e6;
        flex: 1 1 auto !important;
        max-width: none !important;
        padding: 10px 0 0 !important;
        width: 100% !important;
    }
    .estimateboard-line-item-pricing > .fi-grid {
        display: grid !important;
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }
    .estimateboard-line-items-header-pricing {
        display: none !important;
    }
}

/* Phone: "Import Template" sits in the toolbar row instead of covering its icons */
@media (max-width: 768px) {
    .estimateboard-line-items-table-wrap button.estimateboard-import-template-tool {
        position: static !important;
        margin: 2px 4px 4px auto !important;
    }
}

/* "Edit photo" button on gallery photos (photo-edit.js, platform photo editor) */
.estimateboard-gallery-upload .filepond--item .estimateboard-photo-edit-btn,
.estimateboard-address-image-upload .filepond--item .estimateboard-photo-edit-btn {
    align-items: center;
    background: rgba(17, 24, 39, 0.7);
    border: 0;
    border-radius: 999px;
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    height: 24px;
    justify-content: center;
    left: 6px;
    padding: 0;
    position: absolute;
    top: 6px;
    width: 24px;
    z-index: 5;
}
.estimateboard-gallery-upload .filepond--item .estimateboard-photo-edit-btn:hover,
.estimateboard-address-image-upload .filepond--item .estimateboard-photo-edit-btn:hover {
    background: #2563eb;
}
.estimateboard-gallery-upload .filepond--item .estimateboard-photo-edit-btn:disabled,
.estimateboard-address-image-upload .filepond--item .estimateboard-photo-edit-btn:disabled {
    cursor: wait;
    opacity: 0.6;
}

/* Filament's crop / rotate pencil: same size as the draw button so it doesn't touch the remove ✕ on 80px tiles */
.estimateboard-gallery-upload .filepond--item .filepond--action-edit-item,
.estimateboard-address-image-upload .filepond--item .filepond--action-edit-item {
    height: 24px;
    width: 24px;
}

/* List style button + menu (EstimateRichEditorListStyleTool) */
.estimateboard-list-style-tool {
    flex: 0 0 auto;
    position: relative;
}

.fi-fo-rich-editor-toolbar-group:has(.estimateboard-list-style-tool) {
    overflow: visible;
}

.estimateboard-list-style-trigger {
    font-size: 13px;
    font-weight: 700;
    min-width: 2rem;
}

.estimateboard-list-style-menu {
    background: #fff;
    border: 1px solid #e1e8ed;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    left: 0;
    max-height: 360px;
    min-width: 230px;
    overflow-y: auto;
    padding: 6px;
    position: absolute;
    top: calc(100% + 4px);
    z-index: 100;
}

.dark .estimateboard-list-style-menu {
    background: rgb(31, 41, 55);
    border-color: rgb(75, 85, 99);
}

.estimateboard-list-style-heading {
    color: #a0aec0;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.6px;
    padding: 6px 10px 4px;
    text-transform: uppercase;
}

.estimateboard-list-style-option {
    align-items: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    padding: 7px 10px;
    text-align: left;
    width: 100%;
}

.estimateboard-list-style-option:hover,
.estimateboard-list-style-option.is-active {
    background: #f0f4ff;
    border-color: #c7d2fe;
}

.dark .estimateboard-list-style-option:hover,
.dark .estimateboard-list-style-option.is-active {
    background: rgba(99, 102, 241, 0.15);
}

.estimateboard-list-style-sample {
    font-size: 14px;
    font-weight: 600;
}

.estimateboard-list-style-name {
    color: #718096;
    font-size: 12px;
}

/* Editor: arrow / tick bullets (other styles use list-style-type) */
.fi-fo-rich-editor ul[data-list="arrow"] > li::marker {
    content: "\2192  ";
}

.fi-fo-rich-editor ul[data-list="tick"] > li::marker {
    content: "\2713  ";
}
