/* CheckUtilities CRM */
.cu-stage-panel { border: 2px solid rgb(13 148 136); border-radius: 0.75rem; overflow: hidden; margin-bottom: 1.5rem; background: white; }
.dark .cu-stage-panel { background: rgb(31 41 55); }
.cu-stage-header { background: linear-gradient(90deg, rgb(13 148 136), rgb(20 184 166)); color: white; padding: 1rem 1.25rem; cursor: pointer; border: none; text-align: left; transition: filter 0.15s; }
.cu-stage-header:hover { filter: brightness(1.08); }
.cu-stage-title { font-size: 1.125rem; font-weight: 700; letter-spacing: 0.05em; }
.cu-stage-body { padding: 0; }

.fi-wi:nth-of-type(1) .cu-stage-panel { border-color: rgb(13 148 136); }
.fi-wi:nth-of-type(1) .cu-stage-header { background: linear-gradient(90deg, rgb(13 148 136), rgb(20 184 166)); }
.fi-wi:nth-of-type(2) .cu-stage-panel { border-color: rgb(217 119 6); }
.fi-wi:nth-of-type(2) .cu-stage-header { background: linear-gradient(90deg, rgb(217 119 6), rgb(245 158 11)); }
.fi-wi:nth-of-type(3) .cu-stage-panel { border-color: rgb(5 150 105); }
.fi-wi:nth-of-type(3) .cu-stage-header { background: linear-gradient(90deg, rgb(5 150 105), rgb(16 185 129)); }
.fi-wi:nth-of-type(4) .cu-stage-panel { border-color: rgb(75 85 99); }
.fi-wi:nth-of-type(4) .cu-stage-header { background: linear-gradient(90deg, rgb(75 85 99), rgb(107 114 128)); }

.fi-wi { margin-bottom: 0 !important; }
.cu-stage-panel .fi-ta-header-toolbar { display: none !important; }

.fi-ta-content,
div.fi-ta-content { overflow-x: auto !important; overflow-y: visible !important; max-height: none !important; }
.cu-stage-panel .fi-ta-content::-webkit-scrollbar { height: 0; }
.cu-stage-panel .fi-ta-content { scrollbar-width: none; }

.cu-global-scroll-bar { position: fixed; bottom: 0; z-index: 50; height: 16px; overflow-x: auto; overflow-y: hidden; background: rgb(15 23 42); border-top: 1px solid rgb(13 148 136); display: none; }
.cu-global-scroll-inner { height: 1px; }
.cu-global-scroll-bar::-webkit-scrollbar { height: 16px; }
.cu-global-scroll-bar::-webkit-scrollbar-track { background: rgb(15 23 42); }
.cu-global-scroll-bar::-webkit-scrollbar-thumb { background: rgb(13 148 136); border-radius: 8px; border: 2px solid rgb(15 23 42); }
.cu-global-scroll-bar::-webkit-scrollbar-thumb:hover { background: rgb(15 118 110); }
.fi-main { padding-bottom: 24px !important; }

/* === FULL-WIDTH FLAT CELLS — fill the column, no floating boxes === */

/* Cells stretch full width */
.cu-stage-panel .fi-ta-cell {
    padding: 0 !important;
}

/* Inputs/selects fill the entire cell */
.cu-stage-panel .fi-ta-cell input:not([type="checkbox"]):not([type="radio"]),
.cu-stage-panel .fi-ta-cell select,
.cu-stage-panel .fi-ta-cell .fi-input-wrp,
.cu-stage-panel .fi-ta-cell .fi-fo-input-wrp,
.cu-stage-panel table input:not([type="checkbox"]):not([type="radio"]),
.cu-stage-panel table select {
    width: 100% !important;
    display: block !important;
    background: transparent !important;
    background-color: transparent !important;
    border: 0 !important;
    border-color: transparent !important;
    box-shadow: none !important;
    --tw-ring-shadow: none !important;
    --tw-ring-color: transparent !important;
    outline: 0 !important;
    padding: 0.75rem 1rem !important;
    border-radius: 0 !important;
    color: inherit !important;
    transition: background-color 0.12s !important;
    margin: 0 !important;
}

/* Wrapper containers — also full-width and flat */
.cu-stage-panel .fi-ta-cell > div,
.cu-stage-panel .fi-ta-cell .fi-input-wrp,
.cu-stage-panel .fi-ta-cell .fi-fo-input-wrp {
    width: 100% !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
    border-radius: 0 !important;
}

/* Hover row — tint the WHOLE row, not individual cells */
.cu-stage-panel .fi-ta-row:hover {
    background: rgba(13, 148, 136, 0.06) !important;
}

/* Hovered CELL gets a slightly stronger tint to show which one's active */
.cu-stage-panel .fi-ta-cell:hover {
    background: rgba(13, 148, 136, 0.10) !important;
}

/* Focus — fill cell with teal tint, no border/box */
.cu-stage-panel input:not([type="checkbox"]):not([type="radio"]):focus,
.cu-stage-panel select:focus {
    background: rgba(13, 148, 136, 0.15) !important;
    background-color: rgba(13, 148, 136, 0.15) !important;
    box-shadow: inset 0 -2px 0 rgb(13 148 136) !important;
    outline: 0 !important;
    border-radius: 0 !important;
}

/* Hide native dropdown arrow until hover */
.cu-stage-panel select { appearance: none !important; -webkit-appearance: none !important; -moz-appearance: none !important; }
.cu-stage-panel .fi-ta-row:hover select,
.cu-stage-panel select:focus { appearance: auto !important; -webkit-appearance: menulist !important; }


/* === Checkbox column not clipped by panel border === */
.cu-stage-panel table thead tr th:first-child,
.cu-stage-panel table tbody tr td:first-child {
    padding-left: 1rem !important;
    padding-right: 0.25rem !important;
    min-width: 2.5rem !important;
    width: 2.5rem !important;
}
.cu-stage-panel .fi-ta-record-checkbox,
.cu-stage-panel .fi-checkbox-input {
    margin-left: 0.25rem !important;
}


/* === Resize handle on column headers === */
.cu-stage-panel thead th { position: relative; }
.cu-resize-handle {
    position: absolute;
    right: 0; top: 0; bottom: 0;
    width: 6px;
    cursor: col-resize;
    user-select: none;
    z-index: 3;
}
.cu-resize-handle:hover {
    background: rgba(13, 148, 136, 0.4);
}

/* === Reorder cursor on draggable headers === */
.cu-stage-panel thead th[draggable="true"] {
    cursor: grab;
}
.cu-stage-panel thead th[draggable="true"]:active {
    cursor: grabbing;
}


/* === Sticky CHECKBOX + NAME + NOTES — opaque, high z-index, clear right edge === */
.cu-stage-panel table { border-collapse: separate !important; border-spacing: 0 !important; }

.cu-stage-panel table thead tr th:nth-child(1),
.cu-stage-panel table tbody tr td:nth-child(1) {
    position: sticky !important;
    left: 0 !important;
    z-index: 30 !important;
    background-color: rgb(15 23 42) !important;
    background-image: none !important;
}
.cu-stage-panel table thead tr th:nth-child(2),
.cu-stage-panel table tbody tr td:nth-child(2) {
    position: sticky !important;
    left: var(--cu-name-offset, 2.5rem) !important;
    z-index: 29 !important;
    background-color: rgb(15 23 42) !important;
    background-image: none !important;
}
.cu-stage-panel table thead tr th:nth-child(3),
.cu-stage-panel table tbody tr td:nth-child(3) {
    position: sticky !important;
    left: var(--cu-notes-offset, 14rem) !important;
    z-index: 28 !important;
    background-color: rgb(15 23 42) !important;
    background-image: none !important;
    border-right: 2px solid rgb(13 148 136) !important;
    box-shadow: 4px 0 6px -2px rgba(0, 0, 0, 0.5) !important;
}

/* Striped rows: the sticky cells follow the row's tint */
.cu-stage-panel table tbody tr:nth-child(odd) td:nth-child(1),
.cu-stage-panel table tbody tr:nth-child(odd) td:nth-child(2),
.cu-stage-panel table tbody tr:nth-child(odd) td:nth-child(3) {
    background-color: rgb(20 30 50) !important;
}
.cu-stage-panel table tbody tr:hover td:nth-child(1),
.cu-stage-panel table tbody tr:hover td:nth-child(2),
.cu-stage-panel table tbody tr:hover td:nth-child(3) {
    background-color: rgb(13 30 38) !important;
}

/* Header row: explicit dark background for sticky thead cells */
.cu-stage-panel table thead tr th:nth-child(1),
.cu-stage-panel table thead tr th:nth-child(2),
.cu-stage-panel table thead tr th:nth-child(3) {
    background-color: rgb(10 18 30) !important;
    z-index: 50 !important;
}


/* === Bulk action toolbar branding === */
.fi-ta-selection-indicator {
    background: linear-gradient(90deg, rgb(13 148 136), rgb(20 184 166)) !important;
    color: white !important;
    border: 0 !important;
}
.fi-ta-selection-indicator * { color: white !important; }
.fi-ta-selection-indicator button { color: white !important; border-color: rgba(255,255,255,0.3) !important; }

/* === Activity feed styling === */
.cu-activity-feed { border: 1px solid rgb(51 65 85); border-radius: 0.5rem; overflow: hidden; }
.cu-activity-header { background: rgb(15 23 42); color: rgb(94 234 212); padding: 0.625rem 1rem; font-weight: 700; font-size: 0.875rem; letter-spacing: 0.05em; text-transform: uppercase; }
.cu-activity-body { background: rgb(20 30 50); padding: 0.5rem; }
.cu-activity-item { display: flex; gap: 1rem; padding: 0.5rem 0.75rem; border-bottom: 1px solid rgba(13, 148, 136, 0.15); }
.cu-activity-item:last-child { border-bottom: 0; }
.cu-activity-when { color: rgb(148 163 184); font-size: 0.8rem; min-width: 6rem; }
.cu-activity-text { flex: 1; font-size: 0.875rem; color: rgb(226 232 240); }
.cu-activity-text a { color: rgb(94 234 212); text-decoration: underline; }
.cu-activity-empty { padding: 0.75rem; color: rgb(148 163 184); font-size: 0.875rem; }
