/* Timebinder Redesign Styles */
/* Reusable form field styles */

.tb-theme h1{
  color: #000;
}

.tb-form-label {
    font-weight: 500;
    color: #3f4254;
}

.tb-label-required {
    color: var(--tb-color-primary);
}

.tb-input {
    width: 100%;
    min-height: 48px;
    padding: 12px 18px;
    border: 1px solid #E1E3EA;
    border-radius: 6px;
    background-color: #ffffff;
    color: #181c32;
    font-size: 14px;
    box-shadow: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.tb-input::placeholder {
  color: #c7c9d7;
  opacity: 1;
  font-size: 13px;
  font-weight: 500;
}

.tb-input[type="search"]::-webkit-search-cancel-button {
  filter: brightness(0) saturate(100%) invert(68%) sepia(13%) saturate(411%) hue-rotate(191deg) brightness(87%) contrast(88%);
  cursor: pointer;
  opacity: 1;
}

.select2-container .select2-selection--single {
    padding: 0 20px !important;
}

.tb-select2-container .select2-selection--single {
    position: relative;
    padding: 0 38px 0 20px !important;
}

.tb-select2-container .select2-selection--multiple {
    position: relative;
    padding-right: 38px !important;
}

.tb-select2-container .select2-selection--single.select2-selection--clearable,
.tb-select2-container .select2-selection--multiple.select2-selection--clearable {
    padding-right: 62px !important;
}

.tb-select2-container .select2-selection--single::after,
.tb-select2-container .select2-selection--multiple::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 14px;
    width: 8px;
    height: 8px;
    border-right: 1px solid #5E6278;
    border-bottom: 1px solid #5E6278;
    transform: translateY(-60%) rotate(45deg);
    pointer-events: none;
    opacity: 0.9;
}


.tb-select2-container .select2-selection--single.select2-selection--clearable::before,
.tb-select2-container .select2-selection--multiple.select2-selection--clearable::before {
    content: "";
    position: absolute;
    top: 50%;
    right: 30px;
    width: 1px;
    height: 12px;
    background: #D8DCE6;
    border-radius: 999px;
    transform: translateY(-50%);
    pointer-events: none;
}

.tb-select2-container .select2-selection--single .select2-selection__clear,
.tb-select2-container .select2-selection--multiple .select2-selection__clear {
    position: absolute;
    top: 50%;
    right: 38px;
    transform: translateY(-50%);
    margin: 0 !important;
    padding: 0 !important;
    color: #98A2B3 !important;
    font-size: 20px;
    line-height: 1;
    z-index: 2;
}

.tb-select2-container .select2-selection--single .select2-selection__clear:hover,
.tb-select2-container .select2-selection--multiple .select2-selection__clear:hover {
    color: #7C8499 !important;
}

.tb-select2-container .select2-selection__arrow {
    display: none !important;
}

.tb-select2-container .select2-selection.form-select {
    background-image: none;
}

.select2-container .select2-selection__placeholder,
.tb-select2-dropdown .select2-search--dropdown .select2-search__field::placeholder {
  color: #c7c9d7 !important;
  font-size: 13px;
  font-weight: 500;
  line-height: 16px !important;
  opacity: 1;
}

.tb-select2-container.select2-container--disabled .form-select .select2-selection__placeholder,
.tb-select2-container.select2-container--disabled .select2-selection__placeholder
 {
  color: #c7c9d7 !important;
  font-size: 13px;
  font-weight: 500;
  opacity: 1;
}

.tb-select2-container .select2-selection {
    background-color: #ffffff;
    border-color: #E1E3EA;
    transition: border-color 0.24s ease-out, box-shadow 0.24s ease-out, background-color 0.24s ease-out;
}

.tb-select2-container .select2-selection__rendered {
  font-size: 13px !important;
  font-weight: 500 !important;
  line-height: 16px !important;
  color: #5E6278 !important;
}

.tb-select2-container.select2-container--open:not(.select2-container--disabled) .select2-selection {
    background-color: #ffffff !important;
    border-color: var(--tb-color-primary) !important;
    box-shadow: 0 0 0 3px rgba(var(--tb-color-primary-rgb), 0.12) !important;
    outline: none;
}

.tb-select2-container.select2-container--disabled .form-select {
    background-color: #F9F9F9 !important;
    color: #A1A5B7 !important;
}

.tb-select2-dropdown {
    border-color: rgba(var(--tb-color-primary-rgb), 0.18) !important;
    box-shadow: 0 18px 44px rgba(15, 23, 42, 0.12);
    padding: 0 !important;
    margin-top: 10px;
    overflow: hidden;
}

.tb-select2-dropdown .select2-search--dropdown {
    padding: 12px;
}

.tb-select2-dropdown .select2-search--dropdown .select2-search__field {
    min-height: 48px;
    padding: 17px 15px;
    border: 1px solid #E1E3EA;
    border-radius: 6px;
    background-color: #ffffff;
    color: #181c32;
    font-size: 14px;
    box-shadow: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.tb-select2-dropdown .select2-search--dropdown .select2-search__field:focus {
    border-color: var(--tb-color-primary);
    box-shadow: none;
    outline: none;
}

.tb-select2-dropdown .select2-results > .select2-results__options {
    scrollbar-width: thin;
    scrollbar-color: var(--tb-color-primary) rgba(var(--tb-color-primary-rgb), 0.12);
}

.tb-select2-dropdown .select2-results > .select2-results__options::-webkit-scrollbar-track {
    background: rgba(var(--tb-color-primary-rgb), 0.12);
    border-radius: 999px;
}

.tb-select2-dropdown .select2-results > .select2-results__options::-webkit-scrollbar-thumb {
    background: var(--tb-color-primary);
    border-radius: 999px;
}

.tb-select2-dropdown .select2-results__option--highlighted.select2-results__option--selectable,
.tb-select2-dropdown .select2-results__option--selected {
    background-color: #FFDFFF !important;
    color: var(--tb-color-primary) !important;
    box-shadow: inset 0 0 0 9999px #FFDFFF;
}

.tb-select2-dropdown .select2-results__option--selected:after {
    display: none !important;
}

/* For multiple select */
.tb-select2-container .select2-selection--multiple {
  display: flex !important;
}

.tb-select2-container .select2-selection--multiple .select2-search__field::placeholder {
  color: #c7c9d7 !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  line-height: 16px !important;
  opacity: 1;
}

.select2-selection--multiple .select2-selection__rendered {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
}

.select2-selection__choice__display {
  color: var(--tb-color-primary) !important;
  font-size: 13px !important;
  font-weight: 500 !important;
}

.select2-selection__choice {
  background: #F2EBFD !important;
}

.select2-selection__choice__remove{
  opacity: 1 !important;
  background-color: #632EBE !important;
}

/* Remove highlight from already-selected item (hover still works) */
.tb-select2-no-selected-highlight .select2-results__option--selected:not(.select2-results__option--highlighted) {
    background-color: transparent !important;
    color: inherit !important;
    box-shadow: none !important;
}

.tb-select2-no-selected-highlight .select2-results__option--selected:not(.select2-results__option--highlighted):after {
    display: none !important;
}

.tb-select2-dropdown--multiple .select2-results__option--selectable {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tb-select2-dropdown--multiple .select2-results__option--selectable::before {
    content: "";
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    font-size: 11px;
    font-weight: 700;
    border: 1px solid #A1A5B7;
    border-radius: 2px;
    background: #ffffff;
}

.tb-select2-dropdown--multiple .select2-results__option--selected::before {
    content: "\2713";
    color: var(--tb-color-primary-inverse, #ffffff);
    border-color: var(--tb-color-primary-active, #6D28D9);
    background: var(--tb-color-primary-active, #6D28D9);
}

.tb-input:focus {
    border-color: var(--tb-color-primary);
    box-shadow: 0 0 0 3px rgba(var(--tb-color-primary-rgb), 0.12);
    outline: none;
}

.tb-input-invalid,
.tb-input-invalid:focus,
.tb-input.tb-input-invalid:focus {
    border-color: #f1416c;
    box-shadow: none !important;
    outline: none;
}

/* tb-input-invalid only sets border-color, which is invisible on a rich text editor
   because .tb-notes-trix-wrapper trix-editor sets `border: none`. Give it a real
   border so the over-limit highlight shows on Trix the same as on any other field.
   The wrapper selector is repeated to outrank that rule. */
trix-editor.tb-input-invalid,
.tb-notes-trix-wrapper trix-editor.tb-input-invalid {
    border: 1px solid #f1416c;
}

select.tb-input-invalid,
select.tb-input-invalid:focus,
select.tb-input-invalid:disabled {
    border-color: #f1416c !important;
    box-shadow: none !important;
}

.select2-container .select2-selection--single.tb-input-invalid,
.tb-input-invalid + .select2-container .select2-selection--single,
.tb-input-invalid + .select2-container .select2-selection--multiple,
.tb-input-invalid + .select2-container.select2-container--disabled .select2-selection--single {
    border-color: #f1416c !important;
    box-shadow: none !important;
}

.tb-input-invalid + .select2-container.select2-container--open .select2-selection--single,
.tb-input-invalid + .select2-container.select2-container--focus .select2-selection--single,
.tb-input-invalid + .select2-container.select2-container--open .select2-selection--multiple,
.tb-input-invalid + .select2-container.select2-container--focus .select2-selection--multiple {
  border-color: #f1416c !important;
  box-shadow: none !important;
}

/* :user-invalid matches as soon as the browser considers a field "interacted",
   which is a much lower bar than an actual submit attempt — gate behind
   .was-validated so no red border shows until the user has tried to submit,
   consistent with the :invalid convention in employees.css. */
.was-validated .employee-form-section.tb-input input:required:user-invalid,
.was-validated .employee-form-section.tb-input input:required:user-invalid:focus,
.was-validated .employee-form-section.tb-input select:required:user-invalid,
.was-validated .employee-form-section.tb-input select:required:user-invalid:focus,
.was-validated .employee-personal-information-section__field:required:user-invalid,
.was-validated .employee-personal-information-section__field:required:user-invalid:focus {
  border-color: #f1416c !important;
  box-shadow: none !important;
  outline: none;
}

.was-validated .employee-form-section.tb-input select:required:user-invalid + .select2-container .select2-selection--single,
.was-validated .employee-form-section.tb-input select:required:user-invalid + .select2-container.select2-container--disabled .select2-selection--single,
.was-validated .employee-personal-information-section__field:required:user-invalid + .select2-container .select2-selection--single,
.was-validated .employee-personal-information-section__field:required:user-invalid + .select2-container.select2-container--disabled .select2-selection--single {
  border-color: #f1416c !important;
  box-shadow: none !important;
}

.was-validated .employee-form-section.tb-input select:required:user-invalid + .select2-container.select2-container--open .select2-selection--single,
.was-validated .employee-form-section.tb-input select:required:user-invalid + .select2-container.select2-container--focus .select2-selection--single,
.was-validated .employee-personal-information-section__field:required:user-invalid + .select2-container.select2-container--open .select2-selection--single,
.was-validated .employee-personal-information-section__field:required:user-invalid + .select2-container.select2-container--focus .select2-selection--single {
  border-color: #f1416c !important;
  box-shadow: none !important;
}

.tb-input-time-primary::-webkit-calendar-picker-indicator {
    filter: brightness(0) saturate(100%) invert(27%) sepia(82%) saturate(2260%) hue-rotate(247deg) brightness(88%) contrast(102%);
    cursor: pointer;
}

.tb-link {
    color: var(--tb-color-primary) !important;
    text-decoration: none;
    font-weight: 700;
}

.tb-link:hover,
.tb-link:focus {
    color: var(--tb-link-hover-color) !important;
    text-decoration: none;
}

.tb-divider {
    color: #a1a5b7;
    font-size: 12px;
    font-weight: 600;
}

.tb-divider::before,
.tb-divider::after {
    content: "";
    flex: 1;
    border-top: 1px solid #e3e6ef;
}

.tb-divider::before {
    margin-right: 12px;
}

.tb-divider::after {
    margin-left: 12px;
}

/* button */

.tb-button {
    border-width: 1px;
    border-style: solid;
    min-height: 48px;
}

.tb-button-primary {
    color: var(--tb-color-primary) !important;
    border-color: var(--tb-color-primary) !important;
}

.tb-button-primary-reversed {
  color: #ffffff !important;
  background-color: #7c3aed !important;
  border-color: #7c3aed !important;
}

.tb-button-primary:hover,
.tb-button-primary:focus,
.tb-button-primary:active {
    color: var(--tb-color-primary) !important;
    border-color: var(--tb-color-primary) !important;
    background-color: rgba(var(--tb-color-primary-rgb), 0.08) !important;
}

.tb-button-primary-reversed:hover,
.tb-button-primary-reversed:focus,
.tb-button-primary-reversed:active {
  color: #ffffff !important;
  background-color: #6929d1 !important;
  border-color: #6929d1 !important;
}

.tb-btn-submit {
    background: linear-gradient(90deg, color-mix(in srgb, var(--tb-color-primary) 88%, white) 0%, var(--tb-color-primary) 100%);
    border: none;
    min-height: 48px;
}

.tb-btn-submit:hover,
.tb-btn-submit:focus {
    background: linear-gradient(90deg, color-mix(in srgb, var(--tb-link-hover-color) 88%, white) 0%, var(--tb-link-hover-color) 100%);
}

/* action button */

.tb-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    /* height: 36px; */
    gap: 8px;
    border-width: 0;
    border-radius: 6px;
    font-size: 13px;
    padding: 12px 16px;
    font-weight: 500;
}

.tb-action-btn-cancel {
  color: #7c3aed;
  background: #F2EBFD;
}

.tb-pagination {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tb-pagination .pagy-bootstrap-nav,
.tb-pagination nav {
  margin: 0;
}

.tb-pagination .pagination {
  --bs-pagination-padding-x: 0;
  --bs-pagination-padding-y: 0;
  --bs-pagination-border-width: 0;
  --bs-pagination-border-radius: 10px;
  --bs-pagination-bg: transparent;
  --bs-pagination-color: #98A2B3;
  --bs-pagination-hover-color: #7C3AED;
  --bs-pagination-hover-bg: transparent;
  --bs-pagination-focus-color: #7C3AED;
  --bs-pagination-focus-bg: transparent;
  --bs-pagination-focus-box-shadow: none;
  --bs-pagination-active-color: #7C3AED;
  --bs-pagination-active-bg: #F8D4F8;
  --bs-pagination-active-border-color: transparent;
  --bs-pagination-disabled-color: #D0D5DD;
  gap: 2px;
  align-items: center;
  margin-bottom: 0;
}

.tb-pagination .page-item {
  display: flex;
  align-items: center;
  margin-right: 0;
}

.tb-pagination .page-link {
  display: inline-flex;
  min-width: 30px;
  height: 30px;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  border: 0;
  background: transparent;
  color: #98A2B3;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  border-radius: 10px;
  box-shadow: none;
}

.tb-pagination .page-item.active .page-link {
  background: #FFDFFF;
  color: #7C3AED;
  border-radius: 6px;
}

.tb-pagination .page-item:not(.active):not(.disabled) .page-link:hover {
  color: #7C3AED;
}

.tb-pagination .page-item:first-child .page-link,
.tb-pagination .page-item:last-child .page-link {
  min-width: 22px;
  height: 22px;
  padding: 0;
  color: #C5CADB;
  font-size: 18px;
  font-weight: 400;
  border-radius: 999px;
  transform: none;
}

.tb-pagination .page-item.disabled .page-link {
  color: #E4E7EC;
  opacity: 1;
}

.tb-action-btn-cancel:hover,
.tb-action-btn-cancel:focus {
    color: #6d28d9;
    background: #ead7ff;
}

.tb-action-btn-edit {
    color: #7c3aed;
    background: #fff;
    border: 0;
    box-shadow: none;
    font-size: 13px;
    font-weight: 700;
}

.tb-action-btn-edit:hover,
.tb-action-btn-edit:focus {
    color: #6d28d9;
    background: #faf7ff;
}

.tb-action-btn-submit {
    background: #7c3aed;
    color: #fff;
    box-shadow: none;
}

.tb-action-btn-submit:hover,
.tb-action-btn-submit:focus {
    background: #6d28d9;
    color: #fff;
}

.tb-action-btn-submit:disabled {
    cursor: not-allowed;
    color: #A1A5B7;
    background-color: #F1F1F2;
}

.tb-action-btn-delete-border-none {
    color: #F1416C;
    background: #fff;
    border: 0;
    box-shadow: none;
    font-size: 13px;
    font-weight: 700;
}

.tb-action-btn-delete-border-none:hover {
    color: #F1416C;
    background: #FFF5F8;
}

.tb-action-btn-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* ── Select2 multiple chip styling inside tb-theme ─────────────── */

.tb-select2-container .select2-selection--multiple {
    min-height: 48px;
    padding: 12px;
    border: 1px solid #E1E3EA;
    border-radius: 6px;
    background: #fff;
    display: flex;
    align-items: center;
    transition: border-color 0.24s ease-out, box-shadow 0.24s ease-out;
}

.tb-select2-container.select2-container--open .select2-selection--multiple,
.tb-select2-container.select2-container--focus .select2-selection--multiple {
    border-color: var(--tb-color-primary) !important;
    box-shadow: 0 0 0 3px rgba(var(--tb-color-primary-rgb), 0.12) !important;
    outline: none;
}

.tb-select2-container .select2-selection--multiple .select2-selection__rendered {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px;
    padding: 4px 0 !important;
    align-items: center;
    line-height: normal;
}

.tb-select2-container .select2-selection__choice {
    padding: 4px 10px !important;
    height: 24px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    background: #F2EBFD !important;
    border: none !important;
    border-radius: 9999px !important;
    font-size: 13px !important;
    color: #7C3AED !important;
    font-weight: 500 !important;
    margin: 0 !important;
    white-space: nowrap !important;
    max-width: 260px !important;
    overflow: visible !important;
    text-overflow: ellipsis !important;

    flex-direction: row !important;
}

.tb-select2-container .select2-selection__choice__remove {
    position: static !important;
    right: auto !important;
    transform: none !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 8px !important;
    height: 8px !important;
    background: #632EBE !important;
    font-size: 12px !important;
    font-weight: 700 !important;

    line-height: 1 !important;
    cursor: pointer !important;
    padding: 0 !important;
    flex-shrink: 0 !important;
    order: 1 !important;
    aspect-ratio: 1 / 1 !important;
    opacity: 1 !important;
}

.tb-select2-container .select2-selection__choice__remove:hover {
    background: #B089F4 !important;
    color: #fff !important;
}

.tb-select2-container .select2-selection__choice__display {
    order: 0;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px !important;
}

.tb-select2-container .select2-selection--multiple .select2-search__field {
    min-width: 120px;
    font-size: 13px;
    font-weight: 500;
    color: #181c32;
    border: none;
    outline: none;
    background: transparent;
    margin: 0;
}

.tb-select2-container .select2-selection--multiple .select2-search__field::placeholder {
    color: #c7c9d7;
    font-weight: 500;
}
/* Connected icon + name input group */
.tb-icon-name-group {
  display: flex;
  align-items: stretch;
  border: 1px solid #E1E3EA;
  border-radius: 6px;
  background: #fff;
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.tb-icon-name-group:focus-within {
  border-color: var(--tb-color-primary);
  box-shadow: 0 0 0 3px rgba(var(--tb-color-primary-rgb), 0.12);
}

.tb-icon-name-group:has(input.tb-input-invalid) {
  border-color: #F1416C;
}

.tb-icon-name-group:has(input.tb-input-invalid):focus-within {
  border-color: #F1416C;
  box-shadow: none;
}

.tb-icon-name-group .tb-icon-name-group__icon {
  flex-shrink: 0;
  border-right: 1px solid #E1E3EA;
}

.tb-icon-name-group .select2-container .select2-selection--single,
.tb-icon-name-group .select2-container.select2-container--open .select2-selection--single,
.tb-icon-name-group .select2-container.select2-container--focus .select2-selection--single {
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
}

.tb-icon-name-group .tb-icon-name-group__name input.tb-input {
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
}

/* Icon picker trigger inside the name group */
.tb-icon-name-group .tb-icon-picker {
  height: 100%;
}

.tb-icon-name-group .tb-icon-picker-trigger {
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  height: 100%;
}

.tb-icon-name-group:has(.tb-icon-picker-trigger--invalid) {
  border-color: #F1416C;
}

.tb-icon-name-group:has(.tb-icon-picker-trigger--invalid):focus-within {
  border-color: #F1416C;
  box-shadow: none;
}

/* ---- Icon Picker Component ---- */
.tb-icon-picker {
  position: relative;
  display: inline-block;
  width: 100%;
}

.tb-icon-picker-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  width: 100%;
  height: 48px;
  padding: 0 12px;
  background: transparent;
  border: 1px solid #E1E3EA;
  border-radius: 6px;
  cursor: pointer;
  color: #5E6278;
  transition: border-color 0.2s ease;
}

.tb-icon-picker-trigger:focus {
  outline: none;
}

.tb-icon-picker-trigger--invalid {
  border-color: #F1416C;
}

.tb-icon-picker-icon-display {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.tb-icon-picker-icon-display svg {
  width: 24px;
  height: 24px;
  color: #7C3AED;
}

.tb-icon-picker-chevron {
  flex-shrink: 0;
  color: #A1A5B7;
  transition: transform 0.15s ease;
}

.tb-icon-picker-trigger[aria-expanded="true"] .tb-icon-picker-chevron {
  transform: rotate(180deg);
}

/* Dropdown panel — position: fixed is applied via JS */
.tb-icon-picker-dropdown {
  z-index: 1050;
  background: #fff;
  border: 1px solid #E1E3EA;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  padding: 12px;
}

.tb-icon-picker-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  justify-items: center;
  gap: 6px;
}

.tb-icon-picker-item {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  padding: 8px;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.tb-icon-picker-item:hover {
  background: #FEF4FF;
}

.tb-icon-picker-item--active {
  background: #FEF4FF;
}

.tb-icon-picker-item svg {
  width: 24px;
  height: 24px;
  color: #7C3AED;
}

/* leave_type_icon_svg helper output (used in show page) */
.tb-icon-picker-display {
  display: inline-flex;
  align-items: center;
}

.tb-icon-picker-display svg {
  color: inherit;
}

.tb-number:disabled {
  cursor: not-allowed;
  color: #A1A5B7;
  background-color: #F1F1F2;
}
