.box-search {
    border: 1px solid var(--bd-e0e0e0);
    border-radius: 8px;
    padding: 10px;
    max-width: 100%;
}

.box-search input {
    font-weight: 600;
    font-size: 13px;
    width: 270px;
    border: none;
}

.box-search input:focus {
    outline: none;
}

.box-search input:focus::-moz-placeholder {
    opacity: 0;
    -moz-transition: 300ms;
    transition: 300ms;
}

.box-search input:focus::placeholder {
    opacity: 0;
    transition: 300ms;
}

.date-filter-field {
    width: 160px;
    max-width: 100%;
}

.branch-search-form {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    max-width: 620px;
}

.branch-search-form-multi {
    max-width: none;
    flex-wrap: wrap;
}

.payroll-filters {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px dashed var(--line);
}

.branch-search-form-multi .branch-search-input-wrap {
    flex: 0 1 260px;
    min-width: 220px;
}

.branch-search-input-wrap,
.branch-search-branch-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    border: 1.5px solid var(--bd-e3e2df);
    border-radius: 8px;
    padding: .5rem .8rem;
    color: var(--fg-9a9a9a);
    background: var(--bg-ffffff);
    transition: border-color .15s ease, box-shadow .15s ease;
}

.branch-search-input-wrap {
    flex: 1;
}

.branch-search-branch-wrap {
    flex-shrink: 0;
    width: 180px;
}

.branch-search-input-wrap:focus-within,
.branch-search-branch-wrap:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--sh-a8760a-a012);
    color: var(--primary);
}

.branch-search-branch-wrap .select2-container {
    width: 100% !important;
}

.branch-search-branch-wrap .select2-selection--single {
    border: 0 !important;
    background: transparent !important;
    height: 22px !important;
}

.branch-search-branch-wrap .select2-selection__rendered {
    padding: 0 !important;
    line-height: 22px !important;
    font-size: 14px;
    color: var(--fg-333333);
}

.branch-search-branch-wrap .select2-selection__arrow {
    height: 22px !important;
    top: 0 !important;
}

.branch-search-icon {
    flex-shrink: 0;
    font-size: 13px;
}

.branch-search-input-wrap input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    font-size: 14px;
    color: var(--fg-333333);
}

.branch-search-submit {
    flex-shrink: 0;
    white-space: nowrap;
    padding: .45rem 1.1rem !important;
    font-size: 13px !important;
    border-radius: 8px !important;
}

@media (max-width: 767.98px) {
    .branch-search-form {
        flex-wrap: nowrap;
        max-width: 100%;
        overflow-x: auto;
        padding-bottom: 4px;
    }

    .branch-search-input-wrap {
        flex: 0 0 200px;
    }

    .branch-search-branch-wrap {
        flex: 0 0 160px;
    }

    .branch-search-submit,
    .branch-search-form>a.btn-light {
        flex-shrink: 0;
    }
}

.branch-search-form>a.btn-light {
    padding: .45rem 1.1rem !important;
    font-size: 13px !important;
    border-radius: 8px !important;
    border: 1.5px solid var(--bd-e3e2df) !important;
    background: var(--bg-ffffff) !important;
    color: var(--fg-444444) !important;
    font-weight: 600;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.branch-search-form>a.btn-light:hover {
    background: var(--primary-tint) !important;
    border-color: var(--primary) !important;
    color: var(--primary-deep) !important;
}

.branch-status-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.branch-status-filter {
    display: inline-flex;
    align-items: center;
    padding: .45rem 1rem;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    color: var(--fg-ffffff);
    opacity: .55;
    transition: opacity .15s ease, box-shadow .15s ease;
}

.branch-status-filter:hover {
    color: var(--fg-ffffff);
    opacity: .8;
}

.branch-status-filter.active {
    opacity: 1;
    box-shadow: 0 0 0 2px var(--sh-000000-a012);
}

.branch-status-filter-all {
    background: var(--bg-1f2937);
}

.branch-status-filter-active {
    background: var(--bg-16a34a);
}

.branch-status-filter-inactive {
    background: var(--bg-6b7280);
}

.branch-status-filter-archived {
    background: var(--bg-d97706);
}

.branch-status-filter-blocked {
    background: var(--bg-dc3545);
}

.branch-status-filter-permanent {
    background: var(--bg-16a34a);
}

.branch-status-filter-primary {
    background: var(--bg-0ea5e9);
}

.branch-status-filter-archive {
    background: var(--bg-475569);
    opacity: 1;
}

.branch-status-filter-archive:hover {
    opacity: .85;
}

.branch-status-filter-archive.active {
    background: var(--primary);
    box-shadow: 0 0 0 2px var(--sh-000000-a012);
    opacity: 1;
}

.category-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.category-tab {
    display: inline-flex;
    align-items: center;
    padding: .45rem 1rem;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    color: var(--primary-deep);
    background: var(--primary-tint);
    transition: background .15s ease, color .15s ease;
}

.category-tab:hover {
    background: var(--bg-f5e1a8);
    color: var(--primary-deep);
}

.category-tab.active {
    background: var(--primary);
    color: var(--fg-ffffff);
}

.branch-status-filter-active,
.branch-status-filter-permanent {
    background-color: var(--bg-15803d) !important;
}

.branch-status-filter-inactive {
    background-color: var(--bg-6b7280) !important;
}

.branch-status-filter-blocked {
    background-color: var(--bg-dc2626) !important;
}

.branch-status-filter-archived {
    background-color: var(--bg-b45309) !important;
}

.branch-status-filter-primary {
    background-color: var(--bg-5b7590) !important;
}

@media (max-width: 767.98px) {
    .branch-status-filters {
        width: 100%;
    }

    .branch-status-filter {
        flex: 1 1 0;
        justify-content: center;
        white-space: nowrap;
    }

    .branch-search-form,
    .branch-search-form-multi {
        flex-wrap: wrap;
        width: 100%;
        max-width: 100%;
        overflow: visible;
        padding-bottom: 0;
    }

    .branch-search-form .branch-search-input-wrap,
    .branch-search-form-multi .branch-search-input-wrap {
        flex: 1 1 0;
        min-width: 0;
    }

    .branch-search-form .branch-search-branch-wrap {
        flex: 1 1 100%;
        width: 100%;
        min-width: 0;
    }

    .branch-search-submit,
    .branch-search-form>a.btn-light {
        flex: 0 0 auto;
        text-align: center;
    }
}

.branch-status-filter-pending {
    background-color: var(--bg-b45309) !important;
}

.branch-status-filter-sent {
    background-color: var(--bg-5b7590) !important;
}

.branch-status-filter-received {
    background-color: var(--bg-15803d) !important;
}

.branch-status-filter-cancelled {
    background-color: var(--bg-6b7280) !important;
}

.branch-status-filter-overtime-pending {
    background-color: var(--bg-b45309);
}

.branch-status-filter-overtime-approved {
    background-color: var(--bg-15803d);
}

.branch-status-filter-overtime-rejected {
    background-color: var(--bg-6b7280);
}

.branch-status-filter-leave-pending {
    background-color: var(--bg-b45309);
}

.branch-status-filter-leave-approved {
    background-color: var(--bg-15803d);
}

.branch-status-filter-leave-rejected {
    background-color: var(--bg-dc2626);
}

.branch-status-filter-leave-cancelled {
    background-color: var(--bg-6b7280);
}

.att-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: .9rem;
}

.att-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.att-filter {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: .3rem .8rem;
    border: 1.5px solid var(--bd-e3e2df);
    border-radius: 999px;
    background: var(--bg-ffffff);
    color: var(--fg-444444);
    font-size: 13px;
    font-weight: 600;
}

.att-filter:hover {
    border-color: var(--primary);
}

.att-filter.is-active {
    background: var(--primary-tint);
    border-color: var(--primary);
    color: var(--primary-deep);
}

.att-filter-count {
    min-width: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--bg-000000-a006);
    font-size: 11.5px;
    text-align: center;
}

.branch-status-filter-scheduled {
    background-color: var(--bg-5b7590) !important;
    color: var(--fg-ffffff);
}

.branch-status-filter-confirmed {
    background-color: var(--bg-a8760a) !important;
    color: var(--fg-ffffff);
}

.branch-status-filter-checked_in {
    background-color: var(--bg-b45309) !important;
    color: var(--fg-ffffff);
}

.branch-status-filter-completed {
    background-color: var(--bg-15803d) !important;
    color: var(--fg-ffffff);
}

.branch-status-filter-no_show {
    background-color: var(--bg-dc2626) !important;
    color: var(--fg-ffffff);
}

.branch-status-filter-visit-checked_in {
    background-color: var(--bg-5b7590) !important;
    color: var(--fg-ffffff);
}

.branch-status-filter-visit-open {
    background-color: var(--bg-b45309) !important;
    color: var(--fg-ffffff);
}

.branch-status-filter-visit-completed {
    background-color: var(--bg-15803d) !important;
    color: var(--fg-ffffff);
}

.branch-status-filter-visit-cancelled {
    background-color: var(--bg-6b7280) !important;
    color: var(--fg-ffffff);
}

.branch-status-filter-lab-draft {
    background-color: var(--bg-6b7280) !important;
    color: var(--fg-ffffff);
}

.branch-status-filter-lab-sent {
    background-color: var(--bg-5b7590) !important;
    color: var(--fg-ffffff);
}

.branch-status-filter-lab-received {
    background-color: var(--bg-a8760a) !important;
    color: var(--fg-ffffff);
}

.branch-status-filter-lab-try_in {
    background-color: var(--bg-7c5ba6) !important;
    color: var(--fg-ffffff);
}

.branch-status-filter-lab-delivered {
    background-color: var(--bg-15803d) !important;
    color: var(--fg-ffffff);
}

.branch-status-filter-lab-cancelled {
    background-color: var(--bg-9ca3af) !important;
    color: var(--fg-ffffff);
}

.attendance-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding-bottom: 16px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--line);
}

.attendance-filters {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.attendance-filters .branch-search-input-wrap {
    flex: 1 1 280px;
    min-width: 200px;
}

.attendance-filters .branch-search-branch-wrap {
    flex: 0 0 200px;
    width: 200px;
}

@media (max-width: 575.98px) {
    .attendance-filters .branch-search-branch-wrap {
        flex: 1 1 100%;
        width: 100%;
    }

    .attendance-filters .branch-search-submit {
        flex: 1;
    }

    .date-filter-row {
        flex-direction: column;
        align-items: stretch;
    }

    .date-filter-form {
        width: 100%;
    }

    .date-filter-field {
        width: 100%;
    }

    .date-filter-form .main-btn {
        flex: 1 1 auto;
        justify-content: center;
    }

    .box-search {
        width: 100%;
        margin-top: .5rem;
    }

    .box-search form {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .box-search img {
        flex: 0 0 auto;
        width: 18px;
        height: 18px;
    }

    .box-search input {
        flex: 1 1 auto;
        width: auto;
        min-width: 0;
    }
}

.filter-panel {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 10px;
    align-items: center;
}

.filter-panel .branch-search-branch-wrap,
.filter-panel .branch-search-input-wrap {
    width: auto;
    height: 42px;
}

.filter-panel .filter-date-range {
    grid-column: span 2;
}

.filter-panel-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-panel-actions .btn {
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 1.1rem !important;
    font-size: 13px !important;
    border-radius: 8px !important;
    white-space: nowrap;
}

.filter-panel-actions .btn-light {
    border: 1.5px solid var(--bd-e3e2df) !important;
    background: var(--bg-ffffff) !important;
    color: var(--fg-444444) !important;
    font-weight: 600;
}

.filter-panel-actions .btn-light:hover {
    background: var(--primary-tint) !important;
    border-color: var(--primary) !important;
    color: var(--primary-deep) !important;
}

.filter-panel-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed var(--line);
    font-size: 13px;
    color: var(--fg-6b7280);
}

.filter-date-range {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    height: 42px;
    padding: 0 .8rem;
    border: 1.5px solid var(--bd-e3e2df);
    border-radius: 8px;
    background: var(--bg-ffffff);
    color: var(--fg-9a9a9a);
    transition: border-color .15s ease, box-shadow .15s ease;
}

.filter-date-range:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--sh-a8760a-a012);
    color: var(--primary);
}

.filter-date-range-icon {
    flex-shrink: 0;
    font-size: 14px;
}

.filter-date-range-field {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1 1 0;
    min-width: 0;
    margin: 0;
    cursor: pointer;
}

.filter-date-range-field span {
    flex-shrink: 0;
    font-size: 12px;
    font-weight: 600;
    color: var(--fg-6b7280);
}

.filter-date-range-field input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    padding: 0;
    background: transparent;
    font-size: 14px;
    color: var(--fg-333333);
    direction: ltr;
    text-align: start;
}

.filter-date-range-sep {
    flex-shrink: 0;
    width: 1px;
    height: 20px;
    background: var(--bd-e3e2df);
}

.filter-inline-form {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-inline-form .filter-date-range {
    width: 340px;
    max-width: 100%;
}

@media (max-width: 575.98px) {
    .filter-panel {
        grid-template-columns: 1fr;
    }

    .filter-panel .filter-date-range {
        grid-column: auto;
    }

    .filter-panel-actions .btn {
        flex: 1;
    }

    .filter-inline-form,
    .filter-inline-form .filter-date-range {
        width: 100%;
    }
}
