:root{
    --modal-content-background-color: #fff;
    --placement-font-color: #757575;
    --calendar-icon: url('/caddy/images/icons/calendar/Light Date icon.png');
}

body.dark {
    --modal-content-background-color: #141314;
    --calendar-icon: url('/caddy/images/icons/calendar/Dark Date icon.png');
}

/* Modal background overlay */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    inset: 0;
    background-color: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 16px;
    overflow: hidden;
    box-sizing: border-box;
}

.modal-content {
    background-color: var(--modal-content-background-color);
    color: var(--font-color);
    padding: 20px;
    border: 2px solid var(--background-color);
    border-radius: 12px;
    width: 400px;
    max-width: min(80%, 960px);
    max-height: calc(100vh - 32px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    position: relative;
    overflow-y: auto;
    box-sizing: border-box;
}

/* Floating, non-dimming checkout window (estimate page). The overlay is click-through
   so the estimate behind it stays interactive; only the window itself captures input.
   JS sets an explicit left/top/width/height and persists them. */
.modal.modal-floating {
    background-color: transparent;
    pointer-events: none;
    display: block;
    padding: 0;
}

.modal.modal-floating .modal-content {
    pointer-events: auto;
    position: fixed;
    margin: 0;
    max-width: none;
    max-height: none;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 32px rgba(0,0,0,0.4);
}

/* Header stays put as the drag grip; the form scrolls within the fixed window height. */
.checkout-floating > h2,
.checkout-floating > .checkout-header {
    flex: 0 0 auto;
}

.checkout-floating .modal-form {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
}

.checkout-floating .checkout-drag-handle {
    cursor: move;
    user-select: none;
    touch-action: none;
}

/* Bottom-right resize grip, pinned to the visible window corner. */
.checkout-floating .checkout-resize-handle {
    position: absolute;
    right: 2px;
    bottom: 2px;
    width: 16px;
    height: 16px;
    cursor: nwse-resize;
    touch-action: none;
    opacity: 0.55;
    z-index: 3;
    background: linear-gradient(
        135deg,
        transparent 0 45%,
        var(--font-color) 45% 55%,
        transparent 55% 70%,
        var(--font-color) 70% 80%,
        transparent 80%
    );
}

.checkout-floating .checkout-resize-handle:hover {
    opacity: 1;
}

.modal-content h2{
    margin-top: 0;
    color: var(--secondary-color);
    font-weight: 800;
    font-size: 1.5rem;
}

/* Header text */
.modal-content h2 {
    margin-top: 0;
    color: var(--secondary-color);
    font-weight: 700;
    font-size: 1.5rem;
    /* margin-bottom: 5px; */
}

.modal-content label {
    display: block;
    margin-top: 10px;
    font-weight: 600;
}

.modal-content input,
.modal-content input:focus,
.modal-content input:active {
    min-width: 96.5%;
    padding: 8px;
    margin-top: 5px;
    font-size: .9rem;
    font-weight: 500;
    border: 2px solid var(--background-color);
    border-radius: 6px;
    color: var(--font-color);
    background-color: var(--background-color) !important;
    outline: none;
    box-shadow: none;
}

.modal-content select {
    width: 100%;
    padding: 8px;
    margin-top: 5px;
    font-size: .9rem;
    font-weight: 500;
    border: 2px solid var(--background-color);
    border-radius: 6px;
    background-color: var(--background-color);
    margin-right: 5px;
    color: var(--font-color);
}

.modal-content input:focus {
    border-color: var(--sub-background-color);
    outline: none;
}

/* Compile Modal */
.download-group {
    margin-bottom: 1rem;
}

.download-group h3 {
    margin: 0 0 0.4rem 0;
    font-size: 1rem;
}

.download-options {
    display: grid;
    grid-template-columns: 150px 150px; /* Two equal-width columns */
    gap: 10px 20px; /* row gap, column gap */
}

.download-options label {
    display: flex;
    align-items: center;
    gap: 6px; /* Space between checkbox and text */
}

/* Wrapper for input + icon */
.date-input-wrapper {
  position: relative;
  width: 100%;
}

/* Date Input Styling */
.modal-content input#projectDate {
  width: 95%;
  border: 1px solid var(--accent-color);
  border-radius: 6px;
  background-color: var(--modal-content-background-color);
  color: var(--font-color);
  font-size: .9rem;
  font-weight: 500;
  cursor: pointer;
}

.modal-content input#projectDate:focus {
  border-color: var(--accent-color-strong);
  outline: none;
}

/* Real clickable calendar icon */
.calendar-icon {
  position: absolute;
  right: 10px;
  top: 55%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  background-image: var(--calendar-icon);
  background-size: cover;
  background-repeat: no-repeat;
  cursor: pointer;
}

/* Flatpickr popup styling */
.flatpickr-calendar {
  background: var(--background-color) !important;
  border: 1px solid var(--accent-color) !important;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}
/* Days */
.flatpickr-day {
  color: var(--font-color) !important;
}
.flatpickr-day:hover {
  background: var(--secondary-color) !important;  
  color: var(--background-color) !important;  
}
.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange,
.flatpickr-day.inRange {
  background: var(--primary-accent-color) !important;
  color: var(--background-color) !important;  
  font-weight: bold !important;
}
/* Weekday labels (Sun–Sat) */
span.flatpickr-weekday {
  background: var(--background-color) !important;
  color: var(--font-color) !important;
  font-weight: 600 !important;
  padding: 4px 0 !important;
  border: none !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
}
/* Month bar */
.flatpickr-months .flatpickr-month {
  background: var(--secondary-accent-color) !important;
  color: var(--font-color) !important;
  border-radius: 2px 2px 0 0 !important;
  padding: 2px 0 !important;
}
/* Month dropdown */
.flatpickr-monthDropdown-months {
  background: var(--secondary-accent-color) !important;
  color: var(--font-color) !important;
  padding: 2px 6px !important;
  font-weight: bold !important;
  cursor: pointer !important;
}
.flatpickr-monthDropdown-months option {
  background: var(--background-color) !important;
  color: var(--font-color) !important;
  text-align: center !important;
}
/* Year input */
.flatpickr-current-month .numInputWrapper input {
  background: transparent !important;
  color: var(--font-color) !important;
  font-weight: bold !important;
  border: none !important;
  outline: none !important;
  text-align: center !important;
  padding-right: 10px !important;
}
.flatpickr-current-month .numInputWrapper span {
  margin-left: 10px !important; 
}
/* Year up/down arrows */
.flatpickr-current-month .numInputWrapper span.arrowUp:after,
.flatpickr-current-month .numInputWrapper span.arrowDown:after {
  border-bottom-color: var(--font-color) !important;
  border-top-color: var(--font-color) !important;
}
/* Arrows */
.flatpickr-prev-month, 
.flatpickr-next-month {
  color: var(--font-color) !important;
  fill: var(--font-color) !important;
}

.required-star {
  color: red;
  margin-left: 4px;
  font-weight: bold;
}

#dropdownSelected{    
    position: relative;
    width: 95%;
    padding: 8px;
    margin-top: 5px;
    font-size: .9rem;
    font-weight: 400;
    border: 2px solid var(--background-color);
    border-radius: 6px;
    background-color: var(--modal-content-background-color);
    color: var(--placement-font-color);

    img{
        opacity: .7;
        position: absolute;
        right: 10px;
        top: 50%;
        transform: translateY(-50%);
        width: 10px;
        height: 10px;
    }
}

#dropdownSelected:hover {
    cursor: pointer;
    opacity: 1;
}

#dropdownList{
    display: none;
    position: relative;
    z-index: 1000;
    background-color: var(--modal-content-background-color);
    border: 2px solid var(--background-color);
    border-radius: 6px;
    width: 99%;
    max-height: 200px;
    overflow-y: auto;
}

.dropdown-option {
    padding: 8px;
    font-size: .9rem;
    font-weight: 500;
    color: var(--font-color);
    border: none;
}

.dropdown-option:hover {
    background-color: var(--secondary-accent-color);
    color: var(--font-color);
    cursor: pointer;
}

.modal-content button:not(.custom-dropdown-trigger):not(.custom-dropdown-option):not(.de-copy-project-nav-btn):not(.admin-item-spec-sheet-delete-btn):not(.hour-rate-add-btn):not(.hour-rate-remove-btn) {
    margin-top: 15px;
    background-color: color-mix(in srgb, var(--secondary-accent-color) 18%, var(--background-color));
    color: var(--font-color);
    font: inherit;
    font-weight: 600;
    min-width: 100px;
    padding: 4px 8px;
    border: 1px solid var(--primary-accent-color);
    border-radius: 10px;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.modal-content:not(.duplicate-project-modal):not(.modal-two-tone-question-wrap) button:not(.custom-dropdown-trigger):not(.custom-dropdown-option):hover {
    border-color: var(--primary-color);
    background-color: var(--secondary-color);
}

.modal-content.modal-two-tone .modal-form .custom-dropdown-trigger {
    min-height: 40px;
    height: 40px;
    padding: 0 32px 0 12px;
    background: var(--background-color);
}

.button-row, .project-button-row {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.modal-content p {
  white-space: pre-line; 
}

/* Close button (X) */
.close {
    color: var(--font-color);
    position: absolute;
    top: 14px;
    right: 16px;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    margin: 0;
    float: none;
    z-index: 5;
}

.modal-content.modal-two-tone > .close {
    top: 16px;
    right: 18px;
}

.modal-content.modal-two-tone > h2 {
    padding-right: 56px;
}

/* Close hover effect */
.close:hover {
    color: var(--secondary-color);
}

/* Action button inside modal */
.modal-action {
    margin-top: 15px;
    background-color: color-mix(in srgb, var(--secondary-accent-color) 18%, var(--background-color));
    color: var(--font-color);
    font: inherit;
    font-weight: 600;
    border: 1px solid var(--primary-accent-color);
    padding: 10px 20px;
    border-radius: 10px;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.modal-action:hover {
    border-color: var(--primary-color);
    background-color: var(--secondary-color);
}

/* Scrollbar Styling */
.dropdown-list::-webkit-scrollbar {
  width: 6px;
}
.dropdown-list::-webkit-scrollbar-track {
  background: transparent;
}
.dropdown-list::-webkit-scrollbar-thumb {
  background-color: var(--accent-color);
  border-radius: 4px;
}
.dropdown-list::-webkit-scrollbar-thumb:hover {
  background-color: var(--background-color);
}
.dropdown-list::-webkit-scrollbar-button {
  display: none;
  height: 0;
}
.dropdown-list {
  scrollbar-color: var(--background-color);
}

/* shared project log */
.chat-modal {
    width: 600px;
    max-height: 80vh;
    overflow: hidden;
}

.chat-log-container {
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 10px;
}

.chat-entry {
    padding: 12px;
    border-bottom: 1px solid #444;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    margin-bottom: 6px;
    opacity: 0.8;
}

.chat-body {
    font-size: 15px;
}

/* unread dot on logs */
.chat-entry.unread {
    background-color: rgba(210, 63, 63, 0.08);
}

.chat-entry .chat-meta {
    font-size: 0.8rem;
    opacity: 0.8;
    display: flex;
    align-items: center;
    gap: 6px;
}

.chat-unread-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background-color: var(--primary-accent-color, #d23f3f);
    flex-shrink: 0;
}

.chat-entry .chat-message {
    margin-top: 2px;
}

.modal-form textarea {
    width: 100%;
    min-height: 110px;
    padding: 0.75rem 0.9rem;
    border: 1px solid var(--accent-color);
    border-radius: 8px;
    font: inherit;
    line-height: 1.4;
    color: var(--font-color);
    background: var(--background-color);
    resize: vertical;
    box-sizing: border-box;
}

.modal-form textarea:focus-visible {
    outline: none;
}

.modal-form input,
.modal-form textarea {
    margin-top: 0.35rem;
}

.estimate-material-choice-option {
    display: block;
    margin-bottom: 0.75rem;
    cursor: pointer;
}

.estimate-material-choice-option input[type="radio"],
.estimate-material-choice-option input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.estimate-material-choice-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
    flex-wrap: wrap;
}

.estimate-material-choice-help {
    font-size: 0.9rem;
    color: var(--font-color);
    opacity: 0.75;
}

.estimate-material-choice-toolbar-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.estimate-material-choice-link-btn {
    border: none !important;
    background: transparent;
    font: inherit;
    padding: 0.2rem 0.2rem !important;
}

.estimate-material-choice-card {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--accent-color);
    border-radius: 10px;
    background: var(--background-color);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.estimate-material-choice-option:hover .estimate-material-choice-card {
    border-color: var(--primary-accent-color);
    background: color-mix(in srgb, var(--secondary-accent-color) 8%, var(--background-color));
}

.estimate-material-choice-option input[type="radio"]:checked + .estimate-material-choice-card,
.estimate-material-choice-option input[type="checkbox"]:checked + .estimate-material-choice-card {
    border-color: var(--primary-accent-color);
    background: color-mix(in srgb, var(--secondary-accent-color) 14%, var(--background-color));
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--secondary-accent-color) 18%, transparent);
}

.estimate-material-choice-dot {
    width: 18px;
    height: 18px;
    margin-top: 0.1rem;
    border: 2px solid var(--accent-color);
    border-radius: 50%;
    background: var(--background-color);
    position: relative;
    flex: 0 0 18px;
    box-sizing: border-box;
}

.estimate-material-choice-option input[type="checkbox"] + .estimate-material-choice-card .estimate-material-choice-dot {
    border-radius: 5px;
}

.estimate-material-choice-option input[type="radio"]:checked + .estimate-material-choice-card .estimate-material-choice-dot,
.estimate-material-choice-option input[type="checkbox"]:checked + .estimate-material-choice-card .estimate-material-choice-dot {
    border-color: var(--primary-accent-color);
}

.estimate-material-choice-option input[type="radio"]:checked + .estimate-material-choice-card .estimate-material-choice-dot::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary-accent-color);
    transform: translate(-50%, -50%);
}

.estimate-material-choice-option input[type="checkbox"]:checked + .estimate-material-choice-card .estimate-material-choice-dot::after {
    content: "";
    position: absolute;
    left: 5px;
    top: 1px;
    width: 4px;
    height: 9px;
    border: solid var(--primary-accent-color);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.estimate-material-choice-content {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}

.estimate-material-choice-content strong {
    font-size: 0.98rem;
    color: var(--font-color);
}

.estimate-material-choice-meta {
    font-size: 0.9rem;
    color: var(--font-color);
    opacity: 0.75;
    line-height: 1.35;
}

.estimate-material-choice-option-neither {
    margin-top: 1rem;
}

/* Two-tone modal layout */
.modal-content.modal-two-tone {
    padding: 0;
    overflow-y: auto;
    overflow-x: hidden;
    width: min(860px, 92vw);
    max-width: 92vw;
    max-height: calc(100vh - 32px);
}

.modal-content.modal-two-tone h2 {
    margin: 0;
    padding: 18px 22px;
    background: color-mix(in srgb, var(--sub-background-color) 78%, var(--background-color) 22%);
    /* border-bottom: 1px solid var(--accent-color); */
}

.modal-content.modal-two-tone p {
    margin: 0;
}

.modal-content.modal-two-tone .modal-form {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 10px;
    padding-top: 5px;
    padding-right: 10px;
    align-items: start;
    background:
        linear-gradient(
            to right,
            color-mix(in srgb, var(--sub-background-color) 78%, var(--background-color) 22%) 0,
            color-mix(in srgb, var(--sub-background-color) 78%, var(--background-color) 22%) 220px,
            color-mix(in srgb, var(--background-color) 88%, black 12%) 220px,
            color-mix(in srgb, var(--background-color) 88%, black 12%) 100%
        );
}

.modal-content.modal-two-tone .modal-form > label {
    display: flex;
    grid-column: 1;
    align-items: center;
    margin: 0;
    padding: 14px 18px;
    background: transparent;
    /* border-top: 1px solid var(--accent-color); */
    /* border-right: 1px solid var(--accent-color); */
    min-height: 52px;
    box-sizing: border-box;
}

.modal-content.modal-two-tone .modal-form > input,
.modal-content.modal-two-tone .modal-form > select,
.modal-content.modal-two-tone .modal-form > textarea,
.modal-content.modal-two-tone .modal-form > .date-input-wrapper,
.modal-content.modal-two-tone .modal-form > #dropdownSelected,
.modal-content.modal-two-tone .modal-form > #dropdownList,
.modal-content.modal-two-tone .modal-form > div:not(.button-row):not(.project-button-row):not(.cp-error):not(.formula-hour-button-row):not(.move-admin-confirm-warning):not(.move-admin-confirm-row):not(.checkout-side) {
    grid-column: 2;
    background: transparent;
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
}

/* Ensure hidden rows are fully removed in two-tone grid forms */
.modal-content.modal-two-tone .modal-form > .hidden,
.modal-content.modal-two-tone .modal-form > .custom-dropdown.hidden {
    display: none !important;
}

/* Add Contact modal: roles multi-select (checkbox list) */
.modal-content .create-admin-sub-roles {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 8px 0;
    padding: 6px;
    max-height: 380px;
    overflow-y: auto;
    border: 1px solid color-mix(in srgb, var(--font-color) 18%, transparent);
    border-radius: 8px;
}

.modal-content .create-admin-sub-role-option {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 9px 11px;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.12s ease;
}

.modal-content .create-admin-sub-role-option:hover {
    background-color: color-mix(in srgb, var(--font-color) 8%, transparent);
}

.modal-content .create-admin-sub-role-option:has(input[type="checkbox"]:checked) {
    background-color: var(--accent-color);
}

/* Reset the global .modal-content input box styling for these checkboxes so they
   render as a normal checkbox sitting inline to the left of the label text. */
.modal-content .create-admin-sub-role-option input[type="checkbox"] {
    flex: 0 0 auto;
    width: 16px;
    min-width: 16px;
    height: 16px;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 0;
    background-color: transparent !important;
    accent-color: var(--accent-color-strong, var(--accent-color));
    cursor: pointer;
}

.modal-content .create-admin-sub-role-option input[type="checkbox"]:disabled {
    cursor: not-allowed;
}

.modal-content .create-admin-sub-role-option span {
    flex: 1 1 auto;
    text-align: left;
}

/* Multi-role assignment modal: a checklist of roles, checkbox left + label right. */
.modal-content .admin-users-roles-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.modal-content .admin-users-role-option {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 9px 11px;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.12s ease;
}

.modal-content .admin-users-role-option:hover {
    background-color: color-mix(in srgb, var(--font-color) 8%, transparent);
}

.modal-content .admin-users-role-option:has(input[type="checkbox"]:checked) {
    background-color: var(--accent-color);
}

/* Reset the global ".modal-content input" min-width:96.5% so these render as
   normal small checkboxes inline to the left of the label text. */
.modal-content .admin-users-role-option input[type="checkbox"] {
    flex: 0 0 auto;
    width: 16px;
    min-width: 16px;
    height: 16px;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 0;
    background-color: transparent !important;
    accent-color: var(--accent-color-strong, var(--accent-color));
    cursor: pointer;
}

.modal-content .admin-users-role-option span {
    flex: 1 1 auto;
    text-align: left;
}

/* Keep the warning + confirm checkbox in the right (content) column only,
   matching how .cp-error and .button-row sit in the two-tone grid. */
.modal-content.modal-two-tone .modal-form > .move-admin-confirm-warning,
.modal-content.modal-two-tone .modal-form > .move-admin-confirm-row {
    grid-column: 2;
}

.modal-content .move-admin-confirm-warning {
    /* margin: 8px 16px 0; */
    padding: 10px 12px;
    border-radius: 8px;
    background: color-mix(in srgb, #d9534f 16%, transparent);
    font-size: 0.85rem;
}

.modal-content .move-admin-confirm-row {
    padding: 4px 4px;
}

/* Checkbox sits to the LEFT, label text to the RIGHT, both inline on one line.
   Resets the global ".modal-content input" min-width:96.5% / forced background
   so the box renders as a normal small checkbox. */
.modal-content .move-admin-confirm-option {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-weight: 500;
    font-size: 0.85rem;
    cursor: pointer;
}

.modal-content .move-admin-confirm-option input[type="checkbox"] {
    flex: 0 0 auto;
    width: 16px;
    min-width: 16px;
    height: 16px;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 0;
    background-color: transparent !important;
    accent-color: var(--accent-color-strong, var(--accent-color));
    cursor: pointer;
}

.modal-content .move-admin-confirm-option span {
    flex: 1 1 auto;
    text-align: left;
}

/* Live summary of the currently-selected roles, shown under the roles list */
.modal-content .create-admin-sub-selected-roles {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    padding: 6px 0;
    min-height: 28px;
}

.modal-content .create-admin-sub-selected-chip {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--font-color);
    background-color: color-mix(in srgb, var(--accent-color) 35%, transparent);
    border: 1px solid color-mix(in srgb, var(--accent-color) 55%, transparent);
}

.modal-content .create-admin-sub-selected-empty {
    font-size: 0.85rem;
    font-style: italic;
    opacity: 0.7;
}

/* Two-tone question modal layout */
.modal-content.modal-two-tone.modal-two-tone-question-wrap {
    padding: 0;
    overflow-y: auto;
    overflow-x: hidden;
    width: min(860px, 92vw);
    max-width: 92vw;
    max-height: calc(100vh - 64px);
}

.modal-two-tone-question {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    position: relative;
    background:
        linear-gradient(
            to right,
            color-mix(in srgb, var(--sub-background-color) 78%, var(--background-color) 22%) 0,
            color-mix(in srgb, var(--sub-background-color) 78%, var(--background-color) 22%) 220px,
            color-mix(in srgb, var(--background-color) 88%, black 12%) 220px,
            color-mix(in srgb, var(--background-color) 88%, black 12%) 100%
        );
}

.modal-two-tone-question-left {
    padding: 18px 22px;
    border-right: 1px solid var(--accent-color);
}

.modal-two-tone-question-left h2 {
    margin: 0;
    padding: 0;
}

.modal-two-tone-question-right {
    padding: 18px 22px;
    min-width: 0;
}

.modal-two-tone-question-right p:first-child {
    margin-top: 0;
}

.modal-two-tone-question-right .button-row,
.modal-two-tone-question-right .project-button-row,
.modal-two-tone-question-right .formula-hour-button-row {
    margin-top: 1rem;
    justify-content: flex-end;
    gap: 10px;
}

.modal-content.modal-two-tone .modal-form > input,
.modal-content.modal-two-tone .modal-form > select,
.modal-content.modal-two-tone .modal-form > textarea {
    border: 1px solid var(--accent-color);
    border-radius: 8px;
    min-height: 40px;
    background: var(--background-color);
}

.modal-content.modal-two-tone .modal-form > textarea {
    min-height: 110px;
    resize: vertical;
    margin-top: 0.35rem;
}

.modal-prefix-input-wrap {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.modal-prefix-input-label {
    font-weight: 700;
    color: var(--text-color);
    white-space: nowrap;
}

.modal-prefix-input-wrap > input {
    flex: 1 1 auto;
    min-width: 0;
}

/* Keep modal errors on the right side only */
.modal-content.modal-two-tone .modal-form > .cp-error {
    grid-column: 2;
    margin: 0;
    /* padding: 10px 16px 0 16px; */
    background: color-mix(in srgb, var(--background-color) 88%, black 12%);
    min-width: 0;
    box-sizing: border-box;
    text-align: left;
}

.modal-content.modal-two-tone .button-row,
.modal-content.modal-two-tone .project-button-row {
    grid-column: 2;
    margin: 0;
    padding: 16px 1px 18px 18px;
    background: color-mix(in srgb, var(--background-color) 88%, black 12%);
    border-top: 1px solid var(--accent-color);
    justify-content: flex-end;
}

.modal-content.modal-two-tone .close.modal-close-hidden {
    display: none;
}

#admin-hour-existing-list {
  scrollbar-width: thin;
  scrollbar-color: var(--sub-background-color) var(--background-color);
}

#admin-hour-existing-list::-webkit-scrollbar {
  width: 12px;
}

#admin-hour-existing-list::-webkit-scrollbar-track {
  background: var(--background-color);
  border-radius: 6px;
}

#admin-hour-existing-list::-webkit-scrollbar-thumb {
  background: var(--sub-background-color);
  border-radius: 6px;
  border: 2px solid var(--background-color);
}

#admin-hour-existing-list::-webkit-scrollbar-thumb:hover {
  background: var(--accent-color);
}

.modal-content,
.modal-content.modal-two-tone,
.modal-content.modal-two-tone.modal-two-tone-question-wrap {
    scrollbar-width: thin;
    scrollbar-color: var(--sub-background-color) var(--background-color);
}

.modal-content::-webkit-scrollbar,
.modal-content.modal-two-tone::-webkit-scrollbar,
.modal-content.modal-two-tone.modal-two-tone-question-wrap::-webkit-scrollbar {
    width: 12px;
}

.modal-content::-webkit-scrollbar-track,
.modal-content.modal-two-tone::-webkit-scrollbar-track,
.modal-content.modal-two-tone.modal-two-tone-question-wrap::-webkit-scrollbar-track {
    background: var(--background-color);
    border-radius: 6px;
}

.modal-content::-webkit-scrollbar-thumb,
.modal-content.modal-two-tone::-webkit-scrollbar-thumb,
.modal-content.modal-two-tone.modal-two-tone-question-wrap::-webkit-scrollbar-thumb {
    background: var(--sub-background-color);
    border-radius: 6px;
    border: 2px solid var(--background-color);
}

.modal-content::-webkit-scrollbar-thumb:hover,
.modal-content.modal-two-tone::-webkit-scrollbar-thumb:hover,
.modal-content.modal-two-tone.modal-two-tone-question-wrap::-webkit-scrollbar-thumb:hover {
    background: var(--accent-color);
}

/* Hide number input steppers everywhere */
input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Hide the raw <select> until JS enhances it into a custom dropdown, so the
   unstyled native control doesn't flash on page load. Once enhanced it gains
   .custom-dropdown-native and the styled trigger takes over. */
select[data-custom-dropdown]:not(.custom-dropdown-native) {
    opacity: 0;
}

.custom-dropdown-native {
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
}

.custom-dropdown-trigger {
    min-width: 90px;
    min-height: 40px;
    padding: 8px 35px 8px 12px;
    border: 1px solid var(--accent-color);
    border-radius: 8px;
    background: var(--sub-background-color);
    color: var(--font-color);
    font: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    position: relative;
    box-sizing: border-box;
}

.custom-dropdown {
    position: relative;
    min-width: 0;
}

.modal-content.modal-two-tone .modal-form > .custom-dropdown {
    width: 100%;
    min-width: 0;
    margin: 0;
    margin-top: 0.35rem;
    background: transparent;
    box-sizing: border-box;
}

.custom-dropdown-trigger::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 12px;
    width: 10px;
    height: 10px;
    border-right: 2px solid var(--font-color);
    border-bottom: 2px solid var(--font-color);
    transform: translateY(-70%) rotate(45deg);
    pointer-events: none;
    opacity: 0.85;
}

.custom-dropdown.is-open .custom-dropdown-trigger {
    border-color: var(--primary-accent-color);
}

.custom-dropdown-label {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.custom-dropdown-menu {
    display: none;
    position: absolute;
    left: 0;
    width: max-content;
    min-width: 100%;
    max-width: min(500px, calc(100vw - 32px));
    max-height: 240px;
    overflow-y: auto;
    border: 1px solid var(--accent-color);
    border-radius: 10px;
    background: var(--background-color);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
    z-index: 2000;
    padding: 4px;
    box-sizing: border-box;
    white-space: nowrap;
}

.custom-dropdown.is-open .custom-dropdown-menu {
    display: flex;
    flex-direction: column;
}

.custom-dropdown-menu.is-portaled {
    position: fixed;
    z-index: 100000;
    display: flex;
    flex-direction: column;
}

/* Optional search box for dropdowns with data-dropdown-search */
.custom-dropdown-search {
    position: sticky;
    top: 0;
    z-index: 1;
    flex: 0 0 auto;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 4px;
    padding: 6px 8px;
    border: 1px solid var(--accent-color);
    border-radius: 8px;
    background: var(--background-color);
    color: var(--font-color);
    font: inherit;
    font-size: 14px;
}

.custom-dropdown-search:focus {
    outline: none;
    border-color: var(--primary-color);
}

.custom-dropdown-option-hidden {
    display: none !important;
}

.custom-dropdown-empty {
    padding: 6px 8px;
    color: var(--other-color);
    font-size: 14px;
    text-align: center;
}

.custom-dropdown-option:hover {
    background: var(--sub-background-color);
}

/* .custom-dropdown-option.is-selected {
    background: var(--sub-background-color);
    font-weight: 400;
} */

.custom-dropdown-option {
    width: 100%;
    padding: 6px 8px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--font-color);
    font: inherit;
    text-align: left;
    cursor: pointer;
    font-size: 15px;
    box-sizing: border-box;
}

/* Multi-select option rows show a checkbox indicator */
.custom-dropdown-option-multi {
    display: flex;
    align-items: center;
    gap: 8px;
}

.custom-dropdown-option-text {
    flex: 1 1 auto;
    min-width: 0;
}

.custom-dropdown-check {
    flex: 0 0 auto;
    width: 15px;
    height: 15px;
    border: 1.5px solid var(--other-color);
    border-radius: 4px;
    box-sizing: border-box;
    position: relative;
}

.custom-dropdown-option-multi.is-selected .custom-dropdown-check {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.custom-dropdown-option-multi.is-selected .custom-dropdown-check::after {
    content: "";
    position: absolute;
    left: 4px;
    top: 1px;
    width: 4px;
    height: 8px;
    border: solid var(--background-color);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.custom-dropdown-option:first-child {
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.custom-dropdown-option:last-child {
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}

/* Custom dropdown scrollbar */
.custom-dropdown-menu {
    scrollbar-width: thin;
    scrollbar-color: var(--accent-color) var(--background-color);
}

.custom-dropdown-menu::-webkit-scrollbar {
    width: 10px;
}

.custom-dropdown-menu::-webkit-scrollbar-track {
    background: var(--background-color);
    border-radius: 999px;
}

.custom-dropdown-menu::-webkit-scrollbar-thumb {
    background: var(--accent-color);
    border-radius: 999px;
    border: 2px solid var(--background-color);
}

.custom-dropdown-menu::-webkit-scrollbar-thumb:hover {
    background: var(--primary-accent-color);
}

.custom-dropdown-menu::-webkit-scrollbar-corner {
    background: transparent;
}

.admin-add-hours-now-message {
    padding: 14px 18px;
    line-height: 1.5;
    min-height: 52px;
    align-items: center;
}

.de-copy-modal-form {
    position: relative;
}

.de-copy-loading-overlay {
    position: absolute;
    inset: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.28);
    border-radius: 0 0 12px 12px;
}

.de-copy-loading-overlay.hidden {
    display: none;
}

.de-copy-loading-gif {
    width: 64px;
    height: 64px;
    object-fit: contain;
    pointer-events: none;
}

.create-admin-item-manufacturer-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.create-admin-item-price-row {
    border: 1px solid var(--accent-color);
    border-radius: 10px;
    padding: 10px;
    background: var(--background-color);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.create-admin-item-price-row-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.create-admin-item-price-default-wrap {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    margin-top: 0 !important;
}

.create-admin-item-price-default-wrap input[type="radio"] {
    min-width: 16px !important;
    width: 16px;
    height: 16px;
    margin: 0;
}

.create-admin-item-price-list {
    border: 1px var(--background-color);
}

.create-admin-item-price-row .create-admin-item-price-value, .create-admin-item-price-list-value {
    width: 100%;
    min-width: 0 !important;
    border: 1px solid var(--accent-color) !important;
    border-radius: 8px;
    background: var(--background-color) !important;
    box-sizing: border-box;
}

.create-admin-item-price-row .create-admin-item-price-value:focus,
.create-admin-item-price-row .create-admin-item-price-value:focus-visible {
    box-shadow: none;
}









/* Fullscreen overlay */
.screensaver {
  position: fixed;
  inset: 0;
  background: var(--background-color);
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1s ease;
  z-index: 9999;
}

.screensaver.active {
  opacity: 1;
  pointer-events: auto;
}

.screensaver img {
  height: 100px;
  position: absolute;
  transform: translate(-50%, -50%) scale(1) !important;
  image-rendering: auto;
}

.custom-dropdown.is-disabled .custom-dropdown-trigger,
.custom-dropdown-trigger:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

.estimate-logs-footer {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  margin-top: 1rem;
}

.estimate-logs-modal {
    width: min(860px, calc(100vw - 40px)) !important;
}

.estimate-logs-wrap {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: min(62vh, 720px);
    overflow-y: auto;
    margin-top: 14px;
    padding-right: 8px;
}

.estimate-log-row {
    padding: 14px 16px;
    border: 1px solid var(--accent-color);
    border-left-width: 4px;
    border-radius: 12px;
    background: var(--sub-background-color);
}

.estimate-log-row-create {
    border-left-color: #3d8b5a;
}

.estimate-log-row-update {
    border-left-color: var(--primary-accent-color);
}

.estimate-log-row-delete {
    border-left-color: #b85454;
}

.estimate-log-row-export {
    border-left-color: #907331;
}

.estimate-log-row-submit {
    border-left-color: #2f6f4f;
}

.estimate-log-row-reopen {
    border-left-color: #b07d2b;
}

.estimate-log-row-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.estimate-log-row-meta-left {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.estimate-log-time {
    font-size: 0.85rem;
    font-weight: 700;
    opacity: 0.75;
}

.estimate-log-user {
    font-size: 0.9rem;
    opacity: 0.92;
    word-break: break-word;
}

.estimate-log-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.estimate-log-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    background: color-mix(in srgb, var(--secondary-accent-color) 35%, transparent);
}

.estimate-log-badge-action {
    border: 1px solid transparent;
}

.estimate-log-badge-action-create {
    background: color-mix(in srgb, #3d8b5a 20%, transparent);
    border-color: color-mix(in srgb, #3d8b5a 48%, transparent);
}

.estimate-log-badge-action-update {
    background: color-mix(in srgb, var(--primary-accent-color) 20%, transparent);
    border-color: color-mix(in srgb, var(--primary-accent-color) 40%, transparent);
}

.estimate-log-badge-action-delete {
    background: color-mix(in srgb, #b85454 20%, transparent);
    border-color: color-mix(in srgb, #b85454 48%, transparent);
}

.estimate-log-badge-action-export {
    background: color-mix(in srgb, #907331 20%, transparent);
    border-color: color-mix(in srgb, #907331 48%, transparent);
}

.estimate-log-message {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.45;
    word-break: break-word;
}

.estimate-logs-footer-left {
  display: flex;
  justify-content: flex-start;
}

.estimate-logs-footer-right {
  display: flex;
  justify-content: flex-end;
}

.project-updates-modal {
    width: 60vw !important;
    min-width: 600px;
    max-height: calc(100vh - 180px);
}

.project-updates-modal.modal-two-tone {
    overflow: hidden;
}

.project-updates-modal.modal-two-tone .modal-form {
    max-height: calc(100vh - 220px);
    overflow: hidden;
    min-height: 0;
    grid-template-rows:
        auto
        minmax(0, 1fr)
        auto
        auto
        auto;
}

.project-updates-title {
    padding-top: 15px;
    font-weight: bold;
    font-size: 1.3rem;
}

.project-updates-modal .project-updates-list {
    grid-column: 2;
    grid-row: 2;
    min-height: 0;
    height: 100%;
    display: flex;
    overflow-y: auto;
    gap: 8px;
    overflow-x: hidden;
    padding-top: 15px;
    padding-right: 8px;
    box-sizing: border-box;
    flex-direction: column;
}

.project-update-thread {
    display: flex;
    flex-direction: column;
}

.project-update-card {
    padding: 15px;
    border-radius: 5px;
    background: var(--sub-background-color);
}

.project-update-thread:has(.project-update-replies) > .project-update-card {
    border-bottom-right-radius: 0;
}

.project-update-replies {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-left: 26px;
    padding-left: 12px;
    border-left: 2px solid var(--accent-color);
    background: transparent;
}

.project-update-reply-card {
    padding: 12px;
    background: color-mix(in srgb, var(--sub-background-color) 70%, var(--background-color) 30%);
}

.project-update-reply-card:first-child {
    border-top-right-radius: 0;
}

.project-update-reply-card:last-child {
    border-bottom-right-radius: 5px;
    border-bottom-left-radius: 5px;
}

.project-update-reply-card + .project-update-reply-card {
    border-top: 1px solid var(--accent-color);
}

.project-update-inline-reply {
    margin-left: 26px;
    padding-left: 12px;
    border-left: 2px solid transparent;
}

.project-update-inline-reply-input {
    width: 100%;
    min-height: 38px !important;
    height: 38px;
    resize: none;
    overflow: hidden;
    box-sizing: border-box;
}

.project-update-inline-reply.is-active {
    border-left-color: var(--accent-color);
}

.project-update-inline-reply.is-active .project-update-inline-reply-input {
    min-height: 90px !important;
    height: 90px;
    resize: vertical;
    overflow-y: auto;
}

.project-update-inline-reply-actions {
    display: none;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 8px;
}

.project-update-inline-reply.is-active .project-update-inline-reply-actions {
    display: flex;
}

.project-update-inline-reply-actions button {
    min-width: auto !important;
    padding: 6px 12px !important;
    margin-top: 0 !important;
    font-size: 0.85rem;
}

.project-updates-modal textarea {
    max-height: 160px;
}

.project-updates-modal .project-button-row,
.project-updates-modal .cp-error {
    min-height: 0;
}

.project-update-compose-wrap {
  display: grid;
  grid-template-columns: 36px 1fr;
  align-items: start;
  gap: 8px;
  grid-column: 2;
}

.project-updates-modal .cp-error,
.project-updates-modal .project-button-row {
  grid-column: 2;
}

.project-update-mention-btn {
  width: 36px;
  height: 36px;
  min-width: 36px !important;
  padding: 0 !important;
  margin-top: 5px !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  border-radius: 8px;
  border: 1px solid var(--accent-color);
  background: var(--sub-background-color);
  color: var(--primary-color);
  font-weight: 800;
  cursor: pointer;
}

.project-update-mention-btn:hover {
  background: var(--secondary-accent-color);
}

.project-update-mention-btn {
  margin-top: 10px !important;
}

.project-update-mention-menu {
  position: fixed;
  max-height: 260px;
  overflow-y: auto;
  border: 1px solid var(--accent-color);
  border-radius: 10px;
  background: var(--background-color);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22);
  z-index: 9000;
  padding: 6px;
}

.project-update-mention-option {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--font-color);
}

.project-update-mention-option:hover,
.project-update-mention-option.is-active {
  background: var(--secondary-accent-color);
}

.project-update-mention-option-name {
  font-weight: 700;
}

.project-update-mention-option-email {
  font-size: 0.78rem;
  opacity: 0.75;
}

.project-update-mention-empty {
  padding: 8px 10px;
  opacity: 0.75;
}

.project-update-mention {
  display: inline-flex;
  align-items: center;
  border: none !important;
  background: color-mix(in srgb, var(--primary-color) 14%, transparent);
  color: var(--primary-color) !important;
  padding: 1px 2px !important;
  font: inherit;
  margin-top: 0 !important;
  cursor: default !important;
}

.project-update-mention:hover {
  background: color-mix(in srgb, var(--primary-color) 24%, transparent);
}

.edit-admin-item-prices-item-label {
    padding: 10px 12px;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.modal-content button:disabled,
.modal-content button.is-saving {
    opacity: 0.45;
    cursor: not-allowed !important;
    filter: grayscale(0.7);
    pointer-events: auto;
}

.modal-content button:disabled:hover,
.modal-content button.is-saving:hover {
    border-color: var(--secondary-accent-color) !important;
    background-color: var(--sub-background-color);
}

.caddy-tooltip {
    position: fixed;
    z-index: 100001;
    max-width: 320px;
    padding: 7px 9px;
    border: 1px solid var(--accent-color);
    border-radius: 8px;
    background: var(--background-color);
    color: var(--font-color);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.35;
    pointer-events: none;
    white-space: normal;
    overflow-wrap: anywhere;
}

.caddy-tooltip-body {
    white-space: pre-line;
}

.caddy-tooltip-body + .caddy-tooltip-note {
    margin-top: 4px;
}

.caddy-tooltip-note {
    font-style: italic;
    font-weight: 500;
    opacity: 0.82;
}

.caddy-tooltip.hidden {
    display: none !important;
}
.ces-breakout-checkbox-cell {
    display: flex;
    align-items: center;
    min-height: 52px;
    padding: 0 18px;
    margin-left: -10px;
    box-sizing: border-box;
}

.ces-breakout-checkbox-row {
    display: inline-flex !important;
    align-items: center;
    gap: 10px;
    margin: 0 !important;
    padding: 0 !important;
    min-height: 0 !important;
    font-weight: 600;
    cursor: pointer;
}

.ces-breakout-checkbox-row input[type="checkbox"] {
    min-width: 18px !important;
    width: 18px;
    height: 18px;
    margin: 0;
    padding: 0;
}

.invite-details-modal {
    width: min(720px, 92vw) !important;
}

.invite-details-modal .invite-details-form {
    grid-template-columns: 180px minmax(0, 1fr);
}

.invite-details-value {
    min-height: 52px;
    padding: 14px 18px;
    box-sizing: border-box;
    overflow-wrap: anywhere;
    /* font-weight: 700; */
    color: var(--font-color);
}

.invite-details-token {
    font-family: Consolas, monospace;
    font-size: 0.86rem;
    line-height: 1.5;
}

.invite-details-status {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 3px 10px;
    border-radius: 999px;
    border: 1px solid var(--accent-color);
    background: var(--sub-background-color);
    font-size: 0.85rem;
    font-weight: 800;
}

.invite-logs-modal {
    width: min(760px, 92vw) !important;
}

.invite-logs-modal.modal-two-tone {
    overflow: hidden;
}

.invite-logs-modal.modal-two-tone .invite-logs-form {
    height: calc(100vh - 350px);
    overflow-y: auto;
    grid-template-rows:
        minmax(260px, 1fr)
        auto;
}

.invite-logs-panel {
    min-height: 260px;
    padding: 14px 18px;
    box-sizing: border-box;
}

.invite-logs-list {
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 460px);
    overflow-y: auto;
    padding-right: 8px;
    box-sizing: border-box;
}

.invite-log-row:last-child {
    border-bottom: none;
}

.invite-log-title {
    font-weight: 800;
    color: var(--font-color);
    font-size: 1rem;
}

.invite-log-detail {
    margin-top: 4px;
    opacity: 0.86;
    line-height: 1.35;
}

.invite-log-meta {
    margin-top: 5px;
    font-size: 0.86rem;
    opacity: 0.7;
}

.invite-logs-loading,
.invite-logs-empty {
    padding: 18px;
    border: 1px dashed var(--accent-color);
    border-radius: 10px;
    text-align: center;
    opacity: 0.75;
}

.invite-logs-button-row {
    grid-column: 2;
}

.invite-logs-list {
    scrollbar-width: thin;
    scrollbar-color: var(--sub-background-color) var(--background-color);
}

.invite-logs-list::-webkit-scrollbar {
    width: 12px;
}

.invite-logs-list::-webkit-scrollbar-track {
    background: var(--background-color);
    border-radius: 6px;
}

.invite-logs-list::-webkit-scrollbar-thumb {
    background: var(--sub-background-color);
    border-radius: 6px;
    border: 2px solid var(--background-color);
}

.invite-logs-list::-webkit-scrollbar-thumb:hover {
    background: var(--accent-color);
}

.admin-sub-locations-modal-form {
    position: relative;
}

.admin-sub-locations-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 8px;
    margin-right: 10px;
}

.admin-sub-locations-contact-name {
    font-weight: 700;
    opacity: 0.85;
}

.admin-sub-locations-add-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    min-width: 34px !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 1px solid var(--accent-color);
    border-radius: 8px;
    background: var(--sub-background-color);
    color: var(--font-color);
    font-size: 1.2rem;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
}

.admin-sub-locations-add-btn:hover {
    background: color-mix(in srgb, var(--secondary-accent-color) 55%, var(--sub-background-color));
}

.admin-sub-locations-add-icon {
    content: url("/caddy/images/icons/add/light mode plus icon.png");
    width: 18px;
    height: 18px;
    display: block;
    margin: 0;
    pointer-events: none;
}

.admin-sub-locations-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    min-width: 0;
}

.admin-sub-location-row {
    display: flex;
    gap: 10px;
    min-width: 0;
    padding: 10px;
    border: 1px solid var(--accent-color);
    border-radius: 10px;
    background: var(--sub-background-color);
    flex-wrap: nowrap;
    justify-content: flex-start;
    flex-direction: row;
    align-items: center;
}

.admin-sub-location-row label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.admin-sub-location-row label:nth-of-type(2) {
    flex: 0 0 220px;
    width: 220px;
}

/* City → Zip cascade columns (override the positional widths above; wrap on narrow widths) */
.admin-sub-location-row {
    flex-wrap: wrap;
}

.admin-sub-location-row label.admin-sub-loc-zip,
.admin-sub-location-row label.admin-sub-loc-newcity,
.admin-sub-location-row label.admin-sub-loc-newzip {
    flex: 0 0 160px;
    width: 160px;
}

/* The Radius label is the only one without a class */
.admin-sub-location-row label:not([class]) {
    flex: 0 0 220px;
    width: 220px;
}

.admin-sub-location-row input,
.admin-sub-location-row select {
    width: 100%;
    min-width: 100%;
    box-sizing: border-box;
}

.admin-sub-location-remove {
    display: inline-flex;
    justify-content: center;
    margin-left: auto !important;
    width: 30px;
    height: 30px;
    min-width: 30px !important;
    background: var(--background-color);
    align-items: center;
}

.admin-sub-location-remove:hover {
    background: color-mix(in srgb, var(--secondary-accent-color) 45%, var(--background-color));
}

.admin-sub-location-remove-icon {
    content: url("/caddy/images/icons/trashcan/Light Trashcan.png");
    width: 16px;
    height: 16px;
    display: block;
    margin: 0;
    pointer-events: none;
}

.admin-sub-locations-empty {
    opacity: 0.72;
    font-style: italic;
}

.admin-sub-location-radius {
    margin-top: 0 !important;
}

/* Location rows inside the narrower "Add Contact" create modal: let the location
   dropdown flex to fill the row and keep the radius column compact so the row fits
   the standard modal width instead of the wide manage-locations modal. */
#create-admin-sub-locations-list .admin-sub-location-row {
    padding: 8px;
}

#create-admin-sub-locations-list .admin-sub-location-row label:nth-of-type(2) {
    min-width: 110px;
}

/* ===== Project multi-contact rows (create/edit + dedicated editor) ===== */
.pc-contacts-header {
    display: flex;
    justify-content: space-between;
}

.modal-content.modal-two-tone .modal-form > .pc-contacts-header {
    margin-top: 0;
    display: flex;
    padding: 0 6px;
    align-items: flex-end;
    gap: 10px;
    justify-content: flex-end;
}

.pc-contacts-hint {
    font-size: 0.85rem;
    opacity: 0.75;
}

.pc-add-contact-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    min-width: 32px !important;
    padding: 0 !important;
    border: 1px solid var(--accent-color);
    border-radius: 8px;
    background: var(--sub-background-color);
    cursor: pointer;
}

.pc-add-contact-btn:hover:not(:disabled) {
    background: color-mix(in srgb, var(--secondary-accent-color) 55%, var(--sub-background-color));
}

.pc-add-contact-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pc-add-contact-icon {
    content: url("/caddy/images/icons/add/light mode plus icon.png");
    width: 18px;
    height: 18px;
    display: block;
    pointer-events: none;
}

.pc-contacts-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    min-width: 0;
}

/* Role-grouped contact sections (Bidders / Engineers / Owners). */
.pc-role-sections {
    gap: 18px;
}

.pc-role-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    min-width: 0;
}

.pc-role-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 0 6px;
}

.pc-role-section-title {
    font-weight: 700;
    font-size: 0.95rem;
}

.pc-role-section-hint {
    font-weight: 400;
    font-size: 0.85rem;
    opacity: 0.7;
    margin-left: 4px;
}

.pc-contact-row {
    display: grid;
    grid-template-columns: 140px minmax(0, 1fr);
    border: 1px solid var(--accent-color);
    border-radius: 10px;
    overflow: hidden;
    background: var(--sub-background-color);
}

.pc-contact-row-header {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--accent-color);
    background: color-mix(in srgb, var(--sub-background-color) 78%, var(--background-color) 22%);
}

.pc-contact-row-title {
    font-weight: 700;
}

.pc-contact-row > label {
    padding: 10px 14px;
    box-sizing: border-box;
    font-size: 0.9rem;
    margin-top: 0;
}

.pc-contact-row > input,
.pc-contact-row > .custom-dropdown {
    grid-column: 2;
    align-self: center;
    min-width: 0;
    background: none !important;
    box-sizing: border-box;
    margin: 6px 10px 6px 0;
}

.pc-contact-row > input {
    border: 1px solid var(--accent-color);
    border-radius: 8px;
    min-height: 40px;
    background: var(--background-color) !important;
    padding: 8px 12px;
    font-size: 0.9rem;
    color: var(--font-color);
}

.pc-contact-row > .custom-dropdown {
    width: calc(100% - 10px);
}

.pc-contact-row .custom-dropdown-trigger {
    width: 100%;
    min-height: 40px;
    height: 40px;
    padding: 0 32px 0 12px;
    border: 1px solid var(--accent-color);
    border-radius: 8px;
}

/* Ensure hidden labels and fields collapse their grid row */
.pc-contact-row > .hidden,
.pc-contact-row > .custom-dropdown.hidden {
    display: none !important;
}

.pc-contact-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    min-width: 28px !important;
    padding: 16px !important;
    margin: 0 !important;
    border: 1px solid var(--accent-color);
    border-radius: 6px;
    background: var(--background-color) !important;
    cursor: pointer;
    font-size: 1.1rem;
    border: none !important;
    line-height: 1;
}

.pc-contact-remove:hover {
    background: color-mix(in srgb, var(--secondary-accent-color) 55%, var(--sub-background-color)) !important;
}

.project-person-badge-overflow {
    cursor: pointer;
    background: var(--sub-background-color);
    color: var(--text-color);
}

/* --- Project checkout modal (Ready for Review) --- */
/* Subhead spans both two-tone columns: project name on the left, the owner /
   estimate meta pushed to the right edge, both on the same baseline. */
.modal-content.modal-two-tone .modal-form > .checkout-subhead {
    grid-column: 1 / -1;
    display: flex;
    gap: 1rem;
    background: transparent;
    box-sizing: border-box;
    padding: 0px 18px;
    justify-content: space-between;
    align-items: baseline;
    margin: 8px 0px;
}

.checkout-subhead-meta {
    text-align: right;
    opacity: 0.85;
    /* Confine the meta to the two-tone right (controls) column — the full width minus the
       220px label column and the 10px grid gap — so it wraps within the right side of the
       modal rather than stretching across the whole modal toward the project name.
       (It's a flex child, so it's blockified and max-width applies.) */
    min-width: 0;
    /* max-width: calc(100% - 200px); */
    overflow-wrap: anywhere;
}

/* Read-only checkout view: render the meta on its own lines (context, then submission). */
.checkout-subhead-meta-line {
    display: block;
}

/* Save-mode subhead right group: estimate meta + the "Clear All" button, far right. */
.checkout-subhead-right {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    min-width: 0;
    max-width: calc(100% - 200px);
    align-items: baseline;
}

.checkout-subhead-right > .checkout-clear-btn {
    flex: 0 0 auto;
    white-space: nowrap;
}

/* Left ("label") column of the two-tone grid: section heading + helper text. */
.modal-content.modal-two-tone .modal-form > .checkout-side {
    grid-column: 1;
    background: transparent;
    box-sizing: border-box;
    padding: 16px 18px;
    min-width: 0;
}

.checkout-side h3 {
    margin: 0;
    font-size: 1.05rem;
}

.checkout-side-note {
    margin: 0.4rem 0 0 0;
    font-size: 0.82rem;
    opacity: 0.75;
    line-height: 1.35;
}

/* Right ("content") column: questions list / lesson cards. */
.modal-content.modal-two-tone .modal-form > .checkout-pane {
    box-sizing: border-box;
}

.checkout-question {
    margin-bottom: 0.6rem;
}

.checkout-question:last-child {
    margin-bottom: 0;
}

/* Checklist row: checkbox left, prompt right, inline on one line.
   Beats the global ".modal-content label { display:block }" rule. */
.modal-content label.checkout-check {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    font-weight: 600;
    cursor: pointer;
}

/* Reset the global ".modal-content input" min-width:96.5% so the checkbox stays small. */
.checkout-check input[type="checkbox"] {
    min-width: 0 !important;
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    margin: 0;
    cursor: pointer;
    accent-color: var(--accent-color-strong, var(--accent-color));
}

.checkout-question-label {
    flex: 1 1 auto;
    font-weight: 600;
}

.checkout-check .checkout-question-label {
    margin-bottom: 0;
    flex: 1 1 auto;
}

/* Icon button that reveals the optional note for a question (matches the other
   icon buttons). Shows a "+" by default and a trash icon once the note is open. */
.checkout-note-toggle {
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    min-width: 28px !important;
    margin: 0;
    padding: 0 !important;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--sub-background-color);
    border: 1px solid var(--accent-color);
}

.checkout-note-toggle:hover {
    background: var(--secondary-accent-color);
}

.checkout-note-toggle-icon {
    content: url("/caddy/images/icons/add/light mode plus icon.png");
    width: 15px;
    height: 15px;
    display: block;
}

/* Once a note is open the button deletes it, so it shows the trash icon. */
.checkout-note-toggle.is-active .checkout-note-toggle-icon {
    content: url("/caddy/images/icons/trashcan/Light Trashcan.png");
}

/* Collapsible wrapper around the optional note. */
.checkout-note-wrap.hidden {
    display: none;
}

/* Optional per-question note, indented under the checkbox label. */
.checkout-note {
    width: 100%;
    box-sizing: border-box;
    resize: vertical;
    margin: 0.35rem 0 0 0;
    font-size: 0.85rem;
    min-height: 1.9rem;
}

.checkout-autosave-status {
    margin-left: 0.5rem;
    font-size: 0.8rem;
    font-weight: 400;
    opacity: 0.8;
}

.checkout-autosave-status.is-error {
    color: var(--error-color, #c0392b);
    opacity: 1;
}

textarea.checkout-answer,
.checkout-lesson-row textarea {
    width: 100%;
    box-sizing: border-box;
    resize: vertical;
}

/* Lesson card: trash button pinned top-right. */
.checkout-lesson-row {
    position: relative;
    border: 1px solid var(--sub-background-color);
    border-radius: 6px;
    padding: 0.6rem;
    padding-right: 2.5rem;
    margin-bottom: 0.6rem;
}

.checkout-lesson-fields {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
    margin-bottom: 0.4rem;
    flex-wrap: wrap;
}

.checkout-lesson-fields .custom-dropdown {
    flex: 1 1 40%;
    min-width: 140px;
}

.checkout-lesson-target-wrap {
    flex: 1 1 40%;
    min-width: 140px;
}

.checkout-lesson-target-wrap .custom-dropdown {
    width: 100%;
}

/* Trash icon button in the top-right corner of the card. */
.checkout-lesson-remove {
    position: absolute;
    top: 0.4rem;
    right: 0.4rem;
    width: 28px;
    height: 28px;
    min-width: 28px !important;
    margin: 0 !important;
    padding: 0 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--accent-color);
    border-radius: 8px;
    background: var(--background-color);
    cursor: pointer;
}

.checkout-lesson-remove:hover {
    background: var(--secondary-accent-color);
}

.checkout-lesson-remove-icon {
    content: url("/caddy/images/icons/trashcan/Light Trashcan.png");
    width: 15px;
    height: 15px;
    display: block;
}

/* "Add lesson" reduced to a plus icon button. */
.checkout-add-lesson {
    width: 34px;
    height: 34px;
    min-width: 34px !important;
    margin-top: 0.35rem !important;
    padding: 0 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--accent-color);
    border-radius: 8px;
    background: var(--sub-background-color);
    cursor: pointer;
}

.checkout-add-lesson:hover {
    background: var(--secondary-accent-color);
    transform: scale(1.03);
}

.checkout-add-lesson-icon {
    content: url("/caddy/images/icons/add/light mode plus icon.png");
    width: 18px;
    height: 18px;
    display: block;
}

/* Submit stays disabled until every question is ticked. */
#checkout-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* While the submit request is in flight. */
#checkout-submit.is-loading {
    cursor: progress;
}

/* Submit-mode estimate selector. */
.checkout-estimate-select {
    width: 100%;
    box-sizing: border-box;
}

/* The estimate selector becomes a custom dropdown; fill the content column. */
.modal-content.modal-two-tone .modal-form > .checkout-pane > .custom-dropdown {
    width: 100%;
    margin-top: 22px !important;
}

/* Estimate selector row: the dropdown grows, "Clear All" sits at the far right. */
.checkout-estimate-pane {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 22px;
}

.modal-content.modal-two-tone .modal-form > .checkout-estimate-pane > .custom-dropdown {
    width: auto;
    flex: 1 1 auto;
    min-width: 0;
    margin-top: 0 !important;
}

.checkout-estimate-pane > .checkout-clear-btn {
    flex: 0 0 auto;
    white-space: nowrap;
}

/* Submit-mode recipient search box. */
.checkout-recipient-search {
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 0.4rem;
}

/* Submit-mode email recipient picker. */
.checkout-recipients {
    max-height: 11rem;
    overflow-y: auto;
    border: 1px solid var(--sub-background-color);
    border-radius: 6px;
    padding: 0.4rem 0.6rem;
}

.checkout-recipient {
    display: flex !important;
    align-items: center;
    gap: 6px !important;
    cursor: pointer;
}

.checkout-recipient input[type="checkbox"] {
    min-width: 0;
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
    margin: 0;
    cursor: pointer;
}

.checkout-recipient-email {
    opacity: 0.7;
    font-size: 0.85rem;
}

/* Read-only checkout view (opened from the "Reviewed & cleared" badge) — static
   lessons-learned rows, no inputs. */
.checkout-view-lessons {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.checkout-view-lesson {
    padding: 0.5rem 0.7rem;
    border: 1px solid var(--sub-background-color);
    border-radius: 8px;
    background: color-mix(in srgb, var(--sub-background-color) 35%, transparent 65%);
}

.checkout-view-lesson-subject {
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.checkout-view-lesson-text {
    white-space: pre-wrap;
    opacity: 0.9;
}

/* Modal header: title plus the "view past sheets" icon button, sitting inline. */
.checkout-header {
    display: flex;
    align-items: center;
    gap: 10px;
    background: color-mix(in srgb, var(--sub-background-color) 78%, var(--background-color) 22%);
}

/* "View past sheets" history button — an icon button next to the checkout title. */
.checkout-history-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    min-width: 0 !important;
    padding: 0;
    margin-top: 0 !important;
    border-radius: 8px;
    border: 1px solid var(--accent-color);
    color: var(--font-color);
    cursor: pointer;
}

.checkout-history-btn:hover {
    background: var(--secondary-accent-color);
}

.checkout-history-btn .icon-checkout {
    width: 20px;
    height: 22px;
    content: url("/caddy/images/icons/menu/light-checkout.png");
}

/* Checkout history popup (stacked over the in-progress sheet). */
.checkout-history-scope {
    margin: 0 0 12px 0;
    max-width: 220px;
}

.checkout-history-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 50vh;
    overflow-y: auto;
}

.checkout-history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    text-align: left;
    padding: 10px 12px !important;
    border: 1px solid var(--accent-color) !important;
    background: var(--sub-background-color) !important;
}

.checkout-history-item:hover {
    background: var(--secondary-accent-color) !important;
}

.checkout-history-item-main {
    font-weight: 600;
}

.checkout-history-item-date {
    opacity: 0.8;
    font-size: 0.82rem;
    white-space: nowrap;
}

/* Pagination controls under the history list (10 most recent per page). */
.checkout-history-pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 12px;
}

.checkout-history-pager:empty {
    margin-top: 0;
}

.checkout-history-page-btn {
    font-size: 0.82rem;
    padding: 5px 12px;
    border-radius: 8px;
    border: 1px solid var(--accent-color);
    background: var(--sub-background-color);
    color: var(--font-color);
    cursor: pointer;
}

.checkout-history-page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.checkout-history-page-info {
    font-size: 0.82rem;
    opacity: 0.85;
}

/* Read-only "View Items" modal for an assembly (admin sidebar + estimate sidebar).
   Columns size to their content; headers never wrap, so each column is at least
   as wide as its header text. */
.modal-content.assembly-items-modal {
    width: fit-content;
    min-width: 360px;
    max-width: min(92%, 1000px);
}

.assembly-items-modal-scroll {
    width: fit-content;
    max-width: 100%;
    max-height: 60vh;
    overflow: auto;
    border: 1px solid var(--accent-color);
    border-radius: 10px;
    background: var(--sub-background-color);
}

.assembly-items-modal-table {
    width: auto;
    min-width: 0;
    table-layout: auto;
    border-collapse: collapse;
    background: var(--sub-background-color);
}

.assembly-items-modal-table th,
.assembly-items-modal-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--secondary-color);
    border-right: 1px solid var(--secondary-color);
    text-align: left;
    font-size: 13px;
    vertical-align: top;
}

.assembly-items-modal-table th {
    white-space: nowrap;
    font-weight: 600;
    background: var(--background-color);
    position: sticky;
    top: 0;
}

.assembly-items-modal-table tbody tr:last-child td {
    border-bottom: none;
}

.assembly-items-modal-empty {
    margin: 0.5rem 0 0;
    color: var(--font-color);
}

/* Add Hour Item modal */
.add-hour-item-modal {
    width: 640px;
    max-width: 92vw;
    min-height: 640px;
}

.add-hour-item-modal .ahi-field {
    margin-bottom: 12px;
}

.add-hour-item-modal .ahi-field label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
}

/* Inline checkbox + label (reset the global full-width input rule) */
.add-hour-item-modal .ahi-checkbox-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 4px 0 14px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
}

.add-hour-item-modal .ahi-checkbox-row input {
    min-width: 0;
    width: 16px;
    height: 16px;
    margin: 0;
    cursor: pointer;
}

.add-hour-item-modal .ahi-rates-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.add-hour-item-modal .ahi-rates-note {
    margin-bottom: 10px;
    font-size: 0.82rem;
    opacity: 0.8;
    color: var(--font-color);
}

.add-hour-item-modal .ahi-rates-title {
    font-weight: 600;
    font-size: 0.9rem;
}

.hour-rate-rows {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.hour-rate-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 92px 92px 32px;
    gap: 25px;
    margin: 5px 0px;
    align-items: center;
}

/* Construction labor prices off Cost only: hide the Rate input and drop its column. */
.add-hour-item-modal.cost-only .hour-rate-row {
    grid-template-columns: minmax(0, 1fr) 92px 32px;
}

.add-hour-item-modal.cost-only .hour-rate-row [data-field="rate"] {
    display: none;
}

/* Reset the global .modal-content input/select sizing inside the grid */
.hour-rate-row input {
    min-width: 0;
    width: 100%;
    margin-top: 0;
}

.hour-rate-row select,
.hour-rate-row .custom-dropdown {
    width: 100%;
    margin-top: 0;
}

.hour-rate-remove-btn {
    width: 32px;
    height: 32px;
    min-width: 32px;
    padding: 0;
    border: 1px solid var(--accent-color);
    border-radius: 6px;
    background-color: var(--background-color);
    background-image: url("/caddy/images/icons/trashcan/Light Trashcan.png");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 16px 16px;
    cursor: pointer;
    /* margin-top: 5px; */
}

/* Per-row multi-select office dropdown (sits in the first column of .hour-rate-row) */
.add-hour-item-modal .ahi-office-dropdown {
    position: relative;
    width: 100%;
}

.add-hour-item-modal .ahi-office-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    padding: 6px 10px !important;
    margin-top: 0 !important;
    border: 1px solid var(--other-color) !important;
    border-radius: 6px !important;
    background-color: var(--background-color) !important;
    color: var(--font-color) !important;
    font-size: 0.9rem !important;
    cursor: pointer !important;
}

.add-hour-item-modal .ahi-office-summary {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.add-hour-item-modal .ahi-office-caret {
    flex: 0 0 auto;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid var(--font-color);
}

.add-hour-item-modal .ahi-office-panel {
    position: absolute;
    z-index: 5;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    max-height: 240px;
    overflow-y: auto;
    padding: 6px;
    border: 1px solid var(--other-color);
    border-radius: 8px;
    background-color: var(--background-color);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
}

.add-hour-item-modal .ahi-bulk-divider {
    height: 1px;
    margin: 4px 0;
    background-color: var(--other-color);
}

.add-hour-item-modal .ahi-bulk-option {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 8px 10px;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.12s ease;
}

.add-hour-item-modal .ahi-bulk-option:hover {
    background-color: color-mix(in srgb, var(--font-color) 8%, transparent);
}

.add-hour-item-modal .ahi-bulk-option input[type="checkbox"] {
    flex: 0 0 auto;
    width: 16px;
    min-width: 16px;
    height: 16px;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 0;
    background-color: transparent !important;
    accent-color: var(--accent-color-strong, var(--accent-color));
    cursor: pointer;
}

.add-hour-item-modal .ahi-bulk-option span {
    flex: 1 1 auto;
    text-align: left;
}

/* An office already chosen in another row: greyed out and not selectable. */
.add-hour-item-modal .ahi-bulk-option.ahi-option-disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.add-hour-item-modal .ahi-bulk-option.ahi-option-disabled input[type="checkbox"] {
    cursor: not-allowed;
}
